Route mail to specific hosts or mailserver
mailertable allows you to route or deliver mail to different hosts. You need to use feature called FEATURE(`mailertable’) and you will have to create an external database containing the routing information for various domains.
First include mailertable feature you need to edit your sendmail.mc file and add the following line:
# vi /etc/mail/sendmail.mc
FEATURE(`mailertable’) <- enable this line
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# service sendmail restart
Open /etc/mail/mailertable file and add domain name to route to different hosts. For example all mail coming from network 192.168.1 route to mail.myserver.com and all email for kvit.in will be automatically forwarded to a mail server mx.kvit.in
# vi /etc/mail/mailertable
Now build database version of the mailertable is built using:
# makemap hash /etc/mail/mailertable or
to update mailertable.db
Case : Suppose we need to relay mails for one domain only. if anyone send mails to any said domain to be captured to a said Email-Id.
hare at above case all mails to hsbc.co.in,citi.com,yahoo.com will relay properly, if anyone send mail to any .com domain will be captured to email id [email protected]
Split Domain in Sendmail Using luser_relay
What is split domain ?
Divide Email Users (same domain user, linuxgateway.in here as an example ) in more then one server. by default sendmail rejects or bounced mails for unknown local users. if we enable LUSER_RELAY feature, then sendmail search unknown local users into given server (mail.linuxgateway.in here) . Note that
mail1.linuxgateway.in <– our local Sendmail Server (220.127.116.11)
mail.linuxgateway.in <— remote Server (18.104.22.168)
Here some users exists on mail1.linuxgateway.in and others users exists on mail.linuxgateway.in, all users has email id having @linuxgateway.in.
search for text special local and modify as given below
CEO, KV IT-Solutions Pvt. Ltd. | [email protected] | 9810028374|
Linux Professional and an Industrial Trainer | 20 + years Experience in IT Industry
” We are born free, No Gate and Windows can snatch our freedom “