There still seems to be a problem with specifying the From address. In the Admin settings the guidance for the From address includes

If left blank, the from address entered in the form will be used as the from address for the email. Enter a valid email address here to override that.

But the code in the module falls-back to site_mail if forward_sender_address is empty, line 789

  $from = variable_get('forward_sender_address', '');
  if (empty($from)) {
    $from = variable_get('site_mail', '');
  }

The code should use the email address from the form:

  $from = variable_get('forward_sender_address', '');
  if (empty($from)) {
    $from = $form_state['values']['email'];
  }

If an email address is specified for forward_sender_address then the From header will be a bit confusing. It will show the name entered on the form but with an unrelated email address, e.g.
John Smith <admin@mywebsite.com>
Perhaps in this case the From header should not include the name but only have the email address?

CommentFileSizeAuthor
#3 forward_766724.patch1.21 KBSofiaSund
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yang_yi_cn’s picture

any updates on this? I'm having the same problem

kerberos’s picture

Status: Active » Needs review

I can confirm that this solves the issue. Can this be incorporated into the module code by the module maintainer?

-Daniel
DealFever

SofiaSund’s picture

FileSize
1.21 KB

I had the same issue in forward-7.x-1.0-alpha3. This patch solved the issue for me.

It includes the change that duncanc suggested, and I also changed the #default_value in line 211 (which used to look like this: #default_value' => variable_get('forward_sender_address', variable_get('site_mail', '')),) where I removed the 'site_mail' fallback. The code now looks like this:

$form['forward_options']['forward_sender_address'] = array(
    '#type' => 'textfield',
    '#title' => t('From address'),
    '#default_value' => variable_get('forward_sender_address', ''),
    '#size' => 40,
    '#maxlength' => 40,
    '#description' => t('If left blank, the from address entered in the form will be used as the from address for the email.  Enter a valid email address here to override that.  The sender\'s email will still appear in the body of the message.'),
  );

I hope it'll apply to the 6.x version as well!

drupalmeister’s picture

Not sure if this will help you with 'forward' but I found a module called 'return path' that might help you out.

miked’s picture

Had the same issue, found the bad code and made the same change as duncanc, fixed the problem. I believe this error warrants some attention. Our site is an active regional daily news publication. People frequently forward stories from the site. In some cases, the 'from' address ends up in the recipients address book under the forwarder's name. Consequently, when the person's name is used from the address book on future emails, the email winds up being sent to our site email instead of the intended recipient.

Note: problem has not been addressed in the 6.x-1.21 or in the 7.x-2.0 beta versions.

john.oltman’s picture

Seems like a real problem, will take a look within the next few days

john.oltman’s picture

Took a look, open to making the change suggested, but I am thinking the field help should be changed to match what the code is doing, instead of the other way around. Rationale:

* No regression needed for existing install base
* Sending from a random email address that doesn't match the sending domain might cause delivery issues
* I believe delivery rates improve by including a from-name in the header, so removing it isn't something I'd prefer
* The reply-to headers are set correctly so if you reply to the email, you reply to the sender's address and not the site info address
* If you forward, the "from" info becomes irrelevant - not sure how this would end up in someone's address book

I can see the case where someone has a rule that adds each "from" address for a received email to the address book. Otherwise I am not sure how an entry is added to the address book on a forward. If you can explain this then that may help me understand the proper solution.

@miked, let me know your thoughts and we'll go from there.

john.oltman’s picture

Version: 6.x-1.16 » 7.x-2.x-dev
Issue summary: View changes
john.oltman’s picture

Version: 7.x-2.x-dev » 4.0.x-dev
Assigned: Unassigned » john.oltman
john.oltman’s picture

Status: Needs review » Active
john.oltman’s picture

Status: Active » Closed (outdated)

This was fixed in the Drupal 8/9 release.