I've been using mailhandler to grab emails off of our exchange server (v5.5). For some reason, when the message gets added as a node, there are extra spaces added to random spots in the node title. The spaces appear to be showing up in random portions of the title. Usually it's just 1 extra (randomly placed) space, sometimes two. This happens whether retrieval is done via imap or pop. (I'm running 1.80.2.7 2006/08/08 of the mailhandler module, btw)
Comments
Comment #1
piersonr commentedUpon further research, it appears that this is a bug caused by our exchange server, I think.
The same extra spaces that appeared on mailhandler emails which were being pulled from an email account on our exchange server also appear when I send email from Outlook (MSOffice 2003, using an account on our exchange server) to my gmail account
When I send the same email from gmail to outlook the extra spaces don't appear, nor do they appear when emailing from one exchange account (using outlook) to another exchange account (which uses outlook).
Thinking that the problem could be new lines in the subject header, I tried converting \n and \r to alternative characters after
$subjectarr = imap_mime_header_decode($header->subject);but that didn't show the alternative characters. Oh well....How strange! In any case, I'm closing up this issue report. If anyone reading this knows why the extra spaces might be appearing please let me know!
Comment #2
piersonr commentedAccording to Microsoft, this is a bug in Exchange server 5.0 and 5.5.
$node->title = substr_replace($node->title, '', 65, 1);resolves this issue if added to a module that uses hook_mailhandler.Comment #3
piersonr commentedJust in case there are super duper long subject lines: