Skip to content

Suggestions for canSendBounce method #432

@titanism

Description

@titanism

Hi there @andris9 and @louis-lau 👋

Just sharing some suggestions for the function here:

https://github.com/zone-eu/zone-mta/blob/49cc03a6dba473f4e6e585ca6f0b2b956a0fa77f/lib/bounces.js#L109C16-L109C29

  1. Test for postmaster@ in addition to mailer-daemon@ (if postmaster shouldn't bounce) for both MAIL FROM and From header. You may also want to test against no reply addresses. We maintain a list at https://github.com/forwardemail/reserved-email-addresses-list. We also check for a MAIL FROM and From header that ends with +donotreply and -donotreply (e.g. Google Groups). We also test against root, cron, etc.
  2. If Auto-Submitted is anything other than =no, then don't bounce. Right now you only test for auto-replied and auto-generated.
  3. If X-Auto-Response-Suppress is (case insensitive) dr, autoreply, auto-reply, auto_reply, or all then don't bounce. Right now you only check for all.
  4. You only check Content-Type for multipart/report right now, but you might want to specifically check against report-type of delivery-status or delivery-notification for accuracy.
  5. If it contains X-MDDSN-Message and From or MAIL FROM is mdaemon then it probably shouldn't bounce (Microsoft DSN header)
  6. If every part of the message had type of message or text AND every subtype was either rfc822-headers or rfc822 (e.g. https://github.com/stalwartlabs/mail-server/blob/4f02e4c96f9dc01f37f077bf2597e5a943bb1f02/resources/config/spamfilter/scripts/bounce.sieve)
  7. If there is a Precedence header with a value that is autoreply, auto-reply, auto_reply (case insensitive) then don't send a bounce. Note that bulk and list values are excluded from this check, as similar to how we don't check for list-id nor list-unsubscribe (and neither do you currently in canSendBounce).

Making this changes will help to decrease the amount of misdirected bounces and backscatter spam in your projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions