Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1007 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 1007 Bytes

pymail2file

This is a Python package that allows you to save email attachments to a file, on specific folder according to rules/filters.

You can save the files to:

  • Local storage
  • GDrive

Example tests.py

Create your .env file, e.g.

IMAP_HOST=mail.infomaniak.com
IMAP_PORT=993
SMPT_HOST=mail.infomaniak.com
SMTP_PORT=465
[email protected]
EMAIL_PASSWORD="SUPERPASSWORD"
[email protected]

Prepare your GDrive Account

If you want to use the GDrive part of the example, follow this part on PyDrive2:

  • Create the application on your Google APIs Console and save the JSON in client_secrets.json

  • Run the tests.py, the first time, a web page will open, accept the connection between the application you created and your Google Account ; a file credentials.json will be created, you will not need to log in next time.