From: Bob B. Jr. <bl...@da...> - 2011-10-04 13:01:27
|
*Re-post - email to list was delayed and back-dated* Trying to send attachments using the mail modules send-email() function, and have run across a very interesting bug. Normal base64 encoders utilize fixed width output, but send-email() is producing variable width base64 with extraneous spaces after each newline. Some client-side decoders handle this fine, eg. Evolution on linux, attachments open fine. But the very same email (from the same IMAP server) viewed from Android/Profimail and/or Windows/Outlook, indicate that the attachment is corrupt, and cannot be opened. Below is a small snippet from the email source which shows the space on the second line (both lines truncated for brevity). --eXist.multipart.1.4.1 Content-Type: application/pdf; name="switchlist.pdf" Content-Transfer-Encoding: base64 Content-Description: switchlist.pdf Content-Disposition: attachment; filname="switchlist.pdf" JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PAovQ3JlYXRvciAoZVhpc3Qgd2l0aCBBcGFjaGUgRk9QKQovUHJvZHVjZXIgKGVYaXN0IHdpdG! QvGRwP5zYvRmZi ... I have tried both methods of sending (sendmail and SMTP), and have tried different MTAs (Postfix and Sendmail), but the result is always the same. -Bob |