[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Virtual Domain (was Re: Continued procmail tribulations..)



> >> ps: thanks to Arnt for his suggestions on making virtual domains work
> (by
> >> adding lines in rrouter.cf)
> >
> >What I would like to see is a way to have seperate domains with seperate 
> >alias files and seperate local tansport agents. The problem I have is 
> >that I have a number of domains that have overlaping naming requirements.
> >For example info@xxx.org needs to go to a different place than
> info@yyy.org.
> >I am not quite sure if this can be reasonably done with zmailer.
> >
> 
I would just like to confirm that this can be done as I have done it.  

I have a per-domain alias file (only a simple map from username to address)
which are read into maps at startup.  I have added extra lines to
rrouter.cf for these domains to use the map.  For some domains, I produce
custom error messages if the name is not in the map while for others I
deliver to a default address.  For example, I have something like this in
rrouter.cf:

        # handle xxx.org
        (.*)<@xxx.org>
# echo "XXX \1 $A" >> /var/log/mail/router
# when $A=g1  we do not want the address rewritten
        if [ $A != g1 ] ; then
                if [ $(xxxmap "\1") ]; then
                        return $(rrouter $(xxxmap "\1") "$address" $A)
                else
                        return (((error noxxxname "\1@xxx.org" $A)))
                fi
        fi ;;


My approach is a 'bit of a hack' (to deliver to multiple addresses I
redirect via the main alias file)  but it does work.  The check that $A !=
g1 I had to add to stop From: headers being rewritten (as I remember it).
This can almost certainly be done better as this was a one day `get it going
hack' which has now run for eighteen months.  In fact, the ability
to add this code was one of the main reasons I chose zmailer back then.

Regards,
Simon.

PS The one thing I have never worked out how to do is to hold delivery
until some point and then make it start according to some event.  What I
have in mind is collecting mail for a dial-in PPP client, holding it until the
client dials in and then delvering it.  Anyone want to tell me how to do
this?