GithubHelp home page GithubHelp logo

sergeyromanov / authentication_milter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastmail/authentication_milter

0.0 1.0 0.0 616 KB

Email Authentication by SPF/DKIM/DMARC etc.

License: Other

Perl 99.31% Shell 0.69%

authentication_milter's Introduction

Authentication Milter

A PERL implemtation of email authentication standards rolled up into a single easy to use milter.

This milter verifies using the following standards.

  • SPF
  • SenderID
  • DKIM (including ADSP)
  • DMARC
  • IPRev
  • Check HELO matches it's IP address

Includes 3 additional modules.

  • TLS (milter protocol only) - identifies TLS protected connections
  • AddID - add a header to all email (example)
  • ReturnOK - Checks that return addresses have properly configured MX records

Protocol

Authentication Milter is able to run as a sendmail style milter, or a SMTP style after queue filter.

A very basic subset of SMTP is implemented which allows use as an after queue filter in postfix (and others)

The XFORWARD SMTP extension is supported to allow the original connection details to be passed through to the milter.

The milter does NOT store it's current email on disk, all processing is done in memory. When running in SMTP mode the milter does not issue a 250 queued response until the destination MTA has also done so.

See Postfix After-Queue Content Filter

Note: When running in SMTP mode please do not allow untrusted clients to connect to the milter directly, always filter these connections through your usual MTA first.

Limitations: SMTP protocol does not yet support detection of Authenticated or Encrypted connections.

Design Decisions

  • Works as either a milter or a SMTP filter.
  • Do not reject mail during normal operation.
    • Add headers to allow filtering as required.
  • Try and handle failures gracefully.
  • Handle IPv4 and IPv6 properly
  • Detect Internal/Private IP addresses and skip IP checks.
  • Detect authenticated connections and skip irrelevant checks (milter mode only).
    • It is assumed that this milter runs after DKIM signatures are generated, these are still validated.
  • DMARC reporting should be possible.
  • Modular design to allow new checks to be implemented easily.

Mailing Lists and DMARC

Mailing lists are a major source of DKIM, SPF, and DMARC failures. Legitimately modifying messages and resending with differing from addresses and from IP addresses is a legitimate use of email, however this can be a cause of false positives and result in legitimate email being quarantined or rejected.

This milter can optionally detect messages with a List-Id header, and include a flag in the resulting DMARC failure in the Authentication-Results header. This header can then be used to apply a more lenient filter.

Trust Model

  • For Authenticated connections we only check the DKIM signature.
  • For Local IPs we only check the DKIM signature.
  • For Trusted IPs we only check the DKIM signature, additionally, for Trusted IPs we do not remove any Authentication headers already present.

Installation

To install this module, run the following commands:

  • perl Makefile.PL
  • make
  • make test
  • make install

The DMARC module requires a little extra setup.

  • A database needs to be created and populated
  • A config file /etc/mail-dmarc.ini needs to be created

Please see the documentation for Mail::DMARC for details.

Config

Please see the output of 'authentication_milter --help'

Credits and License

Copyright (c) 2015 Marc Bradshaw. [email protected]

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

See LICENSE file for license details.

Who is using this?

FastMail are using this to perform SPF/DKIM/DMARC checks on email.

Code Climate

master branch Build Status

Contributing

Please fork and send pull requests.

authentication_milter's People

Contributors

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