Mailscanner gateway using sendmail

Kit Wong Kit at
Wed Jan 16 16:03:22 GMT 2008

-----Original Message-----
From: mailscanner-bounces at
[mailto:mailscanner-bounces at] On Behalf Of Juan
Pablo Lorier
Sent: 16 January 2008 13:16
To: mailscanner at
Subject: RE: Mailscanner gateway using sendmail

Hi kit,

I just made a gateway and I think that what you should do is edit 
/etc/mail/mailertable and add the domains with their IPs so sendmail 
knows how to relay the mails.  smtp:[ip.addr.mail.srv1]  smtp:[ip.addr.mail.srv2]

I think this way, the mails to are sent to mailserver 1 and

those to are sent to mailserver 2.

Check it and tell me if this is correct.
MailScanner mailing list
mailscanner at

Before posting, read

Support MailScanner development - buy the book off the website!

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Yes that is correct.

Setting up 'mailertable'

To set up 'mailertable', you need to edit your sendmail .mc file and add
the following line:


After doing this, you need to using the script supplied with the
Sendmail source to rebuild your configuration file.

Now, open your new Sendmail configuration file and look for this (it
should be in the first couple hundred lines of the file):

Kmailertable hash /etc/mail/mailertable

This defines where the 'mailertable' file should be, and in this case it
is in /etc/mail.

Now let's go back to my previous example of being a secondary MX host
for If I wanted to do this with 'mailertable', I
could add the following line to my /etc/mail/mailertable:      smtp:[]

After editing this file, you must create a database map of this file for
Sendmail to read. Do this by running:

/usr/sbin/makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

Now all that's left to be a secondary MX host for is
to add the domain to your relay domains file. In my case, that file is
/etc/mail/relay-domains. Add the following line:

Then you must make sure that local-host-names do not have in it 

More information about the MailScanner mailing list