Git Product home page Git Product logo

haraka-plugin-bounce's Introduction

CI Test Status Code Climate

NPM

haraka-plugin-bounce

bounce

Provide options for bounce processing.

Configuration

Each feature can be enabled/disabled with a true/false toggle in the [check] section of config/bounce.ini:

Some features can have rejections disabled in the [reject] section.

[check]
reject_all=false
single_recipient=true
empty_return_path=true
bad_rcpt=true
bounce_spf=true
non_local_msgid=true

[reject]
single_recipient=true
empty_return_path=true
bounce_spf=false
non_local_msgid=false

Features

reject_all

When enabled, blocks all bounce messages using the simple rule of checking for MAIL FROM:<>.

It is generally a bad idea to block all bounces. This option can be useful for mail servers at domains with frequent spoofing and few or no human users.

single_recipient

Valid bounces have a single recipient. Assure that the message really is a bounce by enforcing bounces to be addressed to a single recipient.

This check is skipped for relays or hosts with a private IP, this is because Microsoft Exchange distribution lists will send messages to list members with a null return-path when the 'Do not send delivery reports' option is enabled (yes, really...).

empty_return_path

Valid bounces should have an empty return path. Test for the presence of the Return-Path header in bounces and disallow.

bad_rcpt

Disallow bounces to email addresses listed in config/bounce_bad_rcpt.

Include email addresses in that file that should never receive bounce messages. Examples of email addresses that should be listed are: autoresponders, [email protected], [email protected], and any other email addresses used solely for machine generated messages.

bounce_spf

Parses the message body and any MIME parts for Received: headers and strips out the IP addresses of each Received hop and then checks what the SPF result would have been if bounced message had been sent by that hop.

If no 'Pass' result is found, then this test will fail. If SPF returns 'None', 'TempError' or 'PermError' then the test will be skipped.

USAGE

Add bounce to Haraka's config/plugins file. If desired, install and customize a local bounce.ini.

cp node_modules/haraka-plugin-bounce/config/bounce.ini config/bounce.ini
$EDITOR config/bounce.ini

haraka-plugin-bounce's People

Contributors

msimerson avatar

Watchers

 avatar Steve Freegard avatar Matt Sergeant avatar

haraka-plugin-bounce's Issues

Bounce: non_local_msgid is broken

I was just looking at the bounce plugin as I had a new idea for a test and I noticed that non_local_msgid:

  • Is not documented
  • Doesn't handle multipart messages (e.g. it doesn't check body.children) for Message-ID headers.
  • Doesn't compare the Message-ID domain against rcpt_to.in_host_host OR the recipient domain against it to see if it is a local domain.
  • Never returns next() when a valid state is encountered, so it appears that it would always mark bounces as invalid.

Additionally - when I gave this a quick test using the plugin test mode; it blew up immediately because I didn't surround the Message-ID in <>'s:

DEBUG] [4B5A5B5B-C794-4711-AF9A-AB4DD387210E.1] [core] running data_post hook in bounce plugin
[INFO] [4B5A5B5B-C794-4711-AF9A-AB4DD387210E.1] [bounce] [ '\nMessage-ID: foo@foo\n' ]
[CRIT] [4B5A5B5B-C794-4711-AF9A-AB4DD387210E.1] [core] Plugin bounce failed: TypeError: Cannot read property '0' of null
    at Plugin.exports.non_local_msgid (/usr/lib/node_modules/Haraka/plugins/bounce.js:200:17)
    at Object.plugins.run_next_hook (/usr/lib/node_modules/Haraka/plugins.js:362:28)
    at callback (/usr/lib/node_modules/Haraka/plugins.js:337:21)
    at Plugin.exports.empty_return_path (/usr/lib/node_modules/Haraka/plugins/bounce.js:97:53)
    at Object.plugins.run_next_hook (/usr/lib/node_modules/Haraka/plugins.js:362:28)
    at Object.plugins.run_hooks (/usr/lib/node_modules/Haraka/plugins.js:250:13)
    at Connection.data_done (/usr/lib/node_modules/Haraka/connection.js:1453:13)
    at Connection.connection.data_respond (/usr/lib/node_modules/Haraka/bin/haraka:536:20)
    at callback (/usr/lib/node_modules/Haraka/plugins.js:333:39)
    at Plugin.exports.bad_rcpt (/usr/lib/node_modules/Haraka/plugins/bounce.js:136:53)

And when I did; the regexps pulled out the wrong values because:

domains.push(res[0].substring(1, (res[0].length -2))); is off-by-one. It would be better to use a regexp capture instead of the substring IMO anyway.

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.