The post is to illustrate the steps to configure the smtp relay using postfix on CentOS/RHEL 5 and 6.
For relaying mail through another smtp server, /etc/postfix/main.cf file has to be configured with “relayhost” parameter which specifies the destination smtp server.
1. Install the postfix rpm if not installed already.
# rpm -qa|grep postfix
2. Take a backup of the default configuration:
# cp /etc/postfix/main.cf /etc/postfix/main.cf.bkp_default
3. Edit the /etc/postfix/main.cf and append/modify the following parameter on the configuration.
myhostname = [hostname-of-server] relayhost = [IP Address/Hostname of relay server]
4. Restart postfix service to make the changes effect.
# service postfix restart
5. Verify the mail relay using telnet/mail(mailx) commands.
Linux / UNIX : How to send mails with attachments using mailx command
UNIX / Linux : How to install and configure mutt
UNIX / Linux : Send mail with attachment using mutt
UNIX / Linux : How to install and configure mutt
UNIX / Linux : Send mail with attachment using mutt