On Thu, 22 Aug 2002, Peter Duffy wrote:
> I'm fairly new to exim, and currently wrestling with an issue which, at
> first, I fully assumed would be one of the oldest of chestnuts.
It's always interesting to learn what people thing are "obvious"
facilities for MTAs. This is the first time I have ever heard anybody
ask for what you want.
> Assume that I've got a mail server mydomain.co.uk, and an entry in
> /etc/aliases:
>
> dodgy_suppliers: fred.bloggs@???, joe.doe@???
>
> If I send a message to "dodgy_suppliers", it is sent successfully at the
> expanded addresses, but arrives addressed to
> "dodgy_suppliers@???", not the expanded address to which it
> has been sent.
Well, strictly, no. Each copy that arrives is addressed, *on the
envelope*, to the recipient address. Otherwise it wouldn't get there.
However, redirection (aliasing) does not change the contents of the To:
header inside the message.
> For blatantly obvious reasons, I don't want the users collected under
> this alias to become aware that I have thus categorized them!! What I
> want is for the "To:" header line to contain just the current address
> from the alias expansion.
The way I would expect most people to do this would not be to use
system-wide aliases. After all, some other user of the system might have
an entirely different list of dodgy_suppliers. I would expect that most
people would use the features of their addressbooks to maintain lists
like this. The MUAs that I've used would indeed replace the To: header
line with the actual list, and you'd see that happen as you composed the
message.
Now, there is still a problem. An addressbook entry with multiple
addresses might well put all of them into the To: header. You might not
want that; you might want to send a separate message to each. I don't
know much about very many MUAs, but perhaps there is one that can be
configured to do that.
> This seems to be an absurdly commonplace and
> trivial requirement, but as yet I've not been able to find an explicit
> way of achieving it. I eventually tried a rule to rewrite the "to"
> header line, but at the point the rewrite happens, $local_part and
> $domain still contain respectively "dodgy_suppliers" and
> "mydomain.co.uk": there don't seem to be equivalent variables containing
> the parts of the expanded address.
That is the case for global rewrites. They happen when the message is
received, before any aliasing etc.
Actually, I think Exim can sort of do what you want. Investigate the use
of header rewriting on transports. Check for the headers_rewrite option.
You could rewrite the address in the To: header to be the address in the
envelope. However, in order to do this, you would need to set max_rcpt=1
on the smtp transport, so that it sends a separate copy for each
recipient. This might have performance implications.
So you see, it is all quite complicated.
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.