When any correspondence from the server is sent via email to a user it comes from @..com (sent by @.com).

Note: some email clients word it as (on behalf of @.com).

I have gone into common.inc and formatted all the headers to match the requirements of my hosting company and everything worked fine exept FROM. I cannot force it to send from the site administration email address. Reply-To, Errors-To, etc.... all say what I want but the FROM will not change.

$default_from = "<email>@<hostname>.com";
  if ($default_from) {
    $defaults['Reply-To'] = $defaults['Sender'] = $defaults['Return-Path'] = $defaults['Errors-To'] = $default_from;
	$defaults['From'] = "From: <email>@<hostname>.com";
  }

This is wasting a lot of my time because i can't find any solution on drupal.org.

Comments

mcannell’s picture

The message got messed up.

When any correspondence from the server is sent via email to a user it comes from username@server.hostname.com (sent by email@webdomain.com).

Note: some email clients word it as (on behalf of email@webdomain.com).

mcannell’s picture

Isn't there anyone with any info on this? Can ANYONE help?

drumm’s picture

Status: Active » Postponed (maintainer needs more info)

Try making a simple PHP script that just calls mail(), http://us.php.net/manual/en/function.mail.php. This will show if it is a problem with Drupal or the hosting company. It is possible that the hosting company's mail server is overwriting the from address. In that case, you need to talk to the hosting company.

paulmckibben’s picture

My client experienced the same problem with Drupal 5.9. It turned out it was the hosting provider (Hostmonster) overwriting the "from" header. My client needed to add the e-mail address to his Hostmonster account, using the cpanel. Once he did that, Hostmonster recognized the "from" address as legitimate and no longer overwrote it.

mcannell’s picture

That seems so obvious now!
Here's the catch...

I am not hosting his email, he wants to host that somewhere else on an exchange server.

I went ahead and added the email address thinking that this MIGHT still work but it didn't. Is it because the email is hosted from another server?

I am using hostmonster too.

wasilij’s picture

well I suppose that if you changed in common.inc

$default_from = variable_get('site_mail', ini_get('sendmail_from'));

to

$default_from = variable_get(ini_get('sendmail_from')); 

everything would be ok :D

Pancho’s picture

mcannell:
Could you maybe provide us a test mail including the complete headers as received in the mailclient? That would be helpful. I'm working on #165938: Pass Return-Path via the mail -f parameter and #346545: Add a 'site_mail_internal' address variable, and this might be connected.

scor’s picture

mcannell’s picture

The issue is that the email was being hosted on a different server than the website. When I do the exact same settings as above on a different installation where email is hosted on same server, it works.

mcannell’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
wildmtsky’s picture

I have hostmonster also and I am encountering this same problem. Does this hack mentioned work?

$default_from = variable_get('site_mail', ini_get('sendmail_from'));

to

$default_from = variable_get(ini_get('sendmail_from'));

****FYI**** THIS DOES NOT WORK!!!!!

mparas’s picture

To solve the "on behalf of" problem, set a "Sender" value in the headers.

wildmtsky’s picture

Thank you but could you elaborate?

vaporizers’s picture

Status: Closed (fixed) » Needs review

After hours of googling and trying different things I finally have a solution.
It turns out that its probably not a problem with drupal at all but a problem with your exim configuration.
Try editing exim.conf (probably located at /etc/exim.conf).
Change "local_from_check" from true to false.
Then go ahead and send out a mail with drupal, and see if it works, it did for me.
The reason this works is because Exim will modify the "Sender:" header if your user account is not a "trusted" one.
(Please note: even if you're sending -f to the php mail() function, it will be ignored and the Sender: header will still be appended by exim so the return path module - http://drupal.org/project/returnpath will be little help in this regard ).
Another solution is to modify the trusted_users option in the exim configuration - and add the user that php runs as there.
Please confirm if this works for you or not.
Hope this helps!

wildmtsky’s picture

Interesting. I don't have anything like this file in my account. I am wondering if it is because we don't host our email on the same host as our website.

drumm’s picture

Status: Needs review » Closed (fixed)

Closing since this is not a Drupal issue. Drupal doesn't control email server configuration.

ianwesty’s picture

#12 - mparas.

Your suggestion worked for me - thanks!

$headers = array(
    'MIME-Version' => '1.0',
    'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
    'Content-Transfer-Encoding' => '8Bit',
    'X-Mailer' => 'Drupal',
    'Sender' => "email@address.com"
  );
SamuelRuiz24’s picture

Category: bug » feature
Status: Closed (fixed) » Closed (won't fix)

SamuelRuiz24
email addres ryamaha24@msn.com

SamuelRuiz24’s picture

Component: base system » mail system
Assigned: Unassigned » SamuelRuiz24

change email to
ryamaha24@msn.com
Thank you

SamuelRuiz24’s picture

Category: feature » bug
Priority: Critical » Major
Status: Closed (won't fix) » Postponed (maintainer needs more info)

want to chamge email to ryamaha24@msn.com

cweagans’s picture

Assigned: SamuelRuiz24 » Unassigned
Category: bug » feature
Priority: Major » Critical
Status: Postponed (maintainer needs more info) » Closed (won't fix)

Resetting issue metadata. SamuelRuiz24, if you need Drupal.org account support, please go open an issue in the webmaster queue where they can help: http://drupal.org/project/webmasters

dharmendra singh’s picture

I got the solution , install mimemail and go to settings of mime mail and add default from mail addresses, And it works great for me ,

dharmendra singh’s picture

Thnaks ....for your help and support.

Anonymous’s picture

Issue summary: View changes