Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/phpmailer/README.txt,v
retrieving revision 1.10.2.1
diff -u -p -r1.10.2.1 README.txt
--- README.txt	17 Jan 2010 17:54:21 -0000	1.10.2.1
+++ README.txt	17 Jan 2010 17:55:34 -0000
@@ -82,11 +82,11 @@ Optional:
     Username:        your_google_mail_name@gmail.com
     Password:        your_google_mail_password
 
-  Note however, that Google automatically rewrites the "from" line of any e-mail
-  you send via their SMTP gateway to your Google Mail address.  Also note the
-  sending limits [1] for Google Mail accounts.
+  In Advanced SMTP settings:
+    Enable 'Always set "Reply-To" address' checkbox.
 
-  [1] http://mail.google.com/support/bin/answer.py?hl=en&answer=22839
+  Also note the sending limits for Google Mail accounts:
+  http://mail.google.com/support/bin/answer.py?hl=en&answer=22839
 
 * Debug settings
 
Index: phpmailer.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/phpmailer/phpmailer.admin.inc,v
retrieving revision 1.17.2.1
diff -u -p -r1.17.2.1 phpmailer.admin.inc
--- phpmailer.admin.inc	17 Jan 2010 17:54:21 -0000	1.17.2.1
+++ phpmailer.admin.inc	17 Jan 2010 17:57:34 -0000
@@ -119,6 +119,12 @@ function phpmailer_settings_form() {
     '#default_value' => variable_get('smtp_fromname', ''),
     '#description' => t('Enter a name that should appear as the sender for all messages.  If left blank the site name will be used instead: %sitename.', array('%sitename' => variable_get('site_name', 'Drupal'))),
   );
+  $form['advanced']['smtp_always_replyto'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Always set "Reply-To" address'),
+    '#default_value' => variable_get('smtp_always_replyto', 0),
+    '#description' => t('Enables setting the "Reply-To" address to the original sender of the message, if unset.  This is required when using Google Mail, which would otherwise overwrite the original sender.'),
+  );
   $form['advanced']['smtp_keepalive'] = array(
     '#type' => 'checkbox',
     '#title' => t('Keep connection alive'),
Index: includes/phpmailer.drupal.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/phpmailer/includes/phpmailer.drupal.inc,v
retrieving revision 1.11.2.1
diff -u -p -r1.11.2.1 phpmailer.drupal.inc
--- includes/phpmailer.drupal.inc	14 Dec 2009 18:34:56 -0000	1.11.2.1
+++ includes/phpmailer.drupal.inc	17 Jan 2010 16:49:38 -0000
@@ -24,10 +24,10 @@ function phpmailer_send($message) {
 
   try {
     // Parse 'From' e-mail address.
-    $address = phpmailer_parse_address($message['from']);
-    $mail->From = $address[0]['mail'];
-    if ($address[0]['name'] != '') {
-      $mail->FromName = $address[0]['name'];
+    $from = reset(phpmailer_parse_address($message['from']));
+    $mail->From = $from['mail'];
+    if ($from['name'] != '') {
+      $mail->FromName = $from['name'];
     }
     unset($message['headers']['From']);
 
@@ -61,6 +61,11 @@ function phpmailer_send($message) {
       }
       unset($message['headers']['Reply-To']);
     }
+    elseif (variable_get('smtp_always_replyto', FALSE)) {
+      // If no Reply-To header has been explicitly set, use the From address to
+      // be able to respond to e-mails sent via Google Mail.
+      $mail->AddReplyTo($from['mail'], $from['name']);
+    }
 
     // Extract Content-Type and charset.
     if (isset($message['headers']['Content-Type'])) {
Index: includes/phpmailer.mimemail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/phpmailer/includes/phpmailer.mimemail.inc,v
retrieving revision 1.8.2.2
diff -u -p -r1.8.2.2 phpmailer.mimemail.inc
--- includes/phpmailer.mimemail.inc	17 Jan 2010 17:54:22 -0000	1.8.2.2
+++ includes/phpmailer.mimemail.inc	17 Jan 2010 17:56:17 -0000
@@ -29,11 +29,11 @@ function mimemail_phpmailer_send($messag
     // Display names are usually not required. Leave header intact.
 
     // Parse 'From' e-mail address.
-    $address = phpmailer_parse_address($message['sender']);
-    if ($address[0]['name'] != '') {
-      $mail->FromName = $address[0]['name'];
+    $from = reset(phpmailer_parse_address($message['sender']));
+    $mail->From = $from['mail'];
+    if ($from['name'] != '') {
+      $mail->FromName = $from['name'];
     }
-    $mail->From = $address[0]['mail'];
 
     if (variable_get('phpmailer_debug_email', '') === '') {
       // Set recipients.
@@ -65,6 +65,12 @@ function mimemail_phpmailer_send($messag
       $message['headers']['To'] = $message['address'];
     }
 
+    // If no Reply-To header has been explicitly set, use the From address to be
+    // able to respond to e-mails sent via Google Mail.
+    if (!isset($message['headers']['Reply-To']) && variable_get('smtp_always_replyto', FALSE)) {
+      $message['headers']['Reply-To'] = $from['mail'];
+    }
+
     $message['headers']['Subject'] = $message['subject'];
 
     // FIXME SpamAssassin says INVALID_MSGID to PHPMailer's generated Message-ID. 06/04/2009 smk
