RE: [Exim] Autoreply: Exim-users digest, Vol 1 #1064 - 17 ms…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Bernard Stern
Päiväys:  
Vastaanottaja: exim-users
Aihe: RE: [Exim] Autoreply: Exim-users digest, Vol 1 #1064 - 17 msgs
On Thu, 19 Apr 2001 10:48:28 -0700 Marc MERLIN wrote:

> On Thu, Apr 19, 2001 at 04:35:56PM +0100, Nigel Metheringham wrote:
>> To continue my periodic rant, autoreplies should be obey the following
>> rules:-


> I use this:


(...)

> But not this one (AFAIK):


>> - reply only to personal mail (ie mention one of your addresses in
>> to/cc)


> Can I do this with exim?


Yes, you can use the variables

$header_to:
$header_cc:

to this purpose.

I use the following condition:

  condition = "${if and { H_TO_CC_MATCH_LOCALPART \
                          SENDER_NOT_NIL          \
                          H_SUBJ_NOT_CIRCULAR     \
                          H_FROM_NOT_MATCH_ADMINS \
                          SENDER_NOT_MATCH_ADMINS \
                          PRECEDENCE_NOT_JUNK     \
                        }  \
                    {yes}  \
                    {no}   \
                }"


with the conditions in capital letters being various macros.

for example:

LOOKUP_HEADER_TO = ${expand:${lookup{${extract{1}{+}{${lc:${local_part:$header_to:}}}}} \
                              cdb{EXIM_TABLES/SWITCH-aliases.CDB}{$value}}}
LOOKUP_HEADER_CC = ${expand:${lookup{${extract{1}{+}{${lc:${local_part:$header_cc:}}}}} \
                              cdb{EXIM_TABLES/SWITCH-aliases.CDB}{$value}}}


here the reason for the extract is that in localpart+postfix, postfix is a
potential IMAP mailbox. You won't need this if you do not support this
kind of IMAP stuff, which will simplify the config. As a small site,
supporting such config in no problem.

H_TO_CC_MATCH_LOCALPART = { or { {match{LOOKUP_HEADER_TO}{$local_part}}   \
                                 {match{LOOKUP_HEADER_CC}{$local_part}} } }


Caveat: there are many lookups (ok, exim does some caching), so this probably
won't suit a large site.

Regards,

Bernard Stern, SWITCH

____________S_W_I_T_CH___Swiss Academic_______________________________________
        mail: SWITCH Head Office       a          Tel: +41 1 268 1520
              Limmatquai 138           n          Fax: +41 1 268 1568
              CH-8001 Zurich           d        e-mail: stern@???
________________________________________Reseach Network_______________________