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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. git changelog: Generate a changelog report from repository commits and tags
  2. How to add header and trailer line to a file in Linux
  3. nmcli connection Command Examples in Linux
  4. How to uninstall aria2 from Ubuntu
  5. snap Command Examples in Linux
  6. mpstat: command not found
  7. How to Delete unnecessary Entry in /etc/shadow
  8. rfkill: command not found
  9. “az storage table” Command Examples
  10. dnsrecon: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • gixy Command Examples
  • gitsome Command Examples
  • gitmoji Command Examples
  • gitlint Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright