Hallo,
* Eduard Bloch [Tue, Sep 06 2022, 10:03:24AM]:

> Dev branch: 
> https://salsa.debian.org/blade/mail-expire/-/commits/feat-992995-status-filter

Well okay, once I started implementing the actual code, it became
obvious that this way of filtering does not make much sense. I.e.
separating including/excluding/date filter into different categories gets
overcomplicated and at the same time it limits user's options to combine
them properly.

Instead, I would use something like following, i.e. attaching the
additionial filtering wishes directly to the age specification. Details
as following or see the latest git changes, link above. This obviously
does not cover all corner cases but IMHO it's good enough for all
usecases I came up with.

So you could specify something like:

mail-expire 10000,Recent maildir-foo --filter 100,NonRecent --filter 50,Seen 
--filter 7,Deleted
# "never" expire New/Recent mails, after 100 days the spotted ones, after 50
# days the already read mails, and the deleted ones after a week

Opinions?

SYNOPSIS
       mail-expire AGE-IN-DAYS[,FILTERFLAG,...] FILES...
...
       The filter parameter can be extended with additional filter 
specifications (see --filter in options), also multiple alternative filters can 
be specified using options.

       --filter=DAYS,FILTERFLAG,FILTERFLAG,...
           Specifies additional filter(s), with the minimum age in days, and 
optional status flags which turn on or off the consideration of the message for 
expiration. Multiple filters are possible.

           Possible filter flags are: Seen, Recent, Answered, Flagged, Draft, 
Deleted. The meaning can also be inverted by prepending "Not" (like: NotSeen).

           The meaning of Seen and Recent may vary depending on the mail 
storage format and the client editing message metadata.  For Maildir, Recent 
means "still in NEW space" or marked with IMAP "R" flag, and Seen is "MUA marked
           the message as actually read".

Best regards,
Eduard.

Reply via email to