? 680992.patch
? doug.patch
? mail.patch
? sites/default/files
? sites/default/private
? sites/default/settings.mysql.php
? sites/default/settings.php
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.43
diff -u -p -r1.43 contact.pages.inc
--- modules/contact/contact.pages.inc 24 Apr 2010 14:49:13 -0000 1.43
+++ modules/contact/contact.pages.inc 1 Jul 2010 12:29:47 -0000
@@ -144,7 +144,7 @@ function contact_site_form_submit($form,
$from = $values['sender']->mail;
// Send the e-mail to the recipients using the site default language.
- drupal_mail('contact', 'page_mail', $to, language_default(), $values, $from);
+ $message = drupal_mail('contact', 'page_mail', $to, language_default(), $values, $from);
// If the user requests it, send a copy using the current language.
if ($values['copy']) {
@@ -157,11 +157,14 @@ function contact_site_form_submit($form,
}
flood_register_event('contact', variable_get('contact_threshold_window', 3600));
- watchdog('mail', '%sender-name (@sender-from) sent an e-mail regarding %category.', array('%sender-name' => $values['name'], '@sender-from' => $from, '%category' => $values['category']['category']));
+
+ if ($message['result']) {
+ watchdog('mail', '%sender-name (@sender-from) sent an e-mail regarding %category.', array('%sender-name' => $values['name'], '@sender-from' => $from, '%category' => $values['category']['category']));
+ drupal_set_message(t('Your message has been sent.'));
+ }
// Jump to home page rather than back to contact page to avoid
// contradictory messages if flood control has been activated.
- drupal_set_message(t('Your message has been sent.'));
$form_state['redirect'] = '';
}
@@ -274,7 +277,7 @@ function contact_personal_form_submit($f
$from = $values['sender']->mail;
// Send the e-mail in the requested user language.
- drupal_mail('contact', 'user_mail', $to, user_preferred_language($values['recipient']), $values, $from);
+ $message = drupal_mail('contact', 'user_mail', $to, user_preferred_language($values['recipient']), $values, $from);
// Send a copy if requested, using current page language.
if ($values['copy']) {
@@ -282,9 +285,12 @@ function contact_personal_form_submit($f
}
flood_register_event('contact', variable_get('contact_threshold_window', 3600));
- watchdog('mail', '%sender-name (@sender-from) sent %recipient-name an e-mail.', array('%sender-name' => $values['name'], '@sender-from' => $from, '%recipient-name' => $values['recipient']->name));
+
+ if ($message['result']) {
+ watchdog('mail', '%sender-name (@sender-from) sent %recipient-name an e-mail.', array('%sender-name' => $values['name'], '@sender-from' => $from, '%recipient-name' => $values['recipient']->name));
+ drupal_set_message(t('Your message has been sent.'));
+ }
// Jump to the contacted user's profile page.
- drupal_set_message(t('Your message has been sent.'));
$form_state['redirect'] = user_access('access user profiles') ? 'user/' . $values['recipient']->uid : '';
}
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.944
diff -u -p -r1.944 system.module
--- modules/system/system.module 30 Jun 2010 15:51:51 -0000 1.944
+++ modules/system/system.module 1 Jul 2010 12:29:48 -0000
@@ -2985,7 +2985,8 @@ function system_send_email_action($entit
}
$params = array('context' => $context);
- if (drupal_mail('system', 'action_send_email', $recipient, $language, $params)) {
+ $message = drupal_mail('system', 'action_send_email', $recipient, $language, $params);
+ if ($message['result']) {
watchdog('action', 'Sent email to %recipient', array('%recipient' => $recipient));
}
else {
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1179
diff -u -p -r1.1179 user.module
--- modules/user/user.module 29 Jun 2010 18:24:10 -0000 1.1179
+++ modules/user/user.module 1 Jul 2010 12:29:48 -0000
@@ -3522,12 +3522,16 @@ function user_register_submit($form, &$f
// No administrator approval required.
elseif ($account->status || $notify) {
$op = $notify ? 'register_admin_created' : 'register_no_approval_required';
- _user_mail_notify($op, $account);
+ $mail_sent = _user_mail_notify($op, $account);
if ($notify) {
- drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user %name.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+ if ($mail_sent) {
+ drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user %name.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+ }
}
else {
- drupal_set_message(t('A welcome message with further instructions has been sent to your e-mail address.'));
+ if ($mail_sent) {
+ drupal_set_message(t('A welcome message with further instructions has been sent to your e-mail address.'));
+ }
$form_state['redirect'] = '';
}
}
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.73
diff -u -p -r1.73 user.pages.inc
--- modules/user/user.pages.inc 17 Jun 2010 13:44:45 -0000 1.73
+++ modules/user/user.pages.inc 1 Jul 2010 12:29:49 -0000
@@ -77,9 +77,10 @@ function user_pass_submit($form, &$form_
$account = $form_state['values']['account'];
// Mail one time login URL and instructions using current language.
- _user_mail_notify('password_reset', $account, $language);
- watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
- drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+ if (_user_mail_notify('password_reset', $account, $language)) {
+ watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+ drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+ }
$form_state['redirect'] = 'user';
return;
@@ -437,9 +438,10 @@ function user_cancel_confirm_form_submit
'user_cancel_notify' => $form_state['values']['user_cancel_notify'],
);
$account = user_save($account, $edit);
- _user_mail_notify('cancel_confirm', $account);
- drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.'));
- watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
+ if (_user_mail_notify('cancel_confirm', $account)) {
+ drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.'));
+ watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
+ }
$form_state['redirect'] = "user/$account->uid";
}