rewrite recipients after /etc/aliases is processed

2008-12-31 Thread Hanspeter Kunz
Hi all,

I'm trying to figure out how I can deliver mail

usern...@examplehost.example.com

to a central mail server (smtp.example.com) without setting

myorigin = $mydomain

on the example host, because I would like to see where the mail
originiated or was originally sent to in the sender address.

I tried to use recipient canonical maps

@examplehost.example.com @example.com

but then /etc/aliases is not used e.g. to forward email.

I there a way, to rewrite recipient adresses *after* /etc/aliases has
been processed?

many thanks,
Hp


signature.asc
Description: This is a digitally signed message part


Re: rewrite recipients after /etc/aliases is processed

2008-12-31 Thread Hanspeter Kunz
On Wed, 2008-12-31 at 14:28 +0100, mouss wrote:
> Hanspeter Kunz a écrit :
> > Hi all,
> > 
> > I'm trying to figure out how I can deliver mail
> > 
> > usern...@examplehost.example.com
> > 
> > to a central mail server (smtp.example.com) without setting
> > 
> > myorigin = $mydomain
> > 
> > on the example host, because I would like to see where the mail
> > originiated or was originally sent to in the sender address.
> > 
> > I tried to use recipient canonical maps
> > 
> > @examplehost.example.com @example.com
> 
> don't do that.
> 
> > 
> > but then /etc/aliases is not used e.g. to forward email.
> > 
> 
> why use /etc/aliases to forward mail? use transport_maps:
> 
> examplehost.example.com   relay:[192.168.1.2]

well, my intention was to use /etc/aliases for forwarding mail adresses
like root, webmaster, logcheck, etc. to real users. This would be
different users on every host. That's why I want first to
process /etc/aliases and then route the mail to our central mail server.

any idea how I could do such a thing?

or can I do a host-based mail-forwarding on the central server, i.e.
forwarding mail for root to different sets of users, depending on which
host sent the mail?

many thanks,
Hp.
-- 
Hanspeter Kunz  University of Zurich
Systems Administrator   Department of Information Technology
Email: hk...@ifi.uzh.ch Binzmühlestrasse 14
Tel: +41.(0)44.63-56714 Office 2.E.0
http://www.ifi.uzh.ch   CH-8050 Zurich, Switzerland

Spamtraps: hkunz.bo...@ailab.ch hkunz.bo...@ifi.uzh.ch
---
A boy spent years collecting postage stamps.  The girl next door bought
an album too, and started her own collection.  "Dad, she buys everything I've
bought, and it's taken all the fun out of it for me.  I'm quitting."  Don't,
son, remember, 'Imitation is the sincerest form of philately.'"


signature.asc
Description: This is a digitally signed message part


Re: rewrite recipients after /etc/aliases is processed

2008-12-31 Thread Hanspeter Kunz
On Wed, 2008-12-31 at 08:50 -0500, Wietse Venema wrote:
> Hanspeter Kunz:
> > well, my intention was to use /etc/aliases for forwarding mail adresses
> > like root, webmaster, logcheck, etc. to real users. This would be
> > different users on every host. That's why I want first to
> > process /etc/aliases and then route the mail to our central mail server.
> 
> /etc/aliases is used only for domains in $mydestination. This
> is documented behavior, and will not be changed.

sure.

> To rewrite address that don't deliver locally, use virtual_alias_maps
> (NOT virtual_alias_domains) to rewrite root etc, into real recipients.

thanks for your inputs (also to mouss).

For the record, I decided to do it the other way round:
* mail is delivered locally (so that /etc/aliases is processed)
* an additional ldap-aliases-table reroutes mails for "real" users to
the central mail server.

thanks again,
Hp.


signature.asc
Description: This is a digitally signed message part