Re: [Exim] intranet with dialup connection

Etusivu
Poista viesti
Vastaa
Lähettäjä: Hans Matzen
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [Exim] intranet with dialup connection
> I am working on another solution for our problem, that is using
> Vadims suggstion of rewriting using Fh, because this has some
> advantages, e.g. only headers which exists are rewritten.
> but as I tried this I ran in trouble with local messages, because
> some of the headers point to the world usable address
> (e.g. reply-to)
> but it should be possible to do a add/remove header for local
> messages as I suggested for the remote_smtp transport.
> this is indeed nearly the same but there maybe a few more
> advantages, since the messages going to the world are a bit more
> correct and imho local mail is not that critical.


now i am on my way to get this to work and got the following
problem:
I only want to fix a few headers in messages that are locally
delivered and use a smartuser director as the first of all
directors

rewritelocal:
   driver = smartuser
    # check if we can do anything for this local recipient
   condition = "${lookup{${lc:$local_part}} \
           lsearch{/usr/local/exim/aliases_inex} {$value} {}}"


# set the new address to the old address since exim needs it
new_address = $local_part@$domain
# no further rewriting
rewrite = false

   headers_remove = "From:To:Reply-to"
   headers_add = "From: ${lookup{\
          ${lc:${local_part:$h_From:}@${domain:$h_From:}}} \
          lsearch{/usr/local/exim/aliases_exin} \ 
          {$value} {$h_From:}}\n\
          To: ${lookup{\
          ${lc:${local_part:$h_To:}@${domain:$h_To:}}} \
          lsearch{/usr/local/exim/aliases_exin} \ 
          {$value} {$h_To:}}\n\
          ${if def:h_Reply-to: \
          {Reply-to: ${lookup{\
          ${lc:${local_part:$h_Reply-to:}@${domain:$h_Reply-to:}}} \
          lsearch{/usr/local/exim/aliases_exin} \ 
          {$value} {$h_Reply-to:}}\n}}"
userforward:
  driver = forwardfile
  file = .forward
  no_verify
  no_expn
  check_ancestor
  file_transport = address_file
  pipe_transport = address_pipe
  reply_transport = address_reply


etc.

this seems to work but if there is a .forward file
the message is correctly forwarded but there are two To: and
From: headers in it.

it looks like:
From: blah@???
To: foo@???
From: blah@???
To: foo@???

what is the reason for this behaviour ?
any ideas ?

hans