-
Notifications
You must be signed in to change notification settings - Fork 3
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
ESMTP args truncated in RCPT TO stage #15
Comments
Hi @hxdmp thanks for poiting that out. I was under the impression that Postfix/Sendmail passes in all values as space seperated second string. Your proposed solution sounds good to me. One can use The MAIL ESMTP args need the same handling. |
Thanks for that very fast response! I'll implement that and open a pull request. |
I created #16 to fix this for both instances. Due to the implementation of |
fix #15: correctly parse esmtp args on MAIL and RCPT
I'm using this library to build a Milter server connected to a Postfix instance. Doing that, I noticed that the
esmtpArgs
parameter at theRCPT TO
stage is truncated. Precisely, only one substring after the first\0
byte is respected, althought there might be multiple ones. One example where this can happen is when the client requests a DSN (https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1). But other cases are possible, see: https://www.rfc-editor.org/rfc/rfc3461.html#section-10.1Let me explain this whole thing with an example to make it clearer.
RCPT TO
hook:RCPT TO
command to your mail server:Conclusion
This behavior is probably caused by the following code:
https://github.com/d--j/go-milter/blob/30d4d62396d57db43116e28f8bb5c5b61ecf2478/session.go#L224C1-L224C1
Maybe it's already sufficient to replace all occurrences of
0x00
after the email address with a space and pass that to the Milter interface implementation. As this is not a real C string, there should be no harm in doing so (we don't need a zero-terminator).I'm waiting for your feedback before starting to implement it.
The text was updated successfully, but these errors were encountered: