sendmail masquerading question

Ben Scott dragonhawk at gmail.com
Sun Sep 9 16:50:03 EDT 2007


On 9/9/07, Steven W. Orr <steveo at syslang.net> wrote:
> When sending mail from pluto, I want the addresses that the message is
> sent to, to be changed so that *any* address that is bound for syslang.net
> does not get sent to pluto.syslang.net.

  I'm not sure I follow what you mean on the above.  Does Sendmail on
pluto believe its canonical name is "pluto.syslang.net"?  If so, mail
sent from pluto would normally be delivered to whatever is behind TCP
port 25 on 207.172.210.41.  That's what the MX and A records for
<syslang.net> say to do.  I assume that is the machine "saturn".

  If pluto believes it's canonical name is <syslang.net>, well, it's
going to attempt to handle mail for itself.  So don't do that, then.
Change pluto's canonical to be what it should be (which is *not*
<syslang.net>, per your description).

  If your problems arise because you want the "From" address of mail
sent from pluto to be set to something the outside world can
understand (I presume you're running a private NAT LAN like most
everybody is these days), you've got a couple options.

  You could actually set a public MX record for <pluto.syslang.net>
and tell saturn to handle mail for pluto as well.  This would be
desirable if you want accounts on pluto to have an identity discrete
from <syslang.net> to the outside world.

  Otherwise, use a Sendmail generics table to rewrite "From" addresses
to use <@sysland.net> (or whatever).  For example, my user account on
the box I'm typing this on is "bscott".  The box's canonical name (for
Sendmail) is <blackfire.bscott.local>.  But my email account is
<dragonhawk at gmail.com>.  So I need to have my "From" address rewritten
so the outside world understands it.

  To do that, I have the following lines in my /etc/mail/sendmail.mc file:

	FEATURE(genericstable, `hash -o /etc/mail/genericstable')
	GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomains')

and the following in my /etc/mail/genericsdomains file:

	blackfire
	blackfire.bscott.local
	dragonhawk.dnsalias.org

and the following in my /etc/mail/genericstable file:

	bscott  dragonhawk at gmail.com

  If I'm totally misunderstanding your question, maybe the above will
help you clarify what you're after.  :)

> All addresses on saturn are valid on pluto, but I don't want any mail sent from pluto
> to not be sent through saturn.

  You may also want to explore the MAIL_HUB and LOCAL_RELAY options in
addition to SMART_HOST.  They permutate in ways which can be tricky.
See:

http://www.ilkda.com/sendmail/Relay.htm

http://www.sendmail.org/m4/masquerading_relaying.html

-- Ben


More information about the gnhlug-discuss mailing list