Bug#610773: [moodle-packaging] Bug#610773: fixed patch

2011-01-29 Thread Hubert Chathi
Hello Mònica,

Thank you for the suggestion and the patch.

I don't think that it is is quite correct, though.  If $replyto is
specified, then the result will be that the mail will end up having two
addresses in the reply-to field: the from address, and the $replyto
address.  But the intended behaviour is that it should only contain the
$replyto address.  Also, you shouldn't be calling fullname($from) in the
first if branch (when $from is a string).

-- 
Hubert Chathi uho...@debian.org -- Jabber: hub...@uhoreg.ca
PGP/GnuPG key: 1024D/124B61FA http://www.uhoreg.ca/
Fingerprint: 96C5 012F 5F74 A5F7 1FF7  5291 AF29 C719 124B 61FA




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#610773: [moodle-packaging] Bug#610773: fixed patch

2011-01-29 Thread Mònica Ramírez Arceda
Hi,

You're right :-)

Maybe we could add an extra if in each branch? 
I attached the patch again with this idea (and with the fullname error
fixed).

Thanks for your work,
Mònica
--- moodlelib.php.ori	2010-08-24 21:25:20.0 +0200
+++ moodlelib.php	2011-01-29 18:42:49.0 +0100
@@ -4275,9 +4275,19 @@
 if (is_string($from)) { // So we can pass whatever we want if there is need
 $mail-From = $CFG-noreplyaddress;
 $mail-FromName = $from;
+// Set Reply-To header. Some mail servers override email address of From: header.
+// Setting Reply-To header we avoid that user replies to the overriden address
+if (empty($replyto)) {
+$mail-AddReplyTo($CFG-noreplyaddress, $from);
+}
 } else if ($usetrueaddress and $from-maildisplay) {
 $mail-From = stripslashes($from-email);
 $mail-FromName = fullname($from);
+// Set Reply-To header. Some mail servers override email address of From: header.
+// Setting Reply-To header we avoid that user replies to the overriden address 
+if (empty($replyto)) {
+$mail-AddReplyTo(stripslashes($from-email), fullname($from));
+}
 } else {
 $mail-From = $CFG-noreplyaddress;
 $mail-FromName = fullname($from);


signature.asc
Description: This is a digitally signed message part