Stephen Gran on 19 Sep 2004 16:07:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] exim return address rewriting


On Sun, Sep 19, 2004 at 08:03:48AM -0400, Jeff Abrahamson said:
> On Sat, Sep 18, 2004 at 05:50:56PM -0400, Stephen Gran wrote:
> > You want the 'rewrite' part of exim's conf file - By default it looks at
> > /etc/email-addresses if found.  If you have root on the machine (which I
> > guess you do, if you're planning on doing it at the exim level) put an
> > entry of the form
> > 
> > jeff: jeffa@cs.drexel.edu
> 
> Good idea, but it doesn't do the trick.  Although the docs suggest it
> should.  I put in that line and type
> 
>     $ mail test | jeff@purple.com
> 
> and the mail received here still comes from jeff@host.cs.drexel.edu.
> 
> In exim.conf I see this line:
> 
> *@host.cs.drexel.edu    ${lookup{$1}lsearch{/etc/email-addresses}\
> 						{$value}fail} frFs
> 
> When I add this rule:
> 
> *@cs.drexel.edu    ${lookup{$1}lsearch{/etc/email-addresses}\
> 						{$value}fail} frFs
> 
> then it works.
> 
> Drat, that means I have to remember stuff when I upgrade to exim 4
> when sarge is released.
> 
> But it works, so thanks much!

It's a simple match, which means that by the time your email is submitted
to the exim rewrite engine, the program mail has already given you an
address of jeff@cs.drexel.edu, rather than jeff@host.cs.drexel.edu.
I have a couple of guesses about why that might be:

You might have environment variable $EMAIL set to jeff@cs.drexel.edu
instead of jeff@host.cs.drexel.edu then.  Either that, or /etc/mailname,
or /etc/hosts, or any of the other things controlling what hostname
is placed after jeff@ (although probably /etc/mailname of the bunch).
It may also be that qualify_domain is set in exim, and primary_hostname
is set to cs.drexel.edu instead of host.cs.drexel.edu.  You can see if
it's exim by trying '/usr/sbin/exim4 -brw jeff' and see if it gets
rewritten as expected (after reverting your changes to the rewrite rule,
of course).  If it does work, then something ahead fo exim is already
filling in the hostname for you, and getting it wrong.

I have never spent a lot of time working out where exim and other mail
related programs get their information from, but those are the things
I would explore if you want to shift the burden outside of a dpkg
managed file.
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | Failure is more frequently from want of |
|  steve@lobefin.net             | energy than want of capital.            |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

Attachment: pgpfthCXlYDsU.pgp
Description: PGP signature