Use Maddy’s self-built post office service

Original link: https://hsiaofeng.com/archives/227.html

Maddy is an email server software.

Due to many problems in the installation following the official guidance , I wrote a tutorial here.

initial

First download the executable file maddy-版本号-x86_64-linux-musl.tar.zst from GitHub Release or the official website .

Unzip the file and move into the directory. Move the executable file maddy to /usr/local/bin/ , and the files in the systemd directory to /etc/systemd/system .

 apt install zstd tar -I zstd -xvf maddy-版本号-x86_64-linux-musl.tar.zst cd maddy-版本号-x86_64-linux-musl mv maddy /usr/local/bin mv systemd/* /etc/systemd/system

Edit maddy.conf and change the following two lines to your domain name.

 $(hostname) = mx1.example.org # 也可以写成mx.example.org,或者mail.example.org,看个人喜好$(primary_domain) = example.org # 填所需要的邮箱后缀

Create a directory /etc/maddy/ and move maddy.conf to this directory.

Reload the service manager and add the user maddy.

 systemctl daemon-reload useradd -mrU -s /sbin/nologin -d /var/lib/maddy -c "maddy mail server" maddy

security certificate

Generate a certificate for mx1.example.org and soft link it to the /etc/maddy/certs/mx1.example.org directory. Here you may need to simply configure a mx1.example.org website on the server. (The following command -w specifies the root directory of the website)

 certbot certonly --webroot -w /usr/share/nginx/html -d mx1.example.org

If all goes well, you can start trying to start Maddy.

 systemctl start maddy

DNS settings

Set up DNS records according to the official tutorial .

Next, go to your server provider and set Reverse DNS to mx1.example.org .

create user

Create users and allocate storage space.

 maddy creds create [email protected] maddy imap-acct create [email protected]

start using

You can then send and receive emails using an email client such as Thunderbird.

  • IMAP server: mx1.example.org:143
  • SMTP server: mx1.example.org:587
  • Connection Security: STARTTLS

In the future, you can use Mail Tester to test your mailbox level and optimize it according to the prompts. Please note that Mail Tester is limited to three free tests per day, try to resolve the mentioned issues at one time.

References

This article is transferred from: https://hsiaofeng.com/archives/227.html
This site is only for collection, and the copyright belongs to the original author.