https://bugs.winehq.org/show_bug.cgi?id=56630
Bug ID: 56630 Summary: Broken links in email for "Test Results added to version ..." Product: WineHQ Apps Database Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: appdb-unknown Assignee: wine-bugs@winehq.org Reporter: 56ms2hl02@sneakemail.com Distribution: ---
In an E-Mail I got:
Test Results added to version GoG of Sid Meier's Alpha Centauri by axm ------------------------------------------------------- https://appdb.winehq.org/objectManager.php?sClass=3Dversion&iId=3D24358&... ;iTestingId=3D114903 This Test data has been submitted by axm.
... where the link is malformed due to the line break but I also could not fix it manually.
It should probably be: https://appdb.winehq.org/objectManager.php?sClass=version&iId=24358
Note this is the current version and it got autoapproved (probably because I am the maintainer, too).
Using this search
https://bugs.winehq.org/buglist.cgi?bug_status=__all__&content=link&...
I found a simimar, but very old and outdated bug report that maybe can be closed instead:
https://bugs.winehq.org/show_bug.cgi?id=25699
https://bugs.winehq.org/show_bug.cgi?id=56630
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #1 from Ken Sharp imwellcushtymelike@gmail.com --- Confirming. The links sent by the AppDB are basically garbage (you can correct them manually).
https://bugs.winehq.org/show_bug.cgi?id=56630
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |imwellcushtymelike@gmail.co | |m
https://bugs.winehq.org/show_bug.cgi?id=56630
Rosanne DiMesio dimesio@earthlink.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alois.schloegl@gmail.com
--- Comment #2 from Rosanne DiMesio dimesio@earthlink.net --- *** Bug 57479 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=56630
Rosanne DiMesio dimesio@earthlink.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Broken links in email for |Broken links in AppDB |"Test Results added to |emails |version ..." |
https://bugs.winehq.org/show_bug.cgi?id=56630
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov@gmail.com
--- Comment #3 from Damjan Jovanovic damjan.jov@gmail.com --- This is a highly annoying bug.
Basically, there is a garbage "3D" after every "=" sign in the URL's query parameters, which needs to be deleted for the link to work, ie. (broken):
https://appdb.winehq.org/objectManager.php?sClass=3Dversion&iId=3D24358&... ;iTestingId=3D114903
should be (working):
https://appdb.winehq.org/objectManager.php?sClass=version&iId=24358&... ;iTestingId=114903
That link is generated from include/testData.php:
function SendNotificationMail($sAction="add",$sMsg=null) { ... $sBacklink = $oVersion->objectMakeUrl()."&iTestingId=".$this->iTestingId."\n"; ... $sSubject = "Test Results added to version ".$oVersion->sName." of ".$oApp->sName." by ".$_SESSION['current']->sRealname; $sMsg .= $sBacklink;
... if($sEmail) mail_appdb($sEmail, $sSubject ,$sMsg); }
and then presumably in file include/mail.php:
function mail_appdb($sEmailList,$sSubject,$sMsg) { ... $sMsg = $mime->setTXTBody($sMsg); $sMsg = $mime->get(); ... $ret = $mail->send($to, $headers, $sMsg); ... }
https://bugs.winehq.org/show_bug.cgi?id=56630
--- Comment #4 from Damjan Jovanovic damjan.jov@gmail.com --- The bug can be replicated in this little command line app:
---snip--- require_once('Mail.php'); require_once('Mail/mime.php');
$mime = new Mail_mime(array( 'head_charset' => 'utf-8', "text_charset" => "utf-8", "html_charset" => "utf-8", "eol" => "\n" ));
$mime->setTXTBody("version=1"); fwrite(STDOUT, $mime->get()); ---snip---
Saving that to filename.php and running "php filename.php" prints out:
---snip--- version=3D1 ---snip---
This is due to quoted-printable encoding (https://en.wikipedia.org/wiki/Quoted-printable), because 0x3D is the ASCII hex code for the "=" sign, and also explains why the lines are 76 chars long.
But if so, then why isn't the email body decoded from its quoted-printable encoding?
https://bugs.winehq.org/show_bug.cgi?id=56630
--- Comment #5 from Damjan Jovanovic damjan.jov@gmail.com --- Indeed, looking through the raw email appdb sent me, there are no MIME type headers at all! Saving the raw email to a local email.eml file, and opening it in Thunderbird, also shows broken links.
Fiddling with its headers, I got Thunderbird to open it properly and display working links by adding these 2 headers. Both were necessary - Content-Transfer-Encoding alone did not help:
Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The Mail_Mime class provides these headers through its headers() method, but that isn't being called. Instead the code builds its own "$headers", without any of those headers. If we patch appdb to merge those headers with the headers from Mail_Mime, like this:
---snip--- diff --git a/include/mail.php b/include/mail.php index 75e30f7..38b54b0 100644 --- a/include/mail.php +++ b/include/mail.php @@ -82,7 +82,7 @@ function mail_appdb($sEmailList,$sSubject,$sMsg) $headers[$name] = $mime->encodeHeader($name, $value, "utf-8", "quoted-printable"); } $to = $mime->encodeHeader("to", $sEmailItem, "utf-8", "quoted-printable"); - $ret = $mail->send($to, $headers, $sMsg); + $ret = $mail->send($to, array_merge($headers, $mime->headers()), $sMsg); if (PEAR::isError($ret)) { // FIXME: need to log email errors somewhere ---snip---
then the bug should be fixed?
https://bugs.winehq.org/show_bug.cgi?id=56630
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=56630
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- GitLab Merge Request with this patch: https://gitlab.winehq.org/winehq/appdb/-/merge_requests/3
https://bugs.winehq.org/show_bug.cgi?id=56630
Jeremy Newman jnewman@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jnewman@codeweavers.com Status|NEW |NEEDINFO
--- Comment #7 from Jeremy Newman jnewman@codeweavers.com --- Merged. https://gitlab.winehq.org/winehq/appdb/-/commit/e7c9efe572c981b80660359437a8...
Can someone verify this is fixed and we will close this out.
https://bugs.winehq.org/show_bug.cgi?id=56630
--- Comment #8 from Ken Sharp imwellcushtymelike@gmail.com --- Created attachment 77929 --> https://bugs.winehq.org/attachment.cgi?id=77929 Example e-mail after fix
https://bugs.winehq.org/show_bug.cgi?id=56630
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEEDINFO |RESOLVED
--- Comment #9 from Ken Sharp imwellcushtymelike@gmail.com --- Looking good! Thanks for looking at this.
https://bugs.winehq.org/show_bug.cgi?id=56630
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Ken Sharp imwellcushtymelike@gmail.com --- Closing