Giter Site home page Giter Site logo

undelivered-message-processor's Introduction

undelivered-message-processor

A small script to process SMTP delivery reports

Description

This small script connects to an IMAP4 mailbox, and looks for the unread messages containing a DSN.

Delivery Status Notifications are MIME parts generated by SMTP server to indicate message delivery events.

See RFC 3664 for more details https://datatracker.ietf.org/doc/html/rfc3464

The program reads IMAP settings from a configuration file conforming to INI syntax.

The output is a CSV file.

The goal of the script is to synthetize into a simple single report the many returns received when mailing multiple adresses to process undelivered or delayed messages.

Limitation

Current version only manages DSN for a single recipient. RFC allows for multiple recipients to be addressed by a single DSN. This case is rare and not managed by current version of this script.

Usage

ump.py [-h] [-c CONFIG] [-o OUTPUT]

Optional arguments:

  • -h, --help show the help message and exit
  • -c CONFIG, --config CONFIG configuration file
  • -o OUTPUT, --output OUTPUT destination file

Configuration

[imap]
server=YourServerFQDN
port=YourServerPort
login=YourLoginHere
password=YourPasswordHere
folder=INBOX

Installation

  1. Checkout the project
  2. install dependencies (in a VirtualEnv preferably)
  3. customize the configuration file
  4. run

Dependencies

The following Python3 modules are required:

  • argparse
  • configparser
  • csv
  • datetime
  • email
  • imaplib2
  • logging
  • rich

Most of them should be pre-installed with your Python3 distribution.

undelivered-message-processor's People

Contributors

furaxfox avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.