Masquerade the from field using sendmail

Matthew Seaman m.seaman at plasm.demon.co.uk
Wed May 22 07:55:23 BST 2002


On Tue, May 21, 2002 at 10:02:09PM +0100, Jose Marques wrote:
> 
> On this topic does anybody know how to make sendmail use a particular
> hostname when it issues the "HELO" command.  I'm running sendmail on a
> NAT-ed network.  The hostname is libretto.local (ie. it's bogus and only
> know to my private DNS server).  I'm delivering directly and am finding
> that some mail relays (most notably the ones for freebsd.org) are
> rejecting my mails because "libretto.local" doesn't resolve.  I'm using
> masquerading so my envelope matches my public hostname but this does not
> appear to be enough.
> 

Either by redefining the $j macro (official host name of server):

define(`confDOMAIN_NAME', `$w.example.com')dnl

(Example shows how to force appending a domain name to the local short
host name ($w) --- as returned by gethostname() with everything after
the first dot stripped off.

Nb. $j is used by sendmail to detect when it is trying to send e-mail
to itself and prevent looping.  It has to be a fully qualified name
resolvable in the DNS.  Make sure all variants of your server name are
listed in /etc/mail/local-host-names.)

Or by changing the SMTP greeting message:

define(`confSMTP_LOGIN_MSG', `$j Sendmail $v ready at $b')dnl

(The official name of server (usually $j) must appear first on
greeting line, followed by a space.  Text after that is pretty much
free form, but the standard message contains the sendmail version ($v)
and the current date/time in RFC822 format ($b))

See /usr/src/contrib/sendmail/cf/README for a good summary for the m4
configuration options.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
Tel: +44 1628 476614                                  Marlow
Fax: +44 0870 0522645                                 Bucks., SL7 1TH UK




More information about the Ukfreebsd mailing list