Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ede1998/autoarchive

Add an archiving button to thunderbird.
https://github.com/ede1998/autoarchive

addon archiving mail thunderbird

Last synced: 12 days ago
JSON representation

Add an archiving button to thunderbird.

Awesome Lists containing this project

README

        

# AutoArchive
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!**

## Configuration
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](https://webextension-api.thunderbird.net/en/latest/messages.html#messageheader)
and returns a `boolean`. The selector function is executed to determine whether a particular mail is affected by a rule.

An example configuration might look like this:
```json
[
{
"path": "[email protected]/Archives/${year}/amazon",
"selector": "return message.author.includes('@amazon.de');"
},
{
"path": "[email protected]/Archives/paypal",
"selector": "return message.author === '\"[email protected]\" ';"
},
{
"path": "Local Folders/Trash",
"selector": "const author = message.author.replace('@', '@@'); return author === 'SpamBot ';"
}
]
```

## FAQ

### Doesn't Thunderbird offer an archiving feature out of the box?
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.

### There is no archiving button on my mail.
Please make sure there is an archiving rule that applies to this mail.

### There is no archiving button on my mail and I am sure that I made a rule for it.
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`).

### Why does AutoArchive run user provided javascript? Isn't that totally unsafe?!
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.

## Attributions

[Icon](https://www.flaticon.com/premium-icon/archives_1200551) made by [Freepik](https://www.freepik.com) from [www.flaticon.com](http://www.flaticon.com).