Python version >3.11 because I use builtin tomllib
module recently introduced.
pip install .
Please look at config.toml
.
mkdir ~/.config/sieve-sync
cp config.toml ~/.config/sieve-sync/config.toml
- Go into the sieve edit pages.
- Open you browser developer console
- Enter something and hit the save button.
- Look at the request to figure out the token and cookie.
- fill the value back to
config.toml
- token has the format:
fma1-XXXXX
- cookie has the format
__Host-s_XXXXXX=XXXXXXXX
: only this specific cookie is needed after my test
You can look the following screenshots:
When you first running; it will insert some commented blocks in your rules
#### Managed by Sieve Sync Start ####
#### Managed by Sieve Sync End ####
Only the rules in the blocked will be synced.
sieve-sync --pull
It will saved the rules to the SAVE_LOCATION
in config.toml
.
I don't do any checking when pulling; all your local edit will be discarded!
sieve-sync --push
It will read from SAVE_LOCATION
and push the update to Fastmail.
It will also pull non-managed contents (outside those commented blocks) to the saved rules.
For the official Masked Email API, you can only select fastmail.com or one of your domains. This is very limited.
This is can be easily achieved by generating a set of sieve rules.
- Enable Catch-all address for your domain.
- Use tools to generate random addresses for your domain.
- Generate Sieve rules automatically to drop mails sent to disabled masked email addresses.
Hope we don't need to this tool anymore in the future when the official API allows us to set the domain we want.
This project is mainly a POC.
The API interface for Sieve is not public.
I hope that Fastmail will not prevent us from doing such things before they publish public Sieve API or just support ManageSieve which is already supported by Cyrus IMAP I believe!!
Please tell me if using these unpublished API is inappropriate; and I will take it down if asked.