If you’ve followed our tips to prevent your email going into spam folders but you’re still having issues, your email formatting may be to blame.
In order to determine which emails are accepted by recipient servers, mailbox providers follow RFC protocol on email formatting and content. In the last number of years, in order to crack down on spam, providers have become stricter in their email screening. On one hand, it does help with spam control but, on the other, legitimate senders are being penalised for slight errors in their email formatting. In order to compensate for this, instead of just rejecting an email that is poorly formatted, mailbox providers have tried to automatically fix the formatting issues. By fixing any of these issues, the mailbox provider is violating the DKIM signature, which can lead to further receipt issues as the email is no longer properly authenticated.
These are some factors to take into consideration when planning your email formatting:
Line Length Limits
According to the RFC Internet Message Format memo (RFC5322 Section 2.1.1), a line of characters in your email MUST not exceed 998 characters, but SHOULD not be more than 78 characters (excluding the CRLF / line break). If your emails do contain more than these limitations, you will receive bounces and error codes such as:
- 550 Maximum line length exceeded
- 550 Message is not RFC5322 2.1.1 compliant
- 550 Line too long
If you are receiving any of the following error codes, it is likely that a line of your email has not been finished with a CRLF or Carriage Return Line Feed:
- 451 See http://pobox.com/~djb/docs/smtplf.html
- 451 stray newline detected. See http://cr.yp.to/docs/smtplf.html
- 550 5.6.0 Lone CR or LF in headers (see RFC2822 section 2.3)
Header Fields
Although email headers can seem rather overwhelming and confusing, the only compulsory lines in the headers are the Date and Message-ID. Emails sent without these fields will commonly generate the following error codes:
- 554 Message is not RFC compliant; missing “Date” header
- 550 Senders clock is broken – fix and resend
- 550 Missing Date Header, Message headers not compliant with RFC.
- 550 Date header far in the past/future
Even if the email does get accepted by the recipient provider, anti-spam systems (such as SpamAssassin) may reject the email based on the same criteria.
Email Address Size Limits
It is also worth noting that there is a limit of 64 characters in the local part of an email address (the part before the @ symbol), and a maximum of 255 characters in the domain part (RFC2821). There is also a restriction on the length of an address in MAIL and RCPT commands of 254 characters. Since addresses that do not fit in those fields are not normally useful, the upper limit on address lengths should normally be considered to be 254. If you attempt to send to an email address (or more commonly, a reply-to email address with a Message-ID in the local portion) whose length exceeds this, you may encounter the following errors:
- 501 Syntax error in parameters or arguments.
- 501 Invalid Address
- 501 Syntax error invalid forward path
- 501 local part too long near {address}
- 501 Syntax error – Badly formatted address
Non-Specific RFC-Based Bounces
If you receive an error code that doesn’t specify the reason why your email bounced, please don’t hesitate to get in touch with us for further information.
Some examples:
- 554 Message is not RFC compliant
- 550-5.7.1 Our system has detected that this message is not RFC 2822 compliant. To reduce the amount of spam sent to Gmail, this message has been blocked. Please review RFC 2822 specifications for more information.
- 550 5.7.0 Message could not be delivered. Please ensure the message is RFC 5322 compliant.
- 550 5.7.1 This message does not comply with required standards.