Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

0005120: Wrong quoted-printable encoding on text/plain part of sending email #2617

Closed
Gloirin opened this issue Jun 9, 2018 · 28 comments
Closed
Assignees
Labels
Bug Felamimail Mantis Migrated from old Mantis bugtracker forge.tine20.org

Comments

@Gloirin
Copy link
Contributor

Gloirin commented Jun 9, 2018

Reported by afshin on 22 Nov 2011 10:14

Version: Maischa (2011-05-4)

This is part of an email message. As can be seen encoding of text/plain body is different from encoding of text/html body of message. decoding of body shows that the encoding of text/plain is wrong.

--=_cf57a1099ab54c27b9ebea25462c381b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

hello =C3=98=C2=B3=C3=99=C2=84=C3=98=C2=A7=C3=99=C2=85

--=20
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--=_cf57a1099ab54c27b9ebea25462c381b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8"><title></title><style type=3D"text/css">.felamimail-body-blockquo=
te {margin: 5px 10px 0 3px;padding-left: 10px;border-left: 2px solid #8=
8;} </style></head><body>hello =D8=B3=D9=84=D8=A7=D9=85<br><span id=3D"fela=
mimail-body-signature"><a href=3D"http://tine20.org&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;br />--=20
<br />This message has been scanned for viruses and
<br />dangerous content by
<a href=3D"http://www.mailscanner.info/&quot;&gt;&lt;b&gt;MailScanner&lt;/b&gt;&lt;/a>, and is
<br />believed to be clean.
</body></html>

--=_cf57a1099ab54c27b9ebea25462c381b--

Additional information: http://www.tine20.org/forum/viewtopic.php?f=8&amp;t=9898

@Gloirin Gloirin added this to the Maischa (2011-05-6) milestone Jun 9, 2018
@Gloirin Gloirin self-assigned this Jun 9, 2018
@Gloirin Gloirin added Bug Felamimail Mantis Migrated from old Mantis bugtracker forge.tine20.org labels Jun 9, 2018
@Gloirin Gloirin closed this as completed Jun 9, 2018
@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 9, 2018

Related to #2532

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 19 Dec 2011 12:51

i could not reproduce this error.

i got this email:

--=_3c92a79380340f26bdf630b56471be94
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=C3=98=C2=B3=C3=99?=C3=98=C2=A7=C3=99?=0A=0A--=0ASent with love from the=
new tine 2.0 email client ...=0APlease visit http://tine20.org

--=_3c92a79380340f26bdf630b56471be94
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; char=
set=3DUTF-8"><title></title><style type=3D"text/css">.felamimail-body-bl=
ockquote {margin: 5px 10px 0 3px;padding-left: 10px;border-left: 2px sol=
id #88;} </style></head><body><font face=3D"tahoma, arial, helvetica=
, sans-serif">=C3=98=C2=B3=C3=99?=C3=98=C2=A7=C3=99?</font><br><br><span=
id=3D"felamimail-body-signature" style=3D"font-family: tahoma, arial, h=
elvetica, sans-serif; font-size: 13px; ">--<br>Sent with love from the n=
ew tine 2.0 email client ...<br>Please visit <a href=3D"http://tine20.or=
g">http://tine20.org&lt;/a&gt;&lt;/span&gt;&lt;/body&gt;&lt;/html>

--=_3c92a79380340f26bdf630b56471be94--

--

did you see something unusual in the logfile?
which mailserver are you using?

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 06:44

-- did you see something unusual in the logfile?
No Everything seems to be clean.
-- which mailserver are you using?
MTA is postfix, IMAP Server is Courier
Would you give me an email address to mail directly to you?

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 20 Dec 2011 08:34

just sent you an email.

did you try it with the current service release 2011-05-5, too?

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 08:45

No I'm on 2011-05-4 !

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 20 Dec 2011 09:00

i think this might be related to #4950.

please update to 2011-05-5 and try again.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 10:12

Is there any update instructions ? specially on database schema, I've never updated tine20 !
thanks

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 10:19

Ok! I found it.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 20 Dec 2011 10:46

good. update from 2011-05-4 to -5 should be uncomplicated.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 11:16

Sorry, but the issue still there on (2011-05-5) !

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 20 Dec 2011 11:52

ok, then we have to switch to the serious debugging mode ... ;)
i can't reproduce the error on my system.

