AutoArchive is a simple Thunderbird addon that adds a button to mail views. If pressed the mail is archived to the preconfigured folder.
AutoArchive runs user provided javascript. You have been warned!
The addon can be configured via the options tab. You can also import/export the settings there. As of now, the only settings are the rules for which mail has to be archived into which folder.
A rule consists of 2 values:
- path determines the destination folder for a mail to be archived to. It has the following form:
account_name/path/to/destination/folder
. Path supports substitution of the current year:${year}
is replaced with the current year, e.g.2021
. - selector is a JS function body that receives
message
as an argument of type MessageHeader and returns aboolean
. The selector function is executed to determine whether a particular mail is affected by a rule.
An example configuration might look like this:
[
{
"path": "[email protected]/Archives/${year}/amazon",
"selector": "return message.author.includes('@amazon.de');"
},
{
"path": "[email protected]/Archives/paypal",
"selector": "return message.author === '\"[email protected]\" <[email protected]>';"
},
{
"path": "Local Folders/Trash",
"selector": "const author = message.author.replace('@', '@@'); return author === 'SpamBot <spam@@bot.example>';"
}
]
Yes but, as far as I know, it is limited. You can only put your mails into a basic archive folder split into years. If you want more specialized folders, you're out of luck.
Please make sure there is an archiving rule that applies to this mail.
Maybe the rule doesn't match the mail because some field has a different value than you expect.
I noticed this behaviour when doing an exact match for the author field. Thunderbird hides the quotes wrapping the author name.
To check if this might be the case for you, you can check the values in the raw mail (More > View Source
).
Yes it probably is. However the addon is mostly for myself and just passing a JS function as selector was way easier than implemented some kind of filter system.
Icon made by Freepik from www.flaticon.com.