Mail error 550 Maximum line length exceeded (RFC 5322 2.1.1)

3.7k Views Asked by At

I have a reseller hosting account containing a couple of domains. One of our clients has recently been complaining about emails not being sent. They are receiving the error "550 Maximum line length exceeded (RFC 5322 2.1.1)".

After some Googling it appears that the maximum length can only contain 998 characters (+ line breaks). And upon inspection of the .eml file of the email, I can find two lines each containing over 1000 characters. So indeed, this is where the problem resides.

However, I've tried contacting my hosting provider and try to determine where the problem is exactly located on an architectural level and how it can be prevented. But it seems they're completely clueless themselves (or don't want to admit it).

Our client having the issues, uses a very specific software (Bouwsoft) where they manage their emails and sent their emails from. Bouwsoft uses the IMAP settings of our reseller hosting email server in order to pull the mails and sent the emails. So everything goes via the reseller mail server.

So the main question boils down to: is it the responsibility of the mail server of our hosting provider to split the long lines in the email to not contain more than 1000 characters, or is this the responsibility of the software which sends the emails (Bouwsoft in this example) ?

1

There are 1 best solutions below

2
On BEST ANSWER

It is the responsibility of the sender of the email to stay within the RFC specified limits. Mail servers themselves can be lenient and happily accept things that exceed those limits, or they can be strict and reject this.

It is not the responsibility of the mail server to rewrite your email to be within the requirements of the various SMTP and mail-related RFCs. So, you - as the sender of the email - must ensure that your line lengths do not exceed the limit of 998 characters (and the recommend line-length is 76 characters!).

I guess that most commonly used SMTP libraries should be capable of doing this for your (though they usually require that there is at least some whitespace in such a long line before reaching 998 characters to have a point to break), but it is possible that you have to do the hard work yourself.