Friday, September 25, 2009

SENDMAIL Notes 10: Sendmail SMARTHOST & Null Client


Sendmail Smart Host
      Smarthost is a smtp server that forwards the non local mails to another server that has proper DNS resolution.

DEFINING THE SMARTHOST:

    Define this derivative in the Host mail configuration where we have to forward the mail to another server.

define(`SMART_HOST', `192.168.1.30')
or
define(`SMART_HOST', `isp.mailserver.com')

      The Smart host entry can be either IP address or with Hostname

#recompile the sendmail.cf and restart the sendmail service in hosts

Now go to main mailserver (isp.mailserver.com):
Permit the host in Relay

#vi /etc/mail/access
add the ip address of the smarthost
#makemap hash acess < access

Now if we send mail from the Host to internet the message will be Relayed through isp.mailserver.com to internet.Verify the logs on each servers. All the details of the mail relays will be found in the msg headers(through which hosts the mail has be relayed).

NULL CLIENT CONFIGURATION:

      In contrast with SMARTHOST, NULL CLIENT CONFIGURATION will redirect all mails including local msgs, not just the remote mails to the defined server.This is used where in the situation that need to make the server to just send the msgs and not to receive any msgs.

Define the Following in the HOST that needed to be configured as NULL CLIENT.
first comment the SMART_HOST definition. Add the following in sendmail.mc

FEATURE(`nullclient', `isp.mailserver.com')
#recompile the sendmail.cf and restart the mail service

      This will make the host to forward all the mails to the server isp.mailserver.com. Test this by running sendmail in debugging mode

#sendmail -d -i

Note:- In server (isp.mailserver.com) has to define the access to relay this host.
       Now try sending msgs from host, this will make all the mail to relay through isp.mailserver.com.
Note:
      As we are defining the Null client, since it is not setup to receive mail we have to make sure that the mail envelop will be re-written.Because in case of any reply or bouncing the host will not be accepting the mail.

No comments:

Post a Comment

tag ur valuable ideas below