Page MenuHomePhabricator

Subject of email-notifications must be quoted-printable.
Closed, ResolvedPublic

Description

Author: stas-fomin

Description:
In email notifications now (1.4b6-1.5-CVS) "Subject" is not quoted-printable, only
pagetitle is quoted:
See UserMailer.php, function composeCommonMailtext:

$subject = str_replace( '$PAGETITLE_QP', wfQuotedPrintable( str_replace
( '_', ' ', $pagetitle ) ), $subject);

But if we localize (translate) user-mailer messages, then Subject may be unreadable in
some email clients (for example Lotus Notes).
So we propose not to quote pagetitle,
+ $subject = str_replace('$PAGETITLE_QP', str_replace( '_', ' ', $pagetitle),
$subject);

but quote "Subject" itself

	$this->replyto	= $replyto;
  • $this->subject = $subject;

+ $this->subject = wfQuotedPrintable($subject);

	$this->body	= $body;

Version: 1.5.x
Severity: normal
Platform: PC

Details

Reference
bz1746

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 8:17 PM
bzimport added a project: MediaWiki-General.
bzimport set Reference to bz1746.

stas-fomin wrote:

small patch, to quote "Subject" of notification, not Pagetitle.

This is patch for 1.4b6 version of UserMailer.php, to quote "Subject" of
notification, not Pagetitle.

attachment UserMailer.php.diff ignored as obsolete

(In reply to comment #1)

Created an attachment (id=381) [edit]
small patch, to quote "Subject" of notification, not Pagetitle.
This is patch for 1.4b6 version of UserMailer.php, to quote "Subject" of
notification, not Pagetitle.

This need to be checked carefully.
I will keep care of your observation and patch.

By the way, e-mail notification is only in CVS HEAD (1.5), isn't it ? I did not
back-port it from there to 1.4.x versions.

Tom

  • for ENotif and EAuthent

ENoitf: http://bugzilla.wikipedia.org/show_bug.cgi?id=454 and
EAuthent: http://bugzilla.wikipedia.org/show_bug.cgi?id=866

(In reply to comment #2)

This is patch for 1.4b6 version of UserMailer.php, to quote "Subject" of...

This needs to be checked carefully.

I forgot to add: Lotus Notes - I have made extremely bad experiences with this
touchy piece of software. Sometimes it appears not to be fully compliant to RFC
internet standards, but I am not sure. However, I noticed a strange behaviour
with the From: field, too.

So please let us change $subject and $from very very carefully: please no quick
changes, before new patches have been checked to be without side-effects. I
fully admit, that a thorough analysis of my whole string handling is still
needed, but any mail client must be checked.

Tom

  • for ENotif and EAuthent

ENoitf: http://bugzilla.wikipedia.org/show_bug.cgi?id=454 and
EAuthent: http://bugzilla.wikipedia.org/show_bug.cgi?id=866

This patch is for ENotif; ENotif is only in CVS HEAD (= 1.5).
(I still did not check it fully)

Created attachment 386
complete patch for this bug

Patch.
Please take note, that I slightly changed two strings in the messagetext
(template) Mediawiki:email_notification_subject in file Language.php :
$PAGETITLE_QP and $PAGEEDITOR_QP do not exist any longer. run /maintenance/php
rebuildMessages.php or change the two variabes by hand, please.

attachment patch.diff ignored as obsolete

Created attachment 387
Patch to reenable ENotifs when watching user visits watched page with changes

Patch

attachment cvs.diff ignored as obsolete

Created attachment 388
patch (some diff lines which were not relevant to this bug have been removed)

patch

Attached:

Created attachment 389
UserMailer.php -- complete module

Attached:

brion added a comment.Mar 26 2005, 2:20 AM

Applied patch (had to shove some bits manually due to unknown problem)