-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Error 501: Line too long #52
Comments
hey @falco467 thanks for pointing this out, im aware of this line limit, its just difficult to apply this limit in html emails because of html tags got broken randomly. i will leave this issue open and believe eventually it gets solved. |
Experienced this issue myself and since resurrected the MailComposer of nodemailer which gets this right: https://github.com/nodemailer/nodemailer/blob/master/lib/mail-composer/index.js |
This is not a problem at all. Soft-Linebreaks will be removed by the email-client before interpreting the HTML. From the RFC:
So the code to fix this can be very simple: Just insert a soft line break ("=\r\n") after every 997 characters (or 73 to be maximally compatible). |
If you look at the source code of news-letters in your inbox, you will find most of them have soft linebreaks all over the HTML, breaking tags and attributes without any problems. |
This one has caught us totally off guard. The same happens if you add an attachment which is base64 encoded. Any delivery to GMX (a large mail provider in Germany) will just reject everything with an attachment 😄 . The problem is real. Anyway -> Thanks for the great library -> I will work around it somehow. This is my workaround to preprocess my attachments data fields before sending it to MIMEText.
|
The RFC for Mails requires all lines in the Message to not be longer than 1000 characters (including CR+LF).
If I create a Message with this library, I would expect line-breaks to be added automatically to conform to the standard.
But the library does not add line-breaks to the message body and this emails are rejected by many mail servers with the error "501: line too long"
Example code:
This message will contain a single line with 2000 characters, breaking the spec.
The text was updated successfully, but these errors were encountered: