Using Sendmail to Relay Mails from Your MSP/ISP in Centos, RHEL, Ubuntu and Other Linux Distros

by Ashwin on July 10, 2010

Do you want to relay mails from your local sendmail server to your ISP. Just follow the below steps

Open sendmail.mc using default editor vi, edit, emacs
# vi /etc/mail/sendmail.mc

define(`SMART_HOST',`[smtp.yourisphost.com]')
FEATUREdnl

Save the File and exit
Open the File authinfo (If not Present Create a New File).

vi /etc/mail/authinfo
Add the following Line
"AuthInfo:smtp.yourisphost.com "U:UsernamefromISP" "P:passwordfromISP" "M:LOGIN PLAIN"

Save the File and Exit

Just run the below commands to recreate the sendmail.cf file

# cd /etc/mail/
# m4 sendmail.mc > sendmail.cf

Make Map will recreate the database for authinfo to be used in sendmail

# makemap hash /etc/mail/authinfo < /etc/mail/authinfo

Restart the Sendmail Service and check if All's Good !!!

# /etc/init.d/sendmail restart
echo '/map authinfo AuthInfo:smtp.yourisphost.com' | /usr/sbin/sendmail -bt

Sent Mail Check in Logs

Enjoy.....

Comment if issues or modification required.

If you happen to use Windows, check out the disk cleaner to keep system safe and secure.

      
Plugin by: PHP Freelancer

Related posts:

  1. Simple Steps to Send Mail Using Sendmail in Linux, Fedora, Centos, Ubuntu Have you got your Linux distribution like Fedora, Centos, Redhat,...
  2. Blocking Specific Sender to Specific Recipient or IPs Spamming Using Sendmail in Linux Maintaining a MailServer is really a all time headache for...
  3. Understanding and Reading Mail Logs, Postfix Logs, Sendmail Logs, Qmail Logs How do I read Mail Log? Logs play a crucial...

Leave a Comment

Spam Protection by WP-SpamFree

Previous post:

Next post: