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

Bounce: non_local_msgid is broken #1

Closed
smfreegard opened this issue May 22, 2015 · 4 comments
Closed

Bounce: non_local_msgid is broken #1

smfreegard opened this issue May 22, 2015 · 4 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@smfreegard
Copy link

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.

@smfreegard smfreegard added bug Something isn't working documentation Improvements or additions to documentation labels May 22, 2015
baudehlo referenced this issue in haraka/Haraka Apr 30, 2016
baudehlo referenced this issue in haraka/Haraka May 2, 2016
Fix the regexp bug listed in #978
@KingNoosh
Copy link
Member

Is this now closed due to haraka/Haraka#1430?
If not, what needs to be done?

@msimerson
Copy link
Member

It's still open. It needs a mechanism within Haraka to ask, "is this domain name local?" Because "local" domains are typically defined in plugins, it's more than a trivial task. In my case, I have "local" domains defined in smtp_forward.ini and externally (via qmail-deliverable), so Haraka accepts mails for domains it knows nothing of. Hence, the stall.

For something like this to work reliably, we'd almost need a plugin like known-senders except as known-recipients and all it would do is listen on the rcpt_ok hooks and keep a redis DB populated with domains that we accept messages for. Or something like that...

@smfreegard
Copy link
Author

For something like this to work reliably, we'd almost need a plugin like known-senders except as known-recipients and all it would do is listen on the rcpt_ok hooks and keep a redis DB populated with domains that we accept messages for. Or something like that...

There are a couple of plugins, that if loaded (e.g. rcpt_to.in_host_list and relay) that could probably do this without a Redis DB as the domains are defined in their configuration. It would just have to skip anything else.

@msimerson msimerson transferred this issue from haraka/Haraka Apr 29, 2024
@msimerson
Copy link
Member

fixed by #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants