Package: moodle
Version: 1.9.9.dfsg2-2.1
Severity: minor
Tags: upstream patch

If you set Moodle up with smtp:gmail.com:465 as your SMTP host, you have a 
undesirable
behaviour well described in Moodle's wiki [0], see "Important warning".

You can avoid this adding the header "Reply-to" in Moodle mails, I attach a 
patch
with this change. This change won't affect other setups.

Warning: to test this you must do another code modification, also described in 
[0], but I'm
afraid this minor modification ($host = 'ssl://' . $host;) won't work for every 
setup
(for example, if you don't use SSL).

Thanks for your work :-)

[0] http://docs.moodle.org/en/Email_setup_gmail

-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (900, 'testing'), (850, 'stable'), (800, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages moodle depends on:
ii  adduser                3.112+nmu2        add and remove users and groups
ii  apache2-mpm-prefork [h 2.2.16-6          Apache HTTP Server - traditional n
ii  dbconfig-common        1.8.46            common framework for packaging dat
ii  debconf [debconf-2.0]  1.5.36            Debian configuration management sy
ii  libapache2-mod-php5    5.3.3-7           server-side, HTML-embedded scripti
ii  libdbd-mysql-perl      4.016-1           Perl5 database interface to the My
ii  libdbi-perl            1.612-1           Perl Database Interface (DBI)
ii  libjs-yui              2.8.2r1~squeeze-1 Yahoo User Interface Library
ii  libphp-magpierss       0.72-8            provides an XML-based RSS parser i
ii  libphp-pclzip          2.8.2-2           zip archive manager class for PHP
ii  mysql-client-5.1 [mysq 5.1.49-3          MySQL database client binaries
ii  php-fpdf               3:1.6.dfsg-1      PHP class to generate PDF files
ii  php5-cli               5.3.3-7           command-line interpreter for the p
ii  php5-curl              5.3.3-7           CURL module for php5
ii  php5-gd                5.3.3-7           GD module for php5
ii  php5-mysql             5.3.3-7           MySQL module for php5
ii  smarty                 2.6.26-0.2        Template engine for PHP
ii  ucf                    3.0025+nmu1       Update Configuration File: preserv
ii  unzip                  6.0-4             De-archiver for .zip files
ii  zip                    3.0-3             Archiver for .zip files

Versions of packages moodle recommends:
ii  aspell                        0.60.6-4   GNU Aspell spell-checker
ii  mimetex                       1.50-1.1   LaTeX math expressions to anti-ali
ii  mysql-server                  5.1.49-3   MySQL database server (metapackage
ii  mysql-server-5.1 [mysql-serve 5.1.49-3   MySQL database server binaries and
ii  php5-ldap                     5.3.3-7    LDAP module for php5
ii  php5-xmlrpc                   5.3.3-7    XML-RPC module for php5

Versions of packages moodle suggests:
pn  clamav                        <none>     (no description available)

-- debconf information excluded
--- lib/moodlelib.php.ori	2011-01-21 20:18:56.231342600 +0100
+++ lib/moodlelib.php	2011-01-21 21:30:37.606340009 +0100
@@ -4294,6 +4294,10 @@
 
     $mail->AddAddress(stripslashes($user->email), fullname($user) );
 
+    // 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
+    $mail->AddReplyTo(stripslashes($user->email), fullname($user) );
+
     $mail->WordWrap = $wordwrapwidth;                   // set word wrap
 
     if (!empty($from->customheaders)) {                 // Add custom headers

Reply via email to