Re: [Exim] rewriting, redirecting, and the sendmail "+ hack"

Góra strony
Delete this message
Reply to this message
Autor: Kirill Miazine
Data:  
Dla: Noah Meyerhans
CC: exim-users
Temat: Re: [Exim] rewriting, redirecting, and the sendmail "+ hack"
Noah Meyerhans wrote:
> > Your map decides that mail to user@??? should go to
> > luser@???. With the local part suffix, that would result
> > in the following final addresses:
> >
> >     * With ${quote:

> >
> >         "lusr+foo bar"@???

> >
> >     * Without ${quote:

> >
> >         luser+foo bar@???

> >
> > No further comments are needed, I hope.
>
> None needed, except that neither exim nor sendmail would let an
> recipient of the form user+foo bar@??? go through as is.
> sendmail will substitute a '.' for the space, and treat the address as
> though user+foo.bar@??? was given. Exim will not let it in at
> all:


Unless properly quoted. Following address is an invalid address:

> rcpt to:<noahm+foo nlm@???>


It should be quoted:

    rcpt to:<"noahm+foo nlm"@???>


Here I connect to incoming.csail.mit.edu:

    $ nc incoming.csail.mit.edu 25
    220 incoming ESMTP Exim 4.20 Sun, 13 Jul 2003 15:34:18 -0400
    ehlo there
    250-incoming Hello ...
    250-SIZE 52428800
    250-PIPELINING
    250 HELP
    mail from:<devnull@???>
    250 OK
    rcpt to:<"noahm+foo nlm"@???>
    250 Accepted
    quit
    221 incoming closing connection


> 501 <noahm+foo nlm@???>: "@" or "." expected after "noahm+foo"
>
> Interestingly enough, sendmail (which I assume is running on
> server1.example.com, since the user is using the + hack) will choke on
> recipients of the form "luser+foo bar"@???, though it
> will accept and do the right thing with "luser+foo"@???
> or even luser+foo bar@??? (as I said above, it replaces
> the ' ' with a '.')
>
> So I'm still not convinced that quotes are necessary.


As you wish... I do not want to start discussing that. After all, that
is your system .:)

Another router came into my mind today. Map file will be of the format:

    user1:  user2@???


Router:

    redirect:
        driver = redirect
        domains = ...
        local_parts = dbm;/path/to/map.db
        local_part_suffix = +*
        local_part_suffix_optional
        data = ${quote:\
                    ${local_part:$local_part_data}$local_part_suffix\
            }@${domain:$local_part_data}


That is much cooler that the previous suggestion, IMHO. There is more
than one way to do it. :)

--
Kirill Miazine, Stud.Jur.
Faculty of Law, University of Oslo