I noticed that transactional emails from a Magento shop were often marked as spam. Apache SpamAssasin gives a 2.0
score from the BASE64_LENGTH_79_INF rule.
The rule explanation states:
According to http://en.wikipedia.org/wiki/Base64 , base 64 should only be 76 chars long, so these are out of format.
From the linked Wikipedia article:
MIME does not specify a fixed length for Base64-encoded lines, but it does specify a maximum line length of 76 characters. Additionally it specifies that any extra-alphabetic characters must be ignored by a compliant decoder, although most implementations use a CR/LF newline pair to delimit encoded lines.
So it looks like base64 encoded content is not broken into lines as expected. Did anybody encounter the same? What could cause this bad format?
Best Answer
In Zend Framework,
magento/lib/Zend/Mime.php
implements aconst LINELENGTH = 72;
but the constant is overwritten inapp/code/core/Zend/Mime.php
and set to 200. You can overwriteapp/code/core/Zend/Mime.php
using Magento's regular mechanisms and change the implementation of theencode
method, replacing self::LINELENGTH with a different constant:/Edit: initially I replaced self::LINELENGTH with Zend_Mime::LINELENGTH; this won't work because the autoloader will always load the Zend_Mime class from Magento core instead of the one from lib/Zend.