[imapfilter-devel] Whitelist Feature Request
Lefteris Chatzibarbas
lefcha at hellug.gr
Sat Aug 30 18:10:40 EEST 2003
On Fri, Aug 29, 2003 at 10:36:52PM -0400, Chase wrote:
> You need a an ability to create a white list, basically, you have your
> rule definitions
>
> Filter foo
> Mask
> Mask
> Mask
> Action delete
>
> Filter bar
> Mask
> Mask
> Mask
> Action delete
>
>
> Job foo,bar myaccount
>
> A white list would be a group of definitions that are always evaluated
> first, if the email matches a rule in that group, then IMAPFILTER will
> stop processing on the email and just leave it alone, even if the email
> would also match every other definition.
>
> [...]
>
> Currently the only way to make a white list is to move your "white list"
> emails to another folder. This is not a good way for the users that
> don't organize their email into multiple folders, they have an inbox,
> and they have the trash that deleted mail is put into.
This would require that imapfilter stored the UID (Unique Identifier) of
messages that matched the "whitelist" filter locally. So it would then
have to, automatically, include in every other filter a hidden mask of
the style:
and not uid 16
and not uid 19
and not uid 22:26
...
Because of the fetching/storing/searching/sending of the "whitelist"
messages' UID's, it would make things very complicated.
Instead there is another solution to this problem, which currently works
with imapfilter and with a few additions (ie. not much code) it could be
made much more powerful (read the last paragraph about this) that just
the "whitelist" capability:
The IMAP4rev1 protocol specifies a special flag that can be set in each
message in a mailbox. This flag, which is named "\Flagged", is intended
to be used as a special/attention/urgent/etc. flag. Imapfilter can add
or remove this flag from messages that match a filter, specifically with
the "flag" action (see the imapfilterrc(5) manual page).
So to accomplish what you describe you create the "whitelist" filter:
filter whitelist or
from foo
subject blah
...
action flag add flagged <---- MARK MESSAGE
And then include in other filters something like:
filter other
unflagged <---- NOTE THE SEARCH CRITERIA
...
action delete
The IMAP4rev1 protocol also specifies that an IMAP server MAY (ie. it is
optional) have support from custom message flags (except from the
standard "\Seen", "\Answered", "\Flagged", "\Deleted", "\Draft",
"\Recent" flags). If it is useful, I could add support for this feature
and then one could set different, custom flags to messages such as
"Whitelist", "Family", "Friends", "Work", etc. and of course search
messages according to them.
More information about the Imapfilter-devel
mailing list