Manage mail from your server.
Project description
Mail Muxer
Are you tired of managing IMAP filters through cumbersome, slow and unintuive web interfaces ? Then Mail Muxer is here to save you from this pain !
Mail Muxer is a Python tool that will monitor your Inbox, and filter incomming emails according to the given configuration. It was designed to be intuitive and easy to use, by using compact configuration and sensible defaults: a rule can be as simple as
- condition:
FROM: example@email.org
move_to: some/folder
Basic Usage
-
Install:
pip install mmuxer
-
Create configuration file:
rules: - move_to: receipts condition: ANY: - FROM: some_store@ok.ok - FROM: some_other_store@store.net - move_to: important condition: SUBJECT: important - condition: FROM: spammer@example.com actions: - delete settings: server: imap.email.net username: me@email.net password: secret
-
Check your configuration:
mmuxer check --config-file config.yaml
-
Check your folders:
mmuxer folder --config-file config.yaml compare-destinations
-
Monitor your inbox:
mmuxer monitor --config-file config.yaml
-
Or apply on all messages of a given IMAP folder:
mmuxer tidy --config-file config.yaml --folder FOLDER
-
Finally, to get help on a given command, add a
--help
to it, e.g.mmuxer monitor --help
Settings
Using env variables for settings
Settings values (username
, password
, etc.) can be configured by providing environment variables of the same name (case insensitive).
Exporting configuration to sieve format
mmuxer can also export the rules of a configuration file to the sieve format, so that the rules will be handled server side.
mmuxer sieve-export --config-file config.yaml --dest-file rules.sieve
Note on SSL
If you get SSL errors while connecting to your server, see the SSL Configuration section.
All available settings
server: str
username: str
password: str
ssl_ciphers: Optional[str] = None
imap_wait_timeout: int = 60
sieve_folder_prefix: str = "" # folder prefix used when generating sieve rules
sieve_folder_separator: str = "/" # folder separator used when generating sieve rules
Going further on
- Advanced usage
- Use with docker/systemd: see doc
What's next
The current implementation is mostly feature complete for me, but here are some features that could be implemented:
- Improve
tidy
operation:- make
tidy
operation more performant by using IMAP search features - allow to run
tidy
on many / all folders
- make
- Better conditions:
- add a
REGEX
operator (although not compatible with IMAP search) - support more fields
- add a
- Add more actions:
- tag emails
- forward emails
- move destination based on regex match group
- automatic folder creation
- anything else ?
- Hot-reload config file
- Re-configure (or execute actions) by sending emails
- Support OAuth / Gmail (I'm not sure how feasible that would be).
Don't hesitate to ask, or make a pull request !
Credit
This program relies on
- the imap-tools library for everything involving IMAP
- the mock IMAP server from aioimaplib for it's tests
- the ever excellent Typer and Pydantic libs
Many thanks to them !
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mmuxer-0.6.5.tar.gz
.
File metadata
- Download URL: mmuxer-0.6.5.tar.gz
- Upload date:
- Size: 38.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02e765bab42b83abd8e9e5dcbb1d5dea2f782c2ec8b07669f4cc9c8854dc9c81 |
|
MD5 | cd9a6798080e2fc7f79aa71eba8f3c11 |
|
BLAKE2b-256 | 568eef24ee483a9b715883c1c943011a44a8cddbd725e8ed8d90709c6f7cfbd0 |
File details
Details for the file mmuxer-0.6.5-py3-none-any.whl
.
File metadata
- Download URL: mmuxer-0.6.5-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9f5d8a3e3639cc3d315198fd12b54a02927001a03ac5c232ba4c010e35c1b06 |
|
MD5 | 51732bdeec730cedb1dc0a22208d47de |
|
BLAKE2b-256 | d97f8d13026f492ece91e11d82b9798c8d140136c945718e7566d70315f1ef63 |