Sendmail Server + mailertable + luser-relay : Part 8

Sendmail Server + mailertable + luser-relay : Part 8

by -
0 2134
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:
FEATURE(`mailertable’):
# 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

192.168.1  smtp:mail.myserver.com
kvit.in  smtp:mx.kvit.in 

Now build database version of the mailertable is built using:

# makemap hash /etc/mail/mailertable      or
# make

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.

#vi  mailertable

hsbc.co.in relay
citi.com relay
.com local:[email protected]
..com local:[email protected]
.in local:[email protected]
..in local:[email protected]
.net local:[email protected]

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 (122.176.113.126)
mail.linuxgateway.in  <— remote Server  (74.86.3.242)
Here some users exists on mail1.linuxgateway.in  and others users exists on mail.linuxgateway.in, all users has email id having @linuxgateway.in.

 

#vi /etc/mail/sendmail.mc

define(`LUSER_RELAY’,`mail.linuxgateway.in’)dnl
FEATURE(`preserve_luser_host’)dnl
vim /usr/share/sendmail-cf/m4/proto.m4

search for text    special local   and modify  as given below 

$#_LOCAL_ [email protected] $2 $: @ $1
$#_LOCAL_ [email protected] $2 $: $1

 

 

Download PDF

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 “

SIMILAR ARTICLES

0 1592

0 1238

0 1131

NO COMMENTS

Leave a Reply