diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-04-24 19:49:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-04-24 19:49:01 +0000 |
commit | 91da5f05e4226cd65d11b1aed9ba37defa9f6672 (patch) | |
tree | 148e137da3c40cceaf06292b20fafafe79b81d76 | |
parent | 359ace36e6a56f815d1bf6e8e03eed5e11badab5 (diff) | |
download | brdo-91da5f05e4226cd65d11b1aed9ba37defa9f6672.tar.gz brdo-91da5f05e4226cd65d11b1aed9ba37defa9f6672.tar.bz2 |
- Patch #133789 by John Albin: Drupal-generated email can look like spam.
-rw-r--r-- | includes/common.inc | 11 | ||||
-rw-r--r-- | modules/system/system.module | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index d59e864a9..7ca504bc1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1969,8 +1969,15 @@ function drupal_mail($mailkey, $to, $subject, $body, $from = NULL, $headers = ar 'Content-Transfer-Encoding' => '8Bit', 'X-Mailer' => 'Drupal' ); - if (isset($from)) { - $defaults['From'] = $defaults['Reply-To'] = $defaults['Return-Path'] = $defaults['Errors-To'] = $from; + // To prevent e-mail from looking like spam, the addresses in the Sender and + // Return-Path headers should have a domain authorized to use the originating + // SMTP server. Errors-To is redundant, but shouldn't hurt. + $default_from = variable_get('site_mail', ini_get('sendmail_from')); + if ($default_from) { + $defaults['From'] = $defaults['Reply-To'] = $defaults['Sender'] = $defaults['Return-Path'] = $defaults['Errors-To'] = $default_from; + } + if ($from) { + $defaults['From'] = $defaults['Reply-To'] = $from } $headers = array_merge($defaults, $headers); diff --git a/modules/system/system.module b/modules/system/system.module index f9cc1b336..55282f3a8 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -574,7 +574,8 @@ function system_site_information_settings() { '#type' => 'textfield', '#title' => t('E-mail address'), '#default_value' => variable_get('site_mail', ini_get('sendmail_from')), - '#description' => t('A valid e-mail address for this website, used by the auto-mailer during registration, new password requests, notifications, etc.') + '#description' => t('A valid e-mail address to be used as the "From" address by the auto-mailer during registration, new password requests, notifications, etc. To lessen the likelihood of e-mail being marked as spam, this e-mail address should use the same domain as the website.'), + '#required' => TRUE, ); $form['site_slogan'] = array( '#type' => 'textfield', |