Forcing sendmail to use /etc/hosts before using DNS

Jim Scott jscott at INFOCONEX.COM
Tue Jan 14 17:14:05 GMT 2003


on the mailscanner servers put an entry like this in your /etc/mail/mailertable
someserver.usu.edu          RELAY:whateverserver.usu.edu
Now any email that these two servers receive destined for @someserver.usu.edu will be
directed to the server whateverserver.usu.edu

make sure you take the entry out of the /etc/mail/local-host-names file and remove
the entry for someserver.usu.edu domain
Make sure you have something in the /etc/mail/local-host-names file on
whateverserver.usu.edu to tell it that it accepts email for the domain
someserver.usu.edu

of course you probably also need to add your MX records to point to your mailscanner
servers for this domain as well.

Atleast this is what I think you are trying to do ;-)

Email me privately if you need more help.

Jim


----- Original Message -----
From: "Ewald Beekman" <E.H.Beekman at AMC.UVA.NL>
To: <MAILSCANNER at JISCMAIL.AC.UK>
Sent: Tuesday, January 14, 2003 8:49 AM
Subject: Re: Forcing sendmail to use /etc/hosts before using DNS


Probably you can use the mailertable feature to accomplish this,
make sure the feature is enabled in sendmail.mc :
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl

and create /etc/mail/mailertable with something like:
someserver.usu.edu      esmtp:[172.17.1.33]

do a makemap
makemap -v hash mailertable < mailertable

and a kill -HUP of your sendmail process:
kill -HUP `head -1 /var/run/sendmail.pid`

you can always check where sendmail is going to send stuff with the
-bv option:
/usr/lib/sendmail -bv myuser at someserver.usu.edu

http://www.sendmail.org/~ca/email/doc8.12/cf/m4/features.html

have fun!
Ewald...

On Mon, Jan 13, 2003 at 01:50:15PM -0700, John B. Hanks wrote:
> I am trying to get sendmail/mailscanner to do something that has me
> questioning my understanding of the way this has been working. Here is what
> I currently do to scan mail for a mail server.
>
> My MailScanner machines are noturus.usu.edu and ameiurus.usu.edu.
>
> If I want to scan mail for mail.dept.usu.edu, I go to that DNS record and
> add
>
> mail.dept.usu.edu  in mx  10 noturus.usu.edu
> mail.dept.usu.edu  in mx  10 ameiurus.usu.edu
>
> This has been working flawlessly for some time. I think what happens is mail
> gets delivered to the MailScanner machines, they recognize themselves as MX
> hosts and then forward the scanned mail to the A record for the target.
>
> Now I need to do some magic for a server move. I have a host,
> someserver.usu.edu, that wants mail scanned and delivered to another box
> which will host mail but someserver.usu.edu still has other functions so it
> need to keep this name in its a record. I thought I could accomplish this by
> adding entries to /etc/hosts on the mailscanners like
>
> 172.17.1.33      someserver.usu.edu
>
> So that when noturus or ameiurus looked up someserver.usu.edu they would use
> the entry from the hosts file and unwittingly deliver mail to the new
> server. But, sendmail seems intent on ignoring the /etc/hosts file. I have
> changed /etc/resolv.conf, /etc/nsswitch.conf, /etc/host.conf and
> /etc/mail/services.switch so that all these point to files first, then dns
> but it still isn't working. The ping command works as expected, checking
> /etc/hosts and using the IP address from the file. Can someone tell me if
> what I want to do is possible and if so, how do I get sendmail to behave
> this way? As we move more mailservers to use MailScanner this is going to
> come up again and I need a way to solve it.
>
> This is Redhat 7.3, MailScanner 4.11-1 and sendmail 8.11.6-15.
>
> Thanks,
>
> jbh

--
Ewald Beekman, Security Engineer, Academic Medical Center,
dept. ADB/ICT Computer & Network Services, The Netherlands
## Your mind-mint is:
God help the troubadour who tries to be a star.  The more that you try
to find success, the more that you will fail.
                -- Phil Ochs, on the Second System Effect



More information about the MailScanner mailing list