20140501 switching to postfix on rhel - plembo/onemoretech GitHub Wiki

title: Switching to postfix on RHEL link: https://onemoretech.wordpress.com/2014/05/01/switching-to-postfix-on-rhel/ author: phil2nc description: post_id: 7486 created: 2014/05/01 10:51:25 created_gmt: 2014/05/01 14:51:25 comment_status: closed post_name: switching-to-postfix-on-rhel status: publish post_type: post

Switching to postfix on RHEL

The RHEL 6 documentation contains most of the info you'll need for this, superceeding whatever may have come before. This includes using the alternatives subsystem to alias sendmail executable names to their postfix equivalents. Check out the links below. Main Transport Agents in the RHEL Deployment Guide. If you already have sendmail installed (it is the default MTA in RHEL 6 and previous versions), you need to first shut it down and then disable it:

service sendmail stop
chkconfig sendmail off

Then, once you've installed the requisite packages, start up postfix and enable it:

service postfix start
chkconfig postfix on

Next, configure postfix for the role it will play. By default it only allows the relaying of mail from the local host. To relay mail from other hosts or the Internet you will need to modify the configuration. See Basic Postfix Configuration for specifics. Here's the gist from that doc: Edit the /etc/postfix/main.cf file with a text editor, such as vi. > Uncomment the mydomain line by removing the hash sign (#), and replace domain.tld with the domain the mail server is servicing, such as example.com. > Uncomment the myorigin = $mydomain line. > Uncomment the myhostname line, and replace host.domain.tld with the hostname for the machine. > Uncomment the mydestination = $myhostname, localhost.$mydomain line. > Uncomment the mynetworks line, and replace 168.100.189.0/28 with a valid network setting for hosts that can connect to the server. > Uncomment the inet_interfaces = all line. > Comment the inet_interfaces = localhost line. > Restart the postfix service. Note that /etc/mail/aliases is shared by sendmail and postfix, so you'll be able to continue using it even after the switch. Finally, invoke the alternatives subsystem to alias common sendmail executable names to their postfix equivalents (so that the configuration of other apps, like php, won't have to be modified to change their command syntax and path information).

alternatives --config mta

Follow the prompts and select postfix as your MTA. The official Postfix documentation page points to a wealth of well-written articles that really should be consulted by anyone charged with administering systems running postfix.

Copyright 2004-2019 Phil Lembo