Wednesday, September 7, 2011

How to send one mail to "relay server"(another mail server) using sendmail?

■ Requirement : sending mail to another relay server using sendmail.
■ OS Environment : Linux, RHEL, Centos
■ Implementation Steps : 

1. edit /etc/mail/ & add this line :


3. Rebuild the :

$ m4 /etc/mail/ > /etc/mail/

4.Restart sendmail:

$ /etc/rc.d/init.d/sendmail restart

5. Now send mail and check the maillog. Log will show relay name.

sendmail without DNS :

There are a number of steps required to successfully use sendmail when there is limited or no DNS.

1. I assume that domain is resolvable, either by /etc/hosts or DNS, or alternatively we can specify an IP address.
2. Set realy host in /etc/mail/ ie define(`SMART_HOST',`')dnl
3. Since the system implicitly have limited resolving capabilities, accept email for unknown domains so use line in /etc/mail/ of the form
4. We have to make it sure that the ServiceSwitchFile (by default at /etc/mail/service.switch) has content similar to:

aliases files
hosts files

5. Setting the submission agent to ignore DNS. Use line in /etc/mail/ of the form


6. Use line in /etc/mail/ of the form


7. Execute :

$m4 /etc/mail/ > /etc/mail/

6.service sendmail restart

No comments:

Post a Comment