Postfix must be configured on the command line:
Open a terminal and do the following:
Install the postfix package. At the prompt, then switch to the root user: su -l root
Install the package: rpm -Uvh /path/to/files/postfix-*.rpm
Set Postfix to be the main MTA. Red Hat allows Postfix and Sendmail to be installed simultaneously, but only one of these alternative MTAs can be aactive at the same time. Switch from Sendmail to Postfix wit the following command: alternatives --set mta postfix
By default, Postfix is configured to send email out, but not listen on the network to recieve email. Change that by opening /etc/postfix/main.cf in an editor (for example, nano: nano /etc/postfix/main.cf Modify the inet_interfaces line, replacing localhost with all. This will make Postfix listen on all your network interfaces.
Like most mail servers, Postfix supports aliases - emailable accounts which actually get delivered to another user (either on the local system, or on the internet). It's good manners for people running a mail server provide certain aliases - like abuse@, hostmaster@, etc. - which people having problems with the domain or mail server (such as a virus problem or security issue) can contact the admins. Postfix takes care of setting up all these aliases, so that email sent to these addresses goes into roots mailbox. You should, however, alias root email to in turn go to your log in accounts mailbox, to make sure you read it.
Open /etc/postfix/aliases, and change the alias from the root account to your own personal email address:
root: username@example.com
Run
newaliases
to make this change take effect
Start the postfix service and set it to start by default by typing:
service postfix start chkconfig postfix on
Confirm your mail server is working by attempting to send some email to a user on your system. The mail should come in to that users (server side) mailbox file, /var/spool/mail/username. Since we haven't set up a Mail Delivery Agent yet, we'll just use the tail command to watch the mail arrive at the bottom on the mailbox.
mail -s "test message" username tail -f /var/spool/mail/username
If the mail appeared, the Mail Transport Agent is set up correctly.
To allow users to check their mail, we'll need a Mail Delivery Agent, which will serve the contents of the mailbox to users with the POP3 or IMAP protocols. Install the package: rpm -Uvh /path/to/files/dovecot-*.rpm
Send another email, and check
![]() | Warning |
|---|---|
Using non-secure POP3 or IMAP is dangerous. POP3 and IMAP send usernames and passwords in plain text. This means that people 'sniffing' the network could steal this information and use these credentials elsewhere. Use secure IMAP or secure POP3 if you can. | |
If you have problems, try: postconf -v