Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

At this point programs programs on your system will be able to start sending emails.

 

Setup Mail Delivery Account

Warning

Is this really necessary?

Code Block
sudo addgroup --gid 3001 mailadmin
sudo useradd -d /home/mailadmin -m -g mailadmin -u 3001 -c "Mail Admin catch-all" -s /bin/false mailadmin

Basics of Postfix

Default installations of Postfix stores all messages in an mbox file. To see what directory it is using use the command,

Code Block
languagebash
sudo postconf mail_spool_directory
mail_spool_directory = /var/mail # This is the default directory.

The newer maildir format is now recommened so follow the next section to change to maildir.

Setup Mail Delivery Account

The overall consensus is to use the maildir format with a mail directory being used for each user.

main.cf

Backup /etc/postfix/main.cf in case something goes wrong. All the subsequent commands modify main.cf,

Code Block
sudo cp /etc/postfix/main.

...

cf /etc/postfix/main.cf.v0.0.bck

The following command will do make the following changes,

  • Set emails to the users home directory under a subfolder called Maildir.
  • The trailing slash indicating a folder, will configure Postfix to use the maildir format. Note, if you forge the slash, a file called maildir will be generated in mbox format.
Code Block
languagebash
sudo postconf -e 'home_mailbox = Maildir'
Note

This sets mail in /home/username/Maildir and the MDA (Mail Delivery Agent) must be set to the same path.

If we want multiple domains, for example, earth.com, just add it to the list by editing /etc/postfix/main.cf and adding earth.com to the mydestination line.

Warning

Look up how to do via postconf -e here for consistency.

More commands,

/'

In most cases, your system is being used to send email outbound and not receive email or deliver the emails locally to the system.

Code Block
languagebash
sudo postconf -e "inet_interfaces = loopback-only" # receive no mail from the network, and do not deliver any mail locally

 

Reverse DNS

Reverse DNS unless delegated is managed by the ISP provider. Generally this means whoever manages the IP address of your server.

...