yeah Minification. sorry I didn't catch that difference. In all my time I've never seen this done for emails. Any thoughts?
In an environment with no other restrictions, you can put an entire HTML page (in UTF-8) all on one line, since line breaks are largely insignificant* in HTML and HTTP isn’t a line-based protocol. Such is the case with a web page: everything’s safe between a browser and a webserver and removing line breaks saves a lot of bytes.
However, SMTP is not such an environment because it applies additional restrictions.
First is that a standard SMTP DATA line** can’t be more than 998 characters (and is usually broken at 76 chars for ultra-legacy reasons). Some servers are nevertheless forgiving about this. Other servers are rightly strict, because allowing overlong lines just encourages senders to think they’re okay everywhere.
Second is that SMTP involves not just different mailserver vendors across recipients, but may mean multiple server “hops” for a single recipient. Those hops can have varying feature levels. One hop might not be 8-bit clean, so data may need to be translated between 8-bit and 7-bit, and so on. The more translations need to be done, the more likely data will be corrupted (especially if it was originally standards-invalid).
Taken together, the conclusion is the data that’s put on the wire over SMTP will have line breaks.
But note: that doesn’t mean you can’t remove line breaks from HTML first, and then break the one-liner result into 76-byte or 998-byte lines — that’s how you optimize the number of breaks while still being standards-valid. So you can have an editor window in which you don’t use any line breaks, but when the text is fed into the SMTP layer, it gets encoded and line-broken properly.
If you’re observing that the actual text sent using SMTP DATA has lines that are 10,000 bytes long, that’s wrong and a mail scanner that looks for anomalies would be right to pick up on that. I spent a long time in the spamfighting world and one thing we look for is a message that seems produced by an amateur mail app (i.e. spambot) because it doesn’t obey standards. This might be surprising because you’d think a spamware author would be able to read and implement standards properly... but in practice, many are not (shall we say) full stack developers even if they’re good hackers!
* either ignored or equivalent to a single space, except for in a <pre>
** i.e. not a BINARYMIME section, which isn’t line-based, but you can’t rely on support for BINARYMIME