Skip to main content

MgMail

Simple command line utility which will import document attachments from SMTP account into a Papermerge Project instance via REST API

It connects to IMAP account (your email account) via provided username/password/imap_server and iterates through all unread email messages.

For every unread message, if it finds a file attachment - it (mg-mail) uploads it via REST API to the papermerge service.

Installation

pip install mgmail

Usage

Create a configuration file e.g. mgmail.config.py Run::

    mgmail_imp --config /path/to/config.py

Configuration file

Configuration file must have .py extention and be a valid python file, example::

imap_server = "mail.paper.net"
username = "<username>"
password = "<pass>"
api_key = "<API KEY>"
papermerge_url = "<URL>"  # e.g. http://localhost:8000

Configuration Settings

  • imap_server is, well, your imap server.
  • username and password - your imap user account
  • api_key is papermerge's API key. Get your api_key as explained here
  • papermerge_url - paparmerge server instance url (with scheme i.e with http:// or https:// prefix). E.g. http://localhost:8000

Configuration Logging

Logging configuration are read from mgmail.logging.yml file. Example of mgmail.logging.yml file::

version: 1
handlers:
  xyzconsole:
    class : logging.StreamHandler
root:
  level: DEBUG
  handlers: [xyzconsole]

Example above configures root log to DEBUG level. All log messages will be displayed in console.

Metadata

Release files for mgmail 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mgmail 1.1.0
File Size Uploaded Provenance
mgmail-1.1.0.tar.gz 4.8 kB Without provenance Details

Release files / mgmail-1.1.0.tar.gz

Download URL mgmail-1.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca08dd671857080bd2f1ed0064cb213de30f31306c2381dedbb0ce6af0c9b87c
BLAKE2b-256 checksum
How to use checksums
9813177470fe4ffe30f070c7459f880b369c6bde1d70769da6a9cf99784c567b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for mgmail 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page