| Anonymous | Login | Signup for a new account | 21-11-09 09:02 GMT |
| Main | My View | View Issues | Change Log | Roadmap | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Print ] | ||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
| 0015164 | [phplist] Attachments | major | always | 31-07-08 11:05 | 23-03-09 16:48 | ||
| Reporter | wnicholls | View Status | public | ||||
| Assigned To | |||||||
| Priority | normal | Resolution | fixed | ||||
| Status | resolved | Product Version | 2.10.5 | ||||
| Summary | 0015164: Attachment data is double-wrapped in MIME-encoded message | ||||||
| Description |
Steps to reproduce. 1. Create a message 2. Add an attachment (eg a PDF file) 3. Send test message (or queue, doesn't matter) 4. View the message source as received. Observed: - message data snakes like this: Content-Type: application/pdf; name="test.pdf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.pdf" JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29k ZT4+CnN0cmVhbQp4nK29y68tS3fVKT8Ac42AMq4qqOJxqsU9jbMr4x3RRUJIFh3w7Rm3QB8C+ZZ E VYN/v2JGZsQcY6x9sTnr2Pp0T8zfzlyZIyNmvGP+ty/XR4hfLvv//Y//+OtP//e/b1/+8//3U/ jy 3+f//mz+77/O//2Xn64v/+ankGr5Mlr6GCF/+fWneF3pJP/qpz/fPDPPygvzorwyr4dfX/7zT //t p/6R7P/W8+K//+OvX/7VL/Pxx5cwPkb88svv5gXhy7cwWWj9o/YvIcaPUL788utPP//e11/+ 60+5 Note the first line is 76 chars with a blank line after it, second line is 75 chars, third is the 1 remaining, fourth line is 74 chars, then the remaining 2 etc. Inline images (eg the Powerphplogo.png) are encoded 76 chars per line (plus LF), only attachments get this weird behaviour. This may be the PHPList factor in the "microsoft exchange corrupt PDF" bug that many have alluded to. I found this while trying to diagnose that perhaps 5-10% of recipients of a mailout reported "there were no attachments to the message" (or words to that effect). There were FOUR... I'm still looking for pattern there, but MS Exchange is not a factor for most. One user has a Mac using Apple Mail. (also they report the attachments are missing, not that they are corrupt) |
||||||
| Additional Information |
I can think of one obvious cause for this: attachment data is being base-64-encoded and then fed through chunk_split() twice with a chunk size of 76. (Another thought I had is that the data is encoded with 76-char lines, then wordwrapped at 75, but that doesn't seem to be borne out). In lists/admin/class.phplistmailer.php is the following method function EncodeFile ($path, $encoding = "base64") { # as we already encoded the contents in $path, return $path return chunk_split($path, 76, $this->LE); } This looks dicey to me, if it is already encoded, why chunk_split again? However if I change this code to simply { return $path; } then attachments are correctly encoded, however inline images aren't wrapped at all. Alternatively further up in add_attachment, change the line: $this->attachment[$cur][0] = chunk_split(base64_encode($contents), 76, $this->LE); to $this->attachment[$cur][0] = base64_encode($contents); This seems to work, but I'm not confident enough that it is the true fix, especially since there is ANOTHER "class.phpmailer.php" in the phpmailer subdirectory. I'm leaving it on my server for now, but I'm keen on getting another opinion. Also the code in svn may have moved on - but 2.10.5 is the current stable release, and I'm running out of spare time to look into this issue. |
||||||
| Tags | No tags attached. | ||||||
| Attached Files | |||||||
|
|
|||||||
Relationships |
||||||
|
||||||
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |