1. Configure sendmail as stated at http://kmaiti.blogspot.com/2011/09/how-to-install-and-configure-sendmail.html
2. edit /etc/mail/sendmail.mc
Add this line to sendmail.mc:
define(`SMART_HOST',`[smarthost.example.net]')dnl
3. Rebuild the sendmail.cf :
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
4.Restart sendmail:
/etc/rc.d/init.d/sendmail restart
5. Now send mail and check the maillog. Log will show relay name.
If above is configured on 192.168.1.2. If relay server is 192.168.1.3 and if SMTP server which will actually receive mail is : 192.168.1.4 then mail will go from 192.168.1.2 to 192.168.1.3. Now 192.168.1.3 will send mail to 192.168.1.4 as per MX record. So, we need disable DNS in 192.168.1.2. Say it's a client machine. Here is the steps to disable DNS in 192.168.1.2
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/sendmail.mc ie define(`SMART_HOST',`name.of.smart.host')dnl
3. Since the system implicitly have limited resolving capabilities, accept email for unknown domains so use line in /etc/mail/sendmail.mc of the form
FEATURE(accept_unresolvable_domains)dnl
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/submit.mc of the form
define(`confDIRECT_SUBMISSION_MODIFIERS',`C')
6. Use line in /etc/mail/submit.mc of the form
FEATURE(accept_unresolvable_domains)dnl
7. Execute : #m4 /etc/mail/submit.mc > /etc/mail/submit.cf
6. # service sendmail restart
That's it.
Wednesday, 7 September 2011
How to send one mail to "relay server"(another mail server) using sendmail?
Posted on 10:23 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment