Re: [Exim] headers_add not working

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Philip Hazel
Datum:  
To: David Saez
CC: exim-users
Betreff: Re: [Exim] headers_add not working
On Mon, 10 Nov 2003, David Saez wrote:

> the only involved router with the unseen option (the one with transport
> spam_transport) is parsed BEFORE the router that tries to add the
> headers.


Well, actually, it goes through the unseen router more than once. These
are lines extracted from the debug:

routing ols2000@???
--------> copymail router <--------
...
--------> dnslookup router <--------
local_part=ols2000 domain=ols.es
...
--------> spam_director router <--------
local_part=ols2000 domain=ols.es

routed by spam_director router (unseen)
  envelope to: ols2000@???
  transport: spam_transport
"unseen" set: replicated ols2000@???
...
Considering: ols2000@???
routing ols2000@???
...
--------> system_aliases router <--------
local_part=ols2000 domain=ols.es
...
--------> virtual_aliases router <--------
local_part=ols2000 domain=ols.es
...
expanding: X-Forward: for $local_part@$domain by $sender_address at $primary_hostname
   result: X-Forward: for ols2000@??? by david@??? at a.mx.ols.es
virtual_aliases router generated david@???
...
routing david@???
--------> copymail router <--------
local_part=david domain=ols.es
...
--------> dnslookup router <--------
local_part=david domain=ols.es
...
--------> spam_director router <--------      <==========SECOND TIME======
local_part=david domain=ols.es
...
routed by spam_director router (unseen)
  envelope to: david@???
  transport: spam_transport
"unseen" set: replicated david@???
...
Considering: david@???
unique = \0\david@???



And here is a delivery from the spam_transport:


--------> david@??? <--------
locking /var/spool/exim/db/retry.lockfile
locked /var/spool/exim/db/retry.lockfile
opened hints database /var/spool/exim/db/retry: flags=0
dbfn_read: key=T:david@???
no retry record exists
search_tidyup called
changed uid/gid: local delivery to david <david@???> transport=spam_transport
uid=1006 gid=12 pid=7502
auxiliary group list: <none>
home=NULL current=/
set_process_info: 7502 delivering 1AI9gl-0001wp-TN to david using spam_transport
appendfile transport entered
appendfile: mode=660 notify_comsat=0 quota=0
directory=/var/spool/exim/spam format=maildir
message_prefix=null
message_suffix=null
delivering in maildir format in /var/spool/exim/spam
writing to file tmp/1068223347.H509726P7502.a.mx.ols.es
added header line(s):
X-Forward: for ols2000@??? by david@??? at a.mx.ols.es
---

Notice the last 2 lines....

> but, the headers_add happens AFTER the unseen (routers config follows)


I think you have misunderstood how redirection works. After a
redirection, the routers are executed again from the start. So your
"unseen" router will operate both before and after a redirection.
(That's why I see two spam_transport deliveries int the debug.)

> spam_director:
> driver = accept
> retry_use_local_part
> transport = spam_transport
> no_verify
> unseen


I suggest you find a way of ensuring that that router is not run again
after redirection. Hmm. I'm not sure how easy that actually is to do,
now that I think about it.

You could perhaps set redirect_router on the redirecting routers.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.