-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Update lib.go: Changing mailFromRE
regex
#406
Conversation
Thanks @ThomasLandauer. I definitely want to look at this, but I must put it temporarily on pause until I get my head clear. I have just had shoulder surgery 14h ago - so I'm pumped up on pain medication and not thinking clearly right now. I'll just note two thinks here while I think of it:
It would be great, if you are willing, to look into the second point above while I am recovering and share your thoughts? I'm not asking you to fix that other related bug, but consider whether your regex may break that, and maybe your thoughts on the optional additional syntax. Thanks! |
Also worth noting that |
First and foremost: All the best and take your time!! The thing is: The list of allowed SMTP keywords is long! There is What I wanted to address (i.e. forbid) is (note the
and (note the line break):
While still allowing (note the space after
|
Thank you, I appreciate it. I think As for those optional parameters, we definitely do not want to validate all of those, however there is currently one we're interested in. Please leave that part as-is and I'll handle it as a separate task 👍 |
I don't know how to rebase so I started from scratch ;-) 2 changes compared to what you said at axllent#406 (comment) * I did the same for `rcptToRE` * I replaced the `*` quantifier with `+`, for consistency
Closing here in favor of #409 |
* Update lib.go: Changing `mailFromRE` and `rcptToRE` regex I don't know how to rebase so I started from scratch ;-) 2 changes compared to what you said at #406 (comment) * I did the same for `rcptToRE` * I replaced the `*` quantifier with `+`, for consistency * Update lib.go * Allow valid empty MAIL FROM value --------- Co-authored-by: Ralph Slooten <[email protected]>
First change: Strictly speaking, there's no whitespace allowed: https://datatracker.ietf.org/doc/html/rfc5321#section-3.3
But I agree that it's OK to allow it, but I'd restrict it to horizontal whitespace.
Second change: The pattern is still too liberal, since not all characters are allowed in an email address. But what's really important is that you can't accept an
>
or vertical whitespace here.Third change: certainly no vertical whitespace allowed here.
If you agree, I'd do the same for the other regex'es