fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
134 stars 62 forks source link

Text cannot be correctly decoded #216

Open chinenual opened 9 years ago

chinenual commented 9 years ago

Using commit 80f3ed550ad2c8eacb18a5bbb6b18d01e2e8a606

Mail is causing MIME parse problems:

21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->StatMessage('7ee13162','15961')
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->getImapIdFromFolderId('7ee13162') = SPOOL/myfolder
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->GetMessage('7ee13162', '15961', '1,2')
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->getImapIdFromFolderId('7ee13162') = SPOOL/myfolder
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->StatMessage('7ee13162','15961')
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->getImapIdFromFolderId('7ee13162') = SPOOL/myfolder
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] Mail_mimeDecode()::_autoconvert_encoding(): Text cannot be correctly decoded, using original text. This will be ok if the part is not text, otherwise expect encoding errors
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->GetMessage(): Message is multipart: 0, smime: 0, smime encrypted: 0
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->GetMessage(): getBodyPreferenceBestMatch: 2
21/07/2015 20:47:36 [ 9593] [DEBUG] [myuser] BackendIMAP->GetMessage(): after thinking a bit we will use: 2
...
21/07/2015 20:56:50 [ 9449] [DEBUG] [myuser] Folder type: Email
21/07/2015 20:56:50 [ 9449] [DEBUG] [myuser] LoopDetection->Detect(): case 3.3 detected - in loop mode, increase loop counter
21/07/2015 20:56:50 [ 9449] [DEBUG] [myuser] LoopDetection->Detect(): case 3.3.1 detected - broken item should be next, attempt to ignore it - id '15961'
21/07/2015 20:56:50 [ 9449] [DEBUG] [myuser] LoopDetection->Detect(): loop data: loopcount(4), maxCount(41), queued(38), ignored(15962)
21/07/2015 20:56:50 [ 9449] [ WARN] [myuser] Mobile loop detected! Messages sent to the mobile will be restricted to 2 items in order to identify the conflict

Snippet from the mail header:

...
Message-ID: <24986983.01437365500410.JavaMail.myuser@ricotta>
Subject: New SCRAPE results
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Date: Mon, 20 Jul 2015 00:11:40 -0400 (EDT)
X-Antivirus: avast! (VPS 150719-2, 07/19/2015), Inbound message
X-Antivirus-Status: Clean

<h2>Active</h2>
<a href=3D"index.html">Active</a>: 1074, <a href=3D"ignored.html">Ignored</=
a>: 5030, New: 7
<hr>
...

If this is not easily fixable, how can I find out what is wrong with the mail and causing parse problems? (it is machine-generated and I might be able to change the way it is produced to work-around the z-push bug).

Thanks!

fmbiete commented 9 years ago

Be careful when creating messages encoded as quoted-printable. It's easier to remove the "Content-Transfer-Encoding" header and using normal text. You already said the text is UTF-8, so every should show correctly.