-
Notifications
You must be signed in to change notification settings - Fork 17
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
Period at the beginning of line of encoded content #67
Comments
Oh your right. |
I'll do that, np. Just a couple of thoughts:
If it's OK this way, I'll submit the PR. There is a little issue with the line breaking in lines 45-67 as well, as »equals encoded« chars may be broken up. I'll try to look into that soon, too, and then give the period thingy another thought. |
Yes your right... In your PR could you fix also the "="? I would encode all . as this makes the code more readable etc. |
OK, will do that. By »fix also the "="« remove line 13? For the 45-67 thing I need more time, but it's not critical, as I believe it won't kill the connection. |
Yes remove the = line.. And I missed that for 45-67 I think I tested the splitting with the = encoding and even adding a line break is fine (as they are removed before parsing the rest) |
First of all: Many thanks for this great work, it helped me a lot!
Describe the bug
After encoding and line breaking it may occur that a line starts with a period. This may lead to problems with the SMTP server which may take the period as the »end of message« and treat the rest of the message as commands, resulting in a mess, of course :)
Content lines starting with a period are non-compliant with RFC5321 which says in section 4.5.2 that if the first character of the line is a period, one additional period has to be inserted at the beginning of the line.
To Reproduce
A message with a line consisting of 75 dots at the beginning will do the trick -- at least on my SMTP server.
Logs
Deno will yield a bad resource error when the SMTP server closes the connection.
Proposed solution
Check for lines starting with a period in
denomailer/config/mail/encoding.ts
and prepend a period if necessary. At line 46 add something likeThis is how I fixed it, although I am not sure if this breaks something else.
I can provide a PR if so desired.
The text was updated successfully, but these errors were encountered: