The Linux Administration group is for the discussion of technical issues technical issues that arise during the administration of Linux systems, including maintaining the operating system and supporting end-user applications.

- Edit /etc/postfix/main.cf and change the following values. These are the basic values that need editing in order to get you going really fast. Don't edit other values unless you know what you're doing:

myhostname = mail.example.com This is only an example. Replace mail.example.com with your real Internet hostname or IP address. This will be the address that receives the mails.

mydomain = example.com Optional. Replace example.com with your real domain name. This will be the domain your mails appear to be sent from. It can also be used as the destination.

inet_interfaces = all
This parameter specifies the address used for receiving mail.

mydestination = $myhostname, $mydomain, localhost, localhost.localdomain
This parameter specifies the list of domains that this machine considers itself the final destination for. You can enter here all the hostnames pointing at your IP address but DON'T specify the names of domains that this machine is backup MX host for.

home_mailbox = Maildir/
This specifies the path where the mail is stored. Mailbox will store the mailto /var/spool/mail/user or /var/mail/user, while Maildir/ (the / is required) will store the mail in each user's home directory (/home/user/Maildir)

- Save the file and restart Postfix with:

# service postfix restart

- Test it: Run the following command and check /root/Maildir/new for a message. You can read it using less, cat or a text editor:

# echo "Hello" | mail root

Configuring Dovecot

- Edit /etc/dovecot.conf and change the following line:

protocols = imap pop3
Don't leave the '#' in front

- Test and start Dovecot:

# echo "Hello" | mail username
'username' is a NON-ROOT user so you might have to create one.

- Start Apache for webmail and Dovecot:

# service httpd start
# service dovecot start

- Test it: Open your favorite browser and go to http://your.hostname.com/webmail and log in with the NON-ROOT user and password. If everything worked out well, you should have a new mail in your inbox.

Enable SMTP Authentication

- Edit the /etc/postfix/main.cf file and add these lines at the bottom of the file:

Nowadays I only use Postfix as my MX and its been a long time for me since I
use Postfix as my email repository. But if your setting-up a mail server, I
recommend you try qmail. Here's a very nice comprehensive guide (ideally
for beginner in the Linux Admin world)