Sendmail Server + mailertable + luser-relay : Part 8

Sendmail Server + mailertable + luser-relay : Part 8

by -
0 2228
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 file and add the following line:
# vi /etc/mail/
FEATURE(`mailertable’)   <- enable this line 
# m4 /etc/mail/ > /etc/mail/
# 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  and all email for  will be automatically forwarded to a mail server 

# vi /etc/mail/mailertable


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 relay relay
.com local:[email protected] local:[email protected]
.in local:[email protected] local:[email protected]
.net local:[email protected]

hare at above case  all mails to,,  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, 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 ( here) . Note that  <– our local Sendmail Server (  <— remote Server  (
Here some users exists on  and others users exists on, all users has email id having


#vi /etc/mail/

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 “


0 1672

0 1328

0 1188


Leave a Reply