Re: [Exim] add/remove header

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Hans Matzen
Fecha:  
A: exim-users
Asunto: Re: [Exim] add/remove header
I have tested a lot with the suggestions you have made and in
case somebody else is in my situation I will describe it below.
but first of all thanks to Vadim and Philip...and by the way exim
is excellent.

heres my solution it is a mixture of your suggestions:

1. I use two alias files one for local to worldusable
address mapping and one vice versa.
e.g.:
aliasfile_intern_to_extern:
hans@???     Hans Matzen <hansm@???>
    .
    .
    .


aliasfile_extern_to_intern:
hansm@???    hans@???
    .    
    .
    .


---------------
2. in the rewriting section of the configfile i added something
like:

# this is to fetch the envelope from 
#
*@*.local.domain "${lookup{${lc:$1}}lsearch{/aliasfile_intern_to_extern} \
           {$value} fail}" F


*@*   "${lookup{${lc:$0}} lsearch{/aliasfile_extern_to_intern} \
          {$value} {$0}}" T
---------------
3. because my provider checks for world usable Sender header
and the other discussed reasons i added the following to the smtp
transport section:


headers_remove = "sender:from:reply-to"
headers_add = "From: ${lookup{${lc:${local_part:$header_from:}}}\
            lsearch{/aliasfile_intern_to_extern} \
            {$value}fail}\n \
    Sender:${lookup{${lc:${local_part:$header_from:}}}\      
            lsearch{/aliasfile_intern_to_extern} \
            {$value} fail}\n \
    Reply-to:${lookup{${lc:${local_part:$header_from:}}}\      
        lsearch{/aliasfike_intern_to_extern} \       
             {$value} fail}\n"


i am not sure yet if i miss some significant headers but it seems
to work now like i want it to.
but if anybody uses this mechanism, one should be aware that it
is the admins task to check and maintain the external adresses in
the alias files to avoid bad mails.
by the way is it possible to do a reverse lookup
on aliasfiles ? this would save the second file, but if not, it
doesnt matter one can easily convert one into the other.

hans