Save emails from an IMAP server into local files.
PyYAML to load settings from a Yaml file.
The settings_example.py
and settings_example.yaml
need to be copied
and have the _example
part removed.
These new files should be modified to contain local settings.
Once that configuration is complete, you can run the main script:
python download_emails.py
crontab -e
* 6 * * * source /path/to/repo/deployment/deploy.sh >> /var/log/cron.log 2>&1
-
19.1. email - An email and MIME handling package. Stores the raw content from IMAP in a wrapper class.
-
21.15. imaplib - IMAP4 protocol client. Getting emails from folders within an IMAP server.
-
How to understand the equal sign '=' symbol in IMAP email text?. Decode the MIME symbols in the email content (fixes soft line breaks).
-
Python - imaplib IMAP example with Gmail. This article in particular was very helpful as a starting point.