• 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. How to Remove/ Disable Bash shell Command History on Linux
  2. CentOS/RHEL: How to find the package with a missing file using YUM
  3. CentOS/RHEL7 – Tuned Profiles Oracle
  4. mtr Command Examples in Linux
  5. ipcalc: command not found
  6. Understanding linux fdisk utility
  7. btrfs filesystem Command Examples in Linux
  8. How to mount USB flash drive in Linux
  9. runlevel Command Examples in Linux
  10. kill Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright