Skip to main content

imio.email.parser

This package can parse emails and generate a PDF file of their content.

It is mainly used by package imio.email.dms.

Features

  1. select relevant email messages (e.g. email forwarded as an attachment)

  2. parse emails (headers, attachments, …)

  3. generate a PDF email preview with email2pdf package

Usage

mail = email.message_from_string(mail_body)
parser = Parser(mail)
print(parser.headers)
print(parser.attachments)
parser.generate_pdf(pdf_path)

Requirements

package wkhtmltopdf

Contribute

License

The project is licensed under the GPLv2.

Contributors

Changelog

0.3.4 (2026-08-05)

  • Added TNEF (Outlook rich text) support. (DMS-1232) [chris-adam]

0.3.3 (2025-07-01)

  • Formatted Date header following timezone. [chris-adam]

0.3.2 (2025-05-16)

  • Fixed base64-encoded rfc822 attachment not decoded. [chris-adam]

0.3.1 (2025-03-26)

  • Improved parser.correct_addresses. [sgeulette]

  • Increased test coverage. [cadam]

  • Fixed attachment filename parsing. [cadam]

0.3.0 (2025-02-18)

  • Used standard email parser in tests. [sgeulette]

  • Handled correctly rfc822 attachment (attached eml) [sgeulette]

  • Handled correctly owa transfer [sgeulette]

  • Added message parameter to parser.generate_pdf [sgeulette]

  • Handled quoted-printable filename [sgeulette]

0.2.0 (2024-10-04)

  • Removed newline characters from attachement filename causing exception when creating file later in Plone. [sgeulette]

  • Added attachments information [sgeulette]

  • Corrected attachments disposition (check really embedded content ids) [sgeulette]

  • Worked with EmailMessage [sgeulette]

  • Added specific handling for Apple Mail forward [sgeulette]

  • Added specific handling for IBM Notes forward [sgeulette]

  • Added specific handling for automatic exchange forward [sgeulette]

  • Get lowercased email addresses [sgeulette]

  • Blacked and isorted files [sgeulette]

  • Corrected body add when missing and worked on a copy of the message in that part [sgeulette]

0.1 (2022-02-17)

  • Corrected badly addresses from email.utils.getAddresses

  • Managed email2pdf exception when email body is empty

  • Added tests

  • Added headers in pdf

  • Added emailtopdf script to test easily eml transformation in pdf

  • Initial release. [laulaz, sgeulette]

Metadata

Release files for imio.email.parser 0.3.4

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

Source distribution (sdist)

Source distribution for imio.email.parser 0.3.4
File Size Uploaded Provenance Actions
imio_email_parser-0.3.4.tar.gz 11.8 kB Without provenance Details for imio_email_parser-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for imio.email.parser 0.3.4
File Interpreter ABI Platform Actions
imio_email_parser-0.3.4-py3-none-any.whl Python 3 none any Details for imio_email_parser-0.3.4-py3-none-any.whl

Total release size: 23.4 kB

Release files / imio_email_parser-0.3.4.tar.gz

Download URL imio_email_parser-0.3.4.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b7529ea1b7ae5d3b64f88b7f3e0db74255c7c01137e7e576bd50c44b7c16c62b
BLAKE2b-256 checksum
How to use checksums
1fa6d3c1d955827eb9e4a9b3fab553dc419fbe8c36dcb537b5f8c36cc4c79d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release files / imio_email_parser-0.3.4-py3-none-any.whl

Download URL imio_email_parser-0.3.4-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
769febdd48bce51b219c97ad164cbfd8b122b334930695c5a23f29f0ff56298a
BLAKE2b-256 checksum
How to use checksums
c3df7b587751630e617ab85117e4b896e44ee39c7bdbc836c5b9a11c42272fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Security for imio.email.parser 0.3.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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