Re: [exim] Exim4 condition, need help

Pàgina inicial
Delete this message
Reply to this message
Autor: Jakob Hirsch
Data:  
A: Michael Bordignon
CC: exim-users
Assumpte: Re: [exim] Exim4 condition, need help
Michael Bordignon wrote:

> I'm trying to have exim look at the sender address for all incoming
> mail, if it matches more than one row (via a mysql query) then prepend
> the subject with 'foo'.
>
> I've come this far;
>
> --
> set acl_m9 = mysql;SELECT COUNT(*) FROM prospect_addresses WHERE email


you don't need to fiddle in ACLs (and it wouldn't work with that, anyway).

> LIKE '$sender_address'
>
> if acl_m9 contains "1" then


That would be $acl_m9. But as said, it's not needed. Just use

if ${lookup mysql {SELECT COUNT(*)...}} is above 1
...

Untested, I never used lookups in a filter.

Oh, and use '${quote_mysql:$sender_address}'.

> headers add "New-Subject: [foo] ${escape:$h_subject:}"


probably better use ${rfc2047 than ${escape here.

put the "if ... endif" stuff into a file (e.g. /etc/exim/system-filter)
and the following lines at the top of your exim.conf:

system_filter = /etc/exim/system-filter
system_filter_user = your_exim_user

But you should really read (at least) the documentation of Exim's
filtering facilities.