March 3, 2009
How to: Configure postfix on CentOS 5
If you have not installed postfix, then install it as follows:
# yum install postfix
Configuration files are in /etc/postfix directory.
To configure postfix
# vi /etc/postfix/main.cf
- Uncomment and modify myhostname to your computer name
#myhostname = host.domain.tld
- Uncomment and modify the following to your domain name or to your IP address
#mydomain = domain.tld
- Uncomment the following:
#myorigin = $mydomain
- uncomment and comment the following directives:
#inet_interfaces = all inet_interfaces = localhost
- The changes will be as follows:
inet_interfaces = all #inet_interfaces = localhost
- Uncomment and modify mynetworks to points to your net work IP address:
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
# chkconfig postfix on
# service postfix start
If you have installed and configured both sendmail and postfix, do not start them at the same time. Only one should be started.For example,
service sendmail stop service postfix start
To switch between the two electronic mails, use one of the following commands:
# system-switch-mail # alternatives --config mta
To send mail to another user,use the mail command.
# mail root
- Type the message in the Subject field
- when you are done, press CTRL-D
- Enter another address in the Cc field
- Press Enter to send the message.
# mail root Subject: This is a test..... Cc: Null message body; hope that's ok
To read message 1
# mail & 1
d command deletes the message
q command quit from the mail program
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

