Email relay in Linux

Being able to send out emails is ciritcal if you are monitoring things or need other services. There are a few parts to get this done and we will use CentOS 6.4 for our example.

  1. Mail server (MTA)
  2. Relay server

INSTALL AN MTA AND ACTIVATE IT lexapro 5mg.

yum install postfix
chkconfig postfix on
service postfix start

ESTABLISH AN AN ACCOUNT TO RELAY EMAIL THROUGH

You can use an email relay service like JangoSMTP or just relay email through your mail server such as Gmail.

EDIT THE MTA TO RELAY EMAIL THROUGH A THIRD PARTY. WE WILL CONFIGURE THE MTA TO ACT AS AN EMAIL CLIENT. ADD THE FOLLOWING AT THE END OF /ETC/POSFIX/MAIN.CF

relayhost = relay.jangosmtp.net:587
#Set the sasl options
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = 

ADD YOUR LOGIN CREDENTIALS IN /ETC/POSTFIX/SASL_PASSWD

relay.jangosmtp.net     username:password

GENERATE THE HASED DATABASE THAT POSTFIX USES

postmap hash:/etc/postfix/sasl_passwd

Ensure that the postfix configuration files have the correct permissions:

chown postfix /etc/postfix

RELOAD POSTFIX

service postfix restart

YOU CAN NOW TEST SENDING AN EMAIL TO YOURSELF:

mail youremailaddress.com
Subject: Whatever
This is the body, hit control+D to end.

VARIOUS COMMANDS

http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html

References:

http://blog.earth-works.com/2013/05/14/postfix-relay-using-gmail-on-centos/
http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html

Posted in Knowledge and tagged , , .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.