If the site E-mail address is specified on the settings page as name@domain.com then all works very nicely.

Also it is possible to include an actual name in the settings page in the format "Joe Bloggs" and this works very nicely. (The bit in quotes is removed from the return-path header.)

However, if there is a space between the "< , or if the quotes are not used at all, then it all goes horribly wrong - either the welcome email does not arrive, or else the welcome email is sent from Joe Bloggs with email address name@domain.com but the return path in the message is set as Joe@servername.ispname.com or whatever, which is of course incorrect.

Can the returnpath module "do what is necessary" to make sure a valid name/email address get passed to sendmail?

NB I also had the install problem described in that issue http://drupal.org/node/140637, but am now using version 5.x-1.1 again as I had this error with that version:

warning: Invalid argument supplied for foreach() in /home//public_html/general51/sites//modules/returnpath/returnpath.module on line 28

CommentFileSizeAuthor
#4 returnpsth-sender-name.patch410 bytesmrfelton
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gpk’s picture

Oops that didn't get filtered quite as I wanted. 2nd para should read:

Also it is possible to include an actual name in the settings page in the format "Joe Bloggs"<name@domain.com> and this works very nicely...

mlncn’s picture

Category: bug » feature

I think this is a feature request rather than a bug report, as I'm not sure including a "Name" on the admin/settings/site-information form is supported/intended.

That said, we would like this also.

Is there any way to figure out if "Name" in the site information page is the way to go about this-- it seems not given that contact form e-mails, which have a name and an e-mail address field, do not work this way.

Anyhow if someone can figure this out we can code it and provide a patch.

benjamin, Agaric Design Collective

budda’s picture

I've added a check to prevent the warning: Invalid argument supplied for foreach() in /home//public_html/general51/sites//modules/returnpath/returnpath.module on line 28 error from occurring.

I've not got time to research the feature request but would be willing to take patches / code suggestions on this.

mrfelton’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
FileSize
410 bytes

Same issue in Drupal 6, although by default in Drupal 6 you can't set the site email address to include a sender name. However, it is possible to do this from a cusomt module, and if you do, it breaks returnpath.

Attach is a patch that ensures a proper email address is sent to -f

ps. In Drupal 6, I set the sender name for site emails in a custom module like so:

/**
* Implementation of hook_mail_alter().
* Here we allow the site name to be used as the senders name for outgoing email.
* see http://drupal.org/node/209672
*/
function mymodule_mail_alter(&$message){
  $default_from = variable_get('site_mail', ini_get('sendmail_from'));

  if($message['from'] == $default_from){
    $message['from'] = '"'. variable_get('site_name', 'Drupal') .'" <'. $default_from .'>';
    $message['headers']['From'] = $message['headers']['Sender'] = $message['headers']['Return-Path'] = $message['headers']['Errors-To'] = $message['headers']['Reply-To'] = $message['from'];
  }
}
Cyberwolf’s picture

Subscribing.

budda’s picture

Assigned: Unassigned » budda
Status: Active » Needs review

Patch applied in 6.x dev - can somebody give it a test on their setup?

apaderno’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I am closing this issue, as it has been created for a version that isn't supported anymore and the project doesn't have versions for any supported Drupal version (actually Drupal 7, Drupal 8, and Drupal 9).