Git Product home page Git Product logo

milter-archive's Introduction

milter Archive

This repository contains a simple Go application that functions as a sendmail milter that passively reads incoming e-mails and writes them into individual .eml files.

It's useful as a quick&dirty debugging solution for incoming messages or be used to retain training data for spam filters when messages would otherwise be redirected to external servers. For this usecase the -spam flag can be used to write e-mails into ham or spam directory based on the presence of an X-Spam header (most likely inserted by a previous milter, like rspamd).

A bunch of code is based on https://github.com/phalaaxx/pf-milters.

Usage

$ go get github.com/xrstf/milter-archive
$ ./milter-archive -spam -target /var/lib/archive
2019/05/04 21:01:28 Listening on tcp:127.0.0.1:47256 ...
2019/05/04 21:01:28 Accepting connections now.

After receiving a bunch of e-mails, /var/lib/archive might look like this:

$ ls -lah /var/lib/archive/spam
drwxr-xr-x 2 root root 4.0K May  4 18:58 .
drwx------ 3 root root 4.0K May  4 18:48 ..
-rw-r--r-- 1 root root 2.7K May  4 18:31 2019-05-04T183102.865Z-re-reliable-supplier-for-led-sign-and-display.eml
-rw-r--r-- 1 root root 4.1K May  4 18:35 2019-05-04T183557.810Z-re-iron-core-metal-crawler.eml
-rw-r--r-- 1 root root 2.6K May  4 18:37 2019-05-04T183715.052Z-re-watch.eml
-rw-r--r-- 1 root root 2.6K May  4 18:48 2019-05-04T184804.922Z-re-2019-newest-fashion-ladies-handbag.eml

License

MIT

milter-archive's People

Contributors

xrstf avatar

Stargazers

 avatar kenny avatar  avatar

Watchers

 avatar  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.