• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to configure postifx smtp relay in CentOS/RHEL 5 and 6

by admin

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

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. ping not working on a Newly Built CentOS/RHEL server
  2. more Command Examples in Linux
  3. Understanding rsyslog Filter Options
  4. How to Install SSHFS on CentOS/RHEL/Ubuntu
  5. CentOS / RHEL 6 : How to Save iptables Rules
  6. RHEL / CentOS : How to rebuild LVM from Archive (metadata backups)
  7. CentOS / RHEL : iptables troubleshooting guide
  8. chown Command Examples in Linux
  9. Swapon Fails To Mount Swap – Gives Invalid Argument Error
  10. How to use mdadm to create a software mirror on top of multipath devices

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright