You are currently viewing Paperless add-on eml2pdf setup

Paperless add-on eml2pdf setup

Here’s how to Paperless add-on eml2pdf setup. Step-by-step instructions with further information about the eml2pdf add-on 👍

📒 Further articles in this series:

At the top right, just below “Subscribe to Newsletter”, you’ll find the search field!
Type “Paperless” and press the [ENTER] key to display all Paperless articles.

Feature description

eml2pdf excels in its ability to convert EML files, including all attachments, into a single PDF. The tool processes input formats such as typical EML files and seamlessly integrates attachments such as images or PDFs as separate pages in the output document. The performance is impressive: a conversion takes about 5-10 seconds, depending on the number and size of the attachments. It runs on Python 3.11 with minimal dependencies such as LibreOffice and can process multiple files simultaneously, depending on available system resources. This makes eml2pdf scalable and ideal for larger projects.

Video: Paperless add-on eml2pdf setup

Language: 🇩🇪🇬🇧
☝️ Use YouTube subtitles for all languages.

Introduction to eml2pdf as a conversion tool

Welcome to our latest project: eml2pdf! This add-on was specially developed to convert EML files—including all attachments—into a single, user-friendly PDF document. eml2pdf is an indispensable tool for anyone who wants to digitize their email correspondence efficiently. With a focus on GoBD compliance (principles of proper management and storage), it ensures that all metadata is secured and the conversion remains verifiable—perfect for businesses and individuals who need to meet legal requirements.

100% integration with Paperless

One highlight of eml2pdf is its seamless integration with Paperless, a popular solution for paperless document management. This 100% compatibility allows users to integrate eml2pdf directly into their existing Paperless workflows. Whether it’s archiving emails or managing attachments, eml2pdf adapts perfectly and ensures that your documents remain consistent and accessible. The integration is designed to not interfere with daily operations while still offering maximum efficiency.

Setup and configuration

Setting up eml2pdf is easy and only takes a few steps. First, Docker and Docker Compose must be installed.

Configuration

Here are the configuration files you need to successfully use eml2pdf:

docker-compose.yml

  eml2pdf:
    image: ghcr.io/klissner/eml2pdf:latest
    volumes:
      - ./eml-import:/input
      - ./consume:/consume
      - ./eml-import/archiv:/eml-import/archiv
      - ./eml-import/error:/eml-import/error
      - ./config.json:/config.json
    environment:
      - TZ=Asia/Bangkok
      - LOGLEVEL=INFO
    restart: unless-stopped
  • image: Refers to the pushed image of GitHub.
  • volumes: Connects local directories to the container.
    • ./eml-import:/input: Directory for input EML files.
    • ./consume:/consume: Output directory for converted PDFs.
    • ./eml-import/archiv:/eml-import/archiv: Archive directory for processed files.
    • ./eml-import/error:/eml-import/error: Error log with log files.
    • ./config.json:/config.json: Provisioning the configuration file in the container.
  • environment: Sets environment variables.
    • TZ=Asia/Bangkok: Defines the time zone.
    • LOGLEVEL=INFO: Legt die Log-Stufe fest.
  • restart: Automatically restarts the container unless it is stopped manually.

Configuration notes

  • /eml-input is the directory where the *.eml files are stored..
  • /consume is the directory where the *.pdf files are output. If this path is not specified correctly, Paperless cannot read the files..

Also check your paperless configuration (docker-compose.yml or via Portainer) in the webserver section under environment for the entry:

PAPERLESS_CONSUMER_POLLING: 600

This entry must be present, otherwise Paperless will not start the import. The value is specified in seconds – this means that the check is performed every specified number of seconds.

In the example:
600 seconds = every 5 minutes.

LOGLEVEL settings 

  • LOGLEVEL in eml2pdf: Controls the logging level in the container.
  • Possible values:
    • CRITICAL (50): Only serious errors.
    • ERROR (40): Errors that affect execution.
    • WARNING (30): Potential problems.
    • INFO (20, Standard): Allgemeiner Betriebsstatus.
    • DEBUG (10): Detailed troubleshooting.
    • NOTSET (0): Falls back to default.
  • recommendation: INFO for normal operation, DEBUG for development.
  • adjustment: Change in docker-compose.yml under environment (for example, LOGLEVEL=DEBUG) and start with docker-compose up -d.. 

config.json 

{
 "separator_text": "Anlage {num}: {name}",
 "poll_interval_seconds": 300,
 "separator_page": "on",
 "archive_retention_days": 30,
 "max_logfile_size": 1048576,
 "max_logfile_backups": 5
} 

Parameter:

  • separator_text: Text for attachment separator (e.g., Attachment 1: file.pdf).
  • poll_interval_seconds: Interval in seconds to check the input directory (300 = 5 minutes).
  • separator_page: Inserts a separator page before attachments (on/off).
  • archive_retention_days: Retention period for archive files in days (30). Set this value to 0 to disable automatic deletion in the archive.
  • max_logfile_size: Maximum size of the log file in bytes (default: 1 MB = 1048576). If this value is exceeded, the SizeRotatingFileHandler class rotates the logs (log.txt becomes log.1, log.1 becomes log.2, etc., until max_logfile_backups is reached). Set this value to 0 to disable logging; existing log files will be deleted!
  • max_logfile_backups: Number of log backups (default: 5). Determines how many rotated log files (e.g., log.1, log.2) are retained. Older backups are deleted when the maximum number is reached. Set this value to 0 to disable the creation of backups and the associated deletion..

Customize config.json to suit your needs (e.g., time zone or interval). If you make changes, you can ignore the file in your .gitignore to prevent it from being uploaded unintentionally.

Summary of log management

eml2pdf uses a SizeRotatingFileHandler class to manage the log file size. When max_logfile_size (default: 1 MB) is exceeded, logs are rotated (log.txt → log.1 → log.2, etc.) up to max_logfile_backups (default: 5) backups. Important: If max_logfile_size is set to 0, logging is disabled and all existing log files are deleted! Set max_logfile_backups to 0 to prevent backups from being created.

General License and Liability Disclaimer (Summary)

This software is provided under an open source license.
Use, reproduction, modification, and distribution are permitted provided that this notice remains intact.

  • No liability: The author accepts no responsibility for damage, loss of data, or other disadvantages arising from the use of this software.
  • No warranty: The software is provided “as is,” without express or implied warranties, in particular with regard to functionality, suitability for a particular purpose, or compatibility.
  • Official recognition: The recognition of documents or results created with this software cannot be guaranteed. Whether and to what extent recognition is granted depends on the respective competent authorities, institutions, countries, or contractual partners.
  • Personal responsibility: Use is exclusively at your own risk.

By using this software, the user agrees to these terms and conditions.

Fazit

With eml2pdf, you have a powerful tool at your fingertips that efficiently converts your EML files to PDFs and integrates perfectly with Paperless. GoBD compliance ensures legal security, while simple setup and configuration make it easy to get started. Try it out and optimize your document management today!

eml2pdf, Paperless, GoBD, Dokumentenmanagement, PDF Konvertierung, Effizienz, Digitalisierung, Open Source, Tech Tipps,


Donate Bild

Support / Donation Link for the Channel
If my posts have been helpful or supported you in any way, I’d truly appreciate your support 🙏

PayPal Link
Bank transfer, Bitcoin and Lightning


#eml2pdf #Paperless #GoBD #DocumentManagement #PDFConversion #Efficiency #DigitalTransformation #OpenSource #TechTips

Leave a Reply