Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and added more tests #4

Merged
merged 21 commits into from
Feb 16, 2025
Merged
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ Some features can have rejections disabled in the [reject] section.

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

[reject]
single_recipient=true
empty_return_path=true
empty_return_path=false
bounce_spf=false
non_local_msgid=false
bad_rcpt=true
all_bounces=false
```

## Features

### reject_all
### all_bounces

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

Expand All @@ -50,16 +50,22 @@ Valid bounces should have an empty return path. Test for the presence of the Ret

### bad_rcpt

Disallow bounces to email addresses listed in `config/bounce_bad_rcpt`.
When enabled, rejects 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.
Include email addresses 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.

### non_local_msgid

Parses the message body and any MIME parts for Message-ID: headers and strips out the host name. If the host name is not a local domain, the bounce will be rejected.

This test needs to know which domains are 'local' to your mail server. If you use the rcpt_to.in_host_list plugin and have populated the `config/host_list` file, then you're done. Alternatively you can populate the `config/bounce_msgid_allowed_domains` with a list of local domains.

## USAGE

Add `bounce` to Haraka's config/plugins file. If desired, install and customize a local bounce.ini.
Expand All @@ -75,3 +81,5 @@ $EDITOR config/bounce.ini
[ci-url]: https://github.com/haraka/haraka-plugin-bounce/actions/workflows/ci.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-bounce/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-bounce
[npm-img]: https://nodei.co/npm/haraka-plugin-bounce.png
[npm-url]: https://www.npmjs.com/package/haraka-plugin-bounce
22 changes: 12 additions & 10 deletions config/bounce.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
; config/bounce_bad_rcpt: addresses that should never get bounces


[check]
single_recipient=true
empty_return_path=true
bad_rcpt=true

; reject all bounce messages (generally a bad idea)
reject_all=false

empty_return_path=false
bounce_spf=true
non_local_msgid=true

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

; reject bounces to email addresses listed in `config/bounce_bad_rcpt`.
bad_rcpt=true

; reject all bounce messages (generally a bad idea)
all_bounces=false
Loading