You are here

How to set the mail relay on a rhel6 box

rhel6 uses postfix by default (very nice). I've been used to changing the DS line in /etc/mail/ Now, what you do is:

postconf -e "relayhost = [myrelay.fqdn]"

It can't hurt to make sure you have the right setup. Here's what I have on one of my rhel6 systems

alternatives --display mta
mta - status is auto.
link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
slave mta-pam: /etc/pam.d/smtp.postfix
slave mta-mailq: /usr/bin/mailq.postfix
slave mta-newaliases: /usr/bin/newaliases.postfix
slave mta-rmail: /usr/bin/rmail.postfix
slave mta-sendmail: /usr/lib/sendmail.postfix
slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.postfix.

I'd stick with using the postfix command, but if you're scripting or some such, the setting is in the /etc/postfix/ file. All the command seemed to do is append the file, but I'm sticking with the command to be safe rather than sorry.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer