[Exim] verify and condition

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Phil Chambers
Date:  
À: exim-users
Sujet: [Exim] verify and condition
I recently added a condition to my mailing list router to keep track of list usage
(so that I can identify lists which appear to be no longer active). I added

condition = ${run {/usr/local/exim/list-log.pl $local_part $message_id}{yes}{yes}}

where the list_log.pl file is a perl script which puts time-stamped information in a
log file.

This works almos perfectly, except I get two lines every time a list is used; once
for the verify and again for the actual routing. I could duplicate the router and
make one verify_only, without the condition and the other no_verify_only, with it.
This seems a bit heavy handed, so I was wondering if there is there a way of
detecting the verify state in the condition option. I can't see a specific
variable, but noticed that $message_id is empty during the verify phase. Can I rely
on that and put

  condition = or{{!def:message_id}\
     {${run {/usr/local/exim/list-log.pl $local_part $message_id}{yes}{yes}}}}


So that the run part does not happen during the verify phase?

I would like to add the $sender_address to the arguments I pass to the perl script.
Do I need to wrap it in anything or quote it to prevent peculiar sender addresses
causing command-line argument complications?

Phil.
---------------------------------------
Phil Chambers (postmaster@???)
University of Exeter