How to get sendmail to rewrite envelope recipient

Chris Hewitt g0pae at manordat.demon.co.uk
Thu Mar 18 15:21:56 UTC 2004


Nigel Wade wrote:

> Hi,
>
> I am trying to get a trivial sendmail config. set up, but sendmail m4 
> just won't play ball.
>
> This setup is for a simple client which should send all mail to our 
> mail hub, qualify all names with our domain and rewrite hosts with the 
> domain. E.g. a userid should be re-written as userid at domain, 
> userid at host.domain should be re-written as userid at domain.
>
> I've very nearly got it working, but I cannot get sendmail to use the 
> correct envelope recipient when it's unqualified. It insists on using 
> the FQDN of the mail hub even though I've specified the 
> masquerade_envelope FEATURE (this doesn't appear to do anything).
>
> Can anyone enlighten me as to what the magic incantation of sendmail 
> mc define/features is to get it to do this?
>
> I've tried MAIL_HUB and LOCAL_RELAY, which both seem to do the same. 
> SMARTHOST won't relay unqualified addresses. The various masquerade 
> options just don't seem to have any effect on what sendmail uses in 
> its RCPT to:
>
> This is the current sendmail.mc:
>
> divert(-1)dnl
> include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
> VERSIONID(`setup for Red Hat Linux')dnl
> OSTYPE(`linux')dnl
> define(`LOCAL_RELAY',`mail.ion.le.ac.uk')
> MASQUERADE_AS(`ion.le.ac.uk')dnl
> EXPOSED_USER(`root')dnl
> DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
> FEATURE(allmasquerade)dnl
> MAILER(smtp)dnl
>
Nigel,

With the DAEMON_OPTIONS line you have it will only accept mail from that 
computer. You will need to comment that out. If all your mail "up" the 
network and receiving "from" the network is via your mail hub then I 
think that smart_host is what you want (its what I use). You will also 
need to tell it the computers/domains that you relay for (or it will not 
accept mail from them). My sendmail is fairly old now (prior to the 
split with submit.mc) so things have changed a bit.

Unfortunately, I don't have time now to look further now, but I'll 
happily send you my mc file privately if it will help. It deals with all 
email on my local lan and sends it to my isp, masquerading it.

HTH
Chris






More information about the Redhat-install-list mailing list