Menu

#12 Support archiving when mailbox exceeds size

open
nobody
None
5
2005-01-03
2005-01-03
No

I'd like to archive mails when the mailbox size exceeds
a set number. Along with this I'd like to sort by
certain criteria before truncating the overflow emails.
For example:

To limit the mailbox to the 2000 newest emails:
archivemail --sortby=date --limit=2000 mailbox

To limit the mailbox to the 2000 oldest emails:
archivemail --sortby=reversedate --limit=2000 mailbox

To limit the mailbox to the 2000 least egregious spams,
as reported by SpamAssassin:
archivemail --sortby=number
--keypattern='^X-Spam-Status:.*hits=([0-9.]*)'
--limit=2000 mailbox

Here --keypattern allows us to specify a regular
expression that captures the sort key. --sortby then
treats this key as a number for sorting purposes.
(--sortby=number and --sortby=alpha require --keypattern)

Perhaps if there is no sort criteria, it defaults to
"date"...

I hope you like this idea. It would allow me to get rid
of my homegrown solution and use a more standard one.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.