[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Custom DSN objects don't work well in queue and queue_outbound hooks #2998

Closed
gene-hightower opened this issue Nov 9, 2021 · 2 comments · Fixed by #3349
Closed

Custom DSN objects don't work well in queue and queue_outbound hooks #2998

gene-hightower opened this issue Nov 9, 2021 · 2 comments · Fixed by #3349
Labels

Comments

@gene-hightower
Copy link
Contributor
gene-hightower commented Nov 9, 2021

Describe the bug
There is code in queue_outbound_respond and queue_respond that assumes msg is a string, when passed a DSN object it ends up using returning "xxx [object Object] (uuid)" type strings.
When msg is an array I think you're going to have problems, too.

The errant bit of code code looks like this:
${msg} (${this.transaction.uuid})
Inside an interpolated string.

It's helpfully adding the uuid to the message string. Except if the msg is not a string but a DSN object.
This kind of error is much harder to make when using TypeScript.

Expected behavior
I expect the custom DSN objects using the haraka-dsn plugin should work the same for each hook.

Observed behavior
The message gets "[object Object]" in place of all that info in the DSN.

Steps To Reproduce
Create a plugin that uses hook_queue or hook_queue_outbound, call next(DENY, new DSN(...)); and observe the returned SMTP error message.

System Info:
This node 14 I think on Linux. The Haraka version is the head of the git repo.

Additional context
I think it would be enough to just check if typeof msg === 'string' or whatever before appending the uuid.

@gene-hightower
Copy link
Contributor Author

Maybe I just need the right toString() function that joins all the lines with an appropriate separator.

@baudehlo
Copy link
Collaborator
baudehlo commented Nov 9, 2021

Reopening until there's a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants