You are currently viewing eml2pdf Paperless compliant conversion tool

eml2pdf Paperless compliant conversion tool

Easily convert your eml files or emails into a single PDF file with eml2pdf, a paperless-compliant conversion tool 👍

Introduction to eml2pdf as a Conversion Tool

Welcome to our latest project: eml2pdf! This tool was specifically designed to convert EML files—including all attachments—into a single, user-friendly PDF document. eml2pdf is an essential tool for anyone looking to digitize their email correspondence efficiently. With a focus on GoBD compliance (Principles for the Proper Management and Retention of Books, Records, and Other Documents), it ensures that all metadata is preserved and the conversion is verifiable—perfect for businesses and individuals meeting legal requirements.

100% Integration with Paperless

A standout feature of eml2pdf is its seamless integration with Paperless, a popular solution for paperless document management. This 100% compatibility allows users to embed eml2pdf directly into their existing Paperless workflows. Whether it’s archiving emails or managing attachments, eml2pdf adapts perfectly, ensuring your documents remain uniform and accessible. The integration is designed to avoid disrupting daily operations while maximizing efficiency.

Performance Description

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

Video: eml2pdf Paperless compliant conversion tool

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

Setup and Configuration

Setting up eml2pdf is easy and only takes a few steps. First, Docker and Docker Compose must be installed.The image is already pre-built. Configuration is done via a config.json file and the docker-compose.yml, which we provide below.

Output of Required Configuration Files

Here are the configuration files needed to successfully deploy eml2pdf:

docker-compose.yml

  eml2pdf:
    image: paperless-eml2pdf
    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: Points to the pre-built image from 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 directory with log files.
    • ./config.json:/config.json: Provides the configuration file to the container.
  • environment: Sets environment variables.
    • TZ=Asia/Bangkok: Defines the time zone.
    • LOGLEVEL=INFO: Sets the log level.
  • restart: Automatically restarts the container unless manually stopped.

LOGLEVEL Einstellungen

  • LOGLEVEL in eml2pdf: Controls the logging level in the container.
  • Possible Values:
    • CRITICAL (50): Only critical errors.
    • ERROR (40): Errors impacting execution.
    • WARNING (30): Potential issues.
    • INFO (20, Default): General operational status.
    • DEBUG (10): Detailed troubleshooting.
    • NOTSET (0): Falls back to default.
  • Recommendation: INFO for normal operation, DEBUG for development.
  • Adjustment: Modify in docker-compose.yml under environment (e.g., 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
} 

Parameters:

  • separator_text: Text for attachment separators (e.g., Attachment 1: file.pdf).
  • poll_interval_seconds: Interval in seconds to check the input directory (300 = 5 minutes).
  • separator_page: Adds a separator page before attachments (on/off).
  • archive_retention_days: Retention period for archive files in days (30). Set to 0 to disable automatic deletion from the archive.
  • max_logfile_size: Maximum size of the log file in bytes (default: 1 MB = 1048576). If exceeded, the SizeRotatingFileHandler class rotates logs (log.txt becomes log.1, log.1 becomes log.2, etc., up to max_logfile_backups). Set to 0 to disable logging, and 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 to 0 to disable backup creation and associated deletion.

Adjust the config.json to your needs (e.g., time zone or interval). If you make changes, you can ignore the file in your .gitignoreto avoid uploading it unintentionally.

Summary of Log Management

eml2pdf uses a SizeRotatingFileHandler class to manage 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: Setting max_logfile_size to 0 disables logging entirely, and all existing log files are deleted! Set max_logfile_backups to 0 to prevent backup creation.

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.

Conclusion

With eml2pdf, you have a powerful tool at your disposal to efficiently convert EML files into PDFs and seamlessly integrate them with Paperless. GoBD compliance ensures legal security, while the easy setup and configuration simplify the process. Try it out and optimize your document management today!

Link to support / donation for the channel
PayPal Link
Bank transfer, Bitcoin and Lightning

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

Leave a Reply