Re: [exim] filter and address book

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Mike Cardwell
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] filter and address book
* on the Fri, Aug 23, 2013 at 01:20:24PM +0300, Dennis Yurichev wrote:

> I have an address book, it's just plain text file, one email per line.
> Is it possible to set up a filter, in order to move all incoming emails
> from addresses not in address book, to another IMAP-accessible folder
> named "not-in-address-book", so to leave emails only from "known"
> addresses in inbox folder?


The following in the DATA ACL would add an "AddressBook: true" header
to your email if the sender envelope or From address are in your
address book file.

warn condition  = ${if or{{\
                    ${lookup{$sender_address}lsearch{/path/to/file}{true}{false}}\
                  }{\
                    ${lookup{${address:$h_From:}}lsearch{/path/to/file}{true}{false}}\
                  }}}\
     add_header = AddressBook: true


You could then use sieve or procmail or whatever to filter according to
the existance/value of this header.

-- 
Mike Cardwell  https://grepular.com/     http://cardwellit.com/
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3  B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1  BF1B 295C 3C78 3EF1 46B4