How to get sendmail to rewrite envelope recipient

Nigel Wade nmw at ion.le.ac.uk
Thu Mar 18 15:55:26 UTC 2004


Chris Hewitt wrote:
> 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
> 

Thanks Chris,

This system isn't doing any relaying. It's a simple client which I want to 
send all mail to the mailhub, so it shouldn't listen on anything other than 
the loopback interface.

I tried SMARTHOST, but that wouldn't deliver unqualified mail to the 
SMARTHOST, it delivered it locally, which isn't what I want.

I have a sendmail.cf script myself which I've been using for years for this 
purpose. It was hand written before the days of m4 macros. I'm trying to 
bring it into the 21st century, but sendmail/m4 isn't helping.

It's these pointlessly frustrating things about sendmail which have made me 
switch from sendmail to exim on the mail hub. Exim does what the 
documentation says it will, and the configuration directives do what you 
expect them to.

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw at ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555





More information about the Redhat-install-list mailing list