Index: simplenews.module
===================================================================
--- simplenews.module	(revision 10368)
+++ simplenews.module	(working copy)
@@ -1193,10 +1193,14 @@
   if (isset($tid)) {
     $mail->from_address = variable_get('simplenews_from_address_'. $tid, variable_get('simplenews_from_address', $address_default));
     $mail->from_name = variable_get('simplenews_from_name_'. $tid, variable_get('simplenews_from_name', $name_default));
+    $mail->reply_to = variable_get('simplenews_reply_to_address_'. $tid,  variable_get('simplenews_from_address_'. $term->tid, variable_get('simplenews_reply_to_address', $address_default)));
+    $mail->return_path = variable_get('simplenews_return_path_address_'. $tid, variable_get('simplenews_return_path_address', $address_default));
   }
   else {
     $mail->from_address = variable_get('simplenews_from_address', $address_default);
     $mail->from_name = variable_get('simplenews_from_name', $name_default);
+    $mail->reply_to = variable_get('simplenews_reply_to_address', $address_default);
+    $mail->return_path = variable_get('simplenews_return_path_address', $address_default);
   }
 }
 
@@ -1322,12 +1326,14 @@
 function simplenews_mail_send($mail) {
   $from_email = isset($mail->from_address) ? $mail->from_address : variable_get('site_mail', ini_get('sendmail_from'));
   $from = isset($mail->from_name) ? '"'. mime_header_encode(addslashes($mail->from_name)).'" <'. $from_email .'>' : $from_email;
+  $return_path = isset($mail->return_path) ? $mail->return_path : variable_get('site_mail', ini_get('sendmail_from'));
+  $reply_to = isset($mail->reply_to) ? $mail->reply_to : variable_get('site_mail', ini_get('sendmail_from'));
 
   $headers = array(
     'From' => $from,
-    'Reply-To' => $from_email,
+    'Reply-To' => $reply_to,
     'X-Mailer' => 'Drupal',
-    'Return-Path' => $from_email,
+    'Return-Path' => $return_path,
     'Errors-To' => $from_email,
   );
 
@@ -2264,6 +2270,20 @@
       '#required' => TRUE,
       '#default_value' => variable_get('simplenews_from_address_'. $term->tid, variable_get('simplenews_from_address', $address_default)),
     );
+    $form['simplenews_sender_information']['simplenews_return_path_address_'. $term->tid] = array('#type' => 'textfield',
+      '#title' => t('Return path e-mail address'),
+      '#size' => 60,
+      '#maxlength' => 128,
+      '#required' => TRUE,
+      '#default_value' => variable_get('simplenews_return_path_address_'. $term->tid, variable_get('simplenews_return_path_address', $address_default)),
+    );
+    $form['simplenews_sender_information']['simplenews_reply_to_address_'. $term->tid] = array('#type' => 'textfield',
+      '#title' => t('Reply to e-mail address'),
+      '#size' => 60,
+      '#maxlength' => 128,
+      '#required' => TRUE,
+      '#default_value' => variable_get('simplenews_reply_to_address_'. $term->tid, variable_get('simplenews_from_address_'. $term->tid, variable_get('simplenews_reply_to_address', $address_default))),
+    );
     $form['simplenews_hyperlinks'] = array('#type' => 'fieldset',
       '#title' => t('HTML to text conversion'),
       '#collapsible' => TRUE,
@@ -2323,25 +2343,40 @@
       '#return_value' => 1,
       '#default_value' => variable_get('simplenews_test_address_override', 0),
     );
-    $form['simplenews_sender_info'] = array('#type' => 'fieldset',
+    $form['simplenews_sender_information'] = array('#type' => 'fieldset',
       '#title' => t('Sender information'),
       '#collapsible' => TRUE,
       '#collapsed' => TRUE,
       '#description' => t('Default sender address that will only be used for confirmation e-mails. You can specify sender information for each newsletter separately on the newsletter\'s settings page.'),
     );
-    $form['simplenews_sender_info']['simplenews_from_name'] = array('#type' => 'textfield',
+    $form['simplenews_sender_information']['simplenews_from_name'] = array('#type' => 'textfield',
       '#title' => t('From name'),
       '#size' => 60,
       '#maxlength' => 128,
       '#default_value' => variable_get('simplenews_from_name', $name_default),
     );
-    $form['simplenews_sender_info']['simplenews_from_address'] = array('#type' => 'textfield',
+    $form['simplenews_sender_information']['simplenews_from_address'] = array('#type' => 'textfield',
       '#title' => t('From e-mail address'),
       '#size' => 60,
       '#maxlength' => 128,
       '#required' => TRUE,
       '#default_value' => variable_get('simplenews_from_address', $address_default),
     );
+    $form['simplenews_sender_information']['simplenews_return_path_address'] = array('#type' => 'textfield',
+      '#title' => t('Return path e-mail address'),
+      '#size' => 60,
+      '#maxlength' => 128,
+      '#required' => TRUE,
+      '#default_value' => variable_get('simplenews_return_path_address', $address_default),
+    );
+    $form['simplenews_sender_information']['simplenews_reply_to_address'] = array('#type' => 'textfield',
+      '#title' => t('Reply to e-mail address'),
+      '#size' => 60,
+      '#maxlength' => 128,
+      '#required' => TRUE,
+      '#default_value' => variable_get('simplenews_reply_to_address', $address_default),
+    );
+
     $form['simplenews_subscription'] = array(
       '#type' => 'fieldset',
       '#title' => t('Subscription options'),
@@ -2392,16 +2427,19 @@
  * Forms API callback; validates the settings form.
  */
 function simplenews_admin_settings_validate($form_id, $form_values, $form, $tid = NULL) {
-  $field_name = 'simplenews_from_address';
-
-  // If tid is set, we're validating specific newsletter settings so update field name.
-  if (isset($tid)) {
-    $field_name .= '_'. $tid;
-  }
-
-  if (!valid_email_address($form_values[$field_name])) {
-    form_set_error($field_name, t("The sender's e-mail address you supplied is not valid."));
-  }
+  $field_name_from = 'simplenews_from_address';
+  $field_name_return_path = 'simplenews_return_path_address';
+  $field_name_reply_to = 'simplenews_reply_to_address';
+   // If tid is set, we're validating specific newsletter settings so update field name.
+   if (isset($tid)) {
+    $field_name_from .= '_'. $tid;
+    $field_name_return_path .= '_'. $tid;
+    $field_name_reply_to .= '_'. $tid;
+ 
+  if (!valid_email_address($form_values[$field_name_from]) || !valid_email_address($form_values[$field_name_return_path]) || !valid_email_address($form_values[$field_name_reply_to])) {
+    form_set_error('simplenews_sender_information', t("One of the e-mail addresses you supplied is not valid."));
+    }
+ }
 }
 
 function simplenews_types_overview() {
@@ -2817,4 +2855,4 @@
 
   $mail->body .= $footer;
   return $mail;
-}
\ No newline at end of file
+}
