Skip to main content

A module to download emails from an IMAP4 server

Project description


.. _l-README:

README
======

.. only:: html

.. image:: https://travis-ci.org/sdpython/pymmails.svg?branch=master
:target: https://travis-ci.org/sdpython/pymmails
:alt: Build status

.. image:: https://ci.appveyor.com/api/projects/status/hqhhdndvayrx0r9k?svg=true
:target: https://ci.appveyor.com/project/sdpython/pymmails
:alt: Build Status Windows

.. image:: https://circleci.com/gh/sdpython/pymmails/tree/master.svg?style=svg
:target: https://circleci.com/gh/sdpython/pymmails/tree/master

.. image:: https://badge.fury.io/py/pymmails.svg
:target: http://badge.fury.io/py/pymmails

.. image:: http://img.shields.io/github/issues/sdpython/pymmails.png
:alt: GitHub Issues
:target: https://github.com/sdpython/pymmails/issues

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:alt: MIT License
:target: http://opensource.org/licenses/MIT

.. image:: https://landscape.io/github/sdpython/pymmails/master/landscape.svg?style=flat
:target: https://landscape.io/github/sdpython/pymmails/master
:alt: Code Health

.. image:: https://requires.io/github/sdpython/pymmails/requirements.svg?branch=master
:target: https://requires.io/github/sdpython/pymmails/requirements/?branch=master
:alt: Requirements Status

.. image:: https://codecov.io/github/sdpython/pymmails/coverage.svg?branch=master
:target: https://codecov.io/github/sdpython/pymmails?branch=master

**Links:**

* `GitHub/pymmails <https://github.com/sdpython/pymmails/>`_
* `documentation <http://www.xavierdupre.fr/app/pymmails/helpsphinx/index.html>`_
* `Blog <http://www.xavierdupre.fr/app/pymmails/helpsphinx/blog/main_0000.html#ap-main-0>`_

Description
-----------

The module was started to grab emails using IMAP and to store them on a local disk.
I now use it to download to material sent by my students before an oral presentation.
I receive many of them and it is usually annoying to download them one by one.
Here is the code I use::

from pymmails import MailBoxImap, EmailMessageRenderer

user = "your.email"
pwd = "passsword"
server = "imap.your_provider.ext"

box = MailBoxImap(user, pwd, server)
render = EmailMessageRenderer()
box.login()
for mail in box.enumerate_mails_in_folder("saved", pattern="<pattern>") :
mail.dump(render, location=temp, fLOG=fLOG)
box.logout()
render.flush()

Some examples of patterns::

pattern='FROM "xavier" SINCE 1-Feb-2013'
pattern='FROM "xavier" SINCE 1-Feb-2013 BEFORE 5-May-2013'
pattern='FROM "xavier" SINCE 1-Feb-2013 BEFORE 5-May-2013 UNANSWERED'
pattern='CC "jacques" FROM "xavier" DELETED'
pattern='TEXT "github"'
pattern='LARGER 10000 SMALLER 1000000'
pattern='SUBJECT "programmation"'
pattern='TO "student" FLAGGED'
pattern='UNSEEN'

Design
------

This project contains various helper about logging functions, unit tests and help generation.

* a source folder: ``src``
* a unit test folder: ``_unittests``, go to this folder and run ``run_unittests.py``
* a _doc folder: ``_doc``, it will contains the documentation
* a file ``setup.py`` to build and to install the module
* a file ``make_help.py`` to build the sphinx documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymmails-0.2.237.tar.gz (220.9 kB view details)

Uploaded Source

Built Distribution

pymmails-0.2.237-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file pymmails-0.2.237.tar.gz.

File metadata

  • Download URL: pymmails-0.2.237.tar.gz
  • Upload date:
  • Size: 220.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymmails-0.2.237.tar.gz
Algorithm Hash digest
SHA256 3eb634e391f309a1676004cb70ecfb7a052da6306da470935b347b5ea75fdaaf
MD5 bf5f3e3bb4e4ae26378ffd7866a2740c
BLAKE2b-256 6563aaff2b75f0e776997cd0c94cd7f7766d85c66f1c245432d064a2b4a139ca

See more details on using hashes here.

File details

Details for the file pymmails-0.2.237-py3-none-any.whl.

File metadata

File hashes

Hashes for pymmails-0.2.237-py3-none-any.whl
Algorithm Hash digest
SHA256 e277678fddd6d4a2f7a8eff20bd783412e5e872e43ad9e582a69c86b1cc7e087
MD5 425bfdc43d540fbbd33af4ac6889bd76
BLAKE2b-256 1f3c5a793bbf0d517c7999b8bbb24570100178a5135b17a03a0d56edfddef7b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page