[TriLUG] Forcing user at host@host routing in sendmail?

Brent Verner brent at rcfile.org
Thu Jan 17 10:29:02 EST 2002


[2002-01-17 09:46] Rodent of Unusual Size said:
| I frequently have to send mail to people in a domain
| inside a firewall which doesn't export the internal DNS.
| Sending mail to <user at host.foo.bar> from outside the firewall
| will always fail because host.foo.bar isn't in the global
| DNS.  However, if I explicitly route it through a system
| on the firewall 'fence', <user at host.foo.bar@fence.foo.bar>,
| which knows about both the internal and external DNS,
| all works well.
| 
| Is there any way to tell sendmail that all *@*.foo.bar
| addresses need to be rewritten to *@*foo.bar at fence.foo.bar?
| It *might* be hackable into the normal rulesets, but does
| anyone know if there's a special provision for this?  Or
| where better to ask?

Yes, on your gateway mailbox, you want to use the mailertable 
feature:


In your sendmail.mc say:
  FEATURE(mailertable, `hash -o /etc/mail/mailertable')

then create a file named /etc/mail/mailertable with the following
line.
  extra.other.host     smtp:my.other.host

Regenerate your .cf, and you're in business.

This will cause any mail received on the outside box to use
my.other.host as the relay for mail for user at extra.other.host
to be relayed through my.other.host, which needs only to be
configured to accept mail for the extra.other.host domain.

hth.
  brent

-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman



More information about the TriLUG mailing list