please turn on TRACE-debugging (loglevel 8) and send me the log of the sending of your test message. or attach the log to this bugreport, whatever you like more.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 20 Dec 2011 12:02

It's done.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 20 Dec 2011 13:32

thanks. but the log still needs more details.

please replace the file Felamimail/Controller/Message/Send.php with this one:
http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Controller/Message/Send.php;hb=c00c174619045de2f6b445dadf7ec39e341d0d11

and send the test message again + attach the logfile.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 21 Dec 2011 06:34

I've uploaded the new log.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 21 Dec 2011 09:44

ok, we are getting closer ...

please use this file (replace Felamimail/Model/Message.php) and show me the logs :)

-> http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Model/Message.php;hb=c5460d0bd3fe83cd2fb7cb496c7054f7dc58f9fb

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 21 Dec 2011 10:13

done!

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 21 Dec 2011 12:12

ok, looks like the problem is in the DOMDocument::loadHTML function. somehow it does not get the charset utf8 encoding correctly on your system.

which php version are you using? do you have anything unusual in your setup?

i committed another version of Felamimail/Model/Message.php with further improved logging, please try this one:
http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Model/Message.php;hb=10ec185c720383cc41e3f64f34ef0dd3345bec1f

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 21 Dec 2011 12:27

PHP 5.3.8 (cli) (built: Aug 29 2011 21:03:55)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

I installed it from webtatic repository on CentOS 5.6 x86_64

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 21 Dec 2011 14:35

i'm quite sure now that DOMDocument::loadHTML can't handle utf-8 strings with right-to-left mark. perhaps we found a php bug ... ;)

what would happen if we removed the right-to-left mark?

just reading (and trying to understand): http://www.unicode.org/reports/tr9/

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 21 Dec 2011 14:41

let's try it with removed marks:

http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Model/Message.php;hb=c1e2797bdf62a53656a6fb867f92c17960e73c71

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 21 Dec 2011 16:07

thank you for issue explanation, sorry but i'm not be able to apply the change till Saturday! I'll inform you as soon as possible. BEST

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 21 Dec 2011 16:39

no problem.

thanks for your quick feedback!

i'll be back on this issue in the next week.

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 24 Dec 2011 06:39

done (no change ) & Merry Christmas to you, your family and METAWAYS guys :)

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 25 Dec 2011 12:56

i added some more trace logging and try to remove some more utf-8 control chars: http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Model/Message.php;hb=fcc8058ff939f7bdaa92121395e519596efa22c2

merry christmas to you, too :)

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 26 Dec 2011 06:20

It's done .

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 27 Dec 2011 09:53

hi afshin,

now i tried a different approach ...
looks like there is a bug in libxml (see https://bugs.php.net/bug.php?id=32547). as a workaround i added a meta tag with the content type + encoding to the head of the html doc.

please try again with this one:
http://git.tine20.org/git?p=tine20;a=blob_plain;f=tine20/Felamimail/Model/Message.php;hb=e4addeaec380b4e3f05993adc1a4ff84a5a88e18

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by afshin on 27 Dec 2011 13:13

Good Job ! Finally ;)

@Gloirin
Copy link
Contributor Author

Gloirin commented Jun 10, 2018

Comment posted by pschuele on 27 Dec 2011 14:13

yeah!

finally it works :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Felamimail Mantis Migrated from old Mantis bugtracker forge.tine20.org
Projects
None yet
Development

No branches or pull requests

1 participant