a simple CLI tool to clean IMAP folders
To install with pip:
$ pip install -U mailbox-cleaner
After installation the command mailbox-cleaner
should be available.
You can also just download the mailbox_cleaner.py
file and execute it directly.
To delete emails older than 15 days in the INBOX folder:
mailbox-cleaner imap.example.com [email protected] myPassword -d 15
To delete emails older than 30 days in the Trash folder using a STARTTLS connection to a host with non-standard port:
mailbox-cleaner imap.example.com:9999 [email protected] myPassword -c STARTTLS -f Trash -d 30
To see all available options and more information use:
mailbox-cleaner --help
Licensed GPLv3+, see the LICENSE file for details.
Copyright © 2022 Asiel Díaz Benítez.