Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
mcannell CreditAttribution: mcannell commentedThe 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).
Comment #2
mcannell CreditAttribution: mcannell commentedIsn't there anyone with any info on this? Can ANYONE help?
Comment #3
drummTry 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.
Comment #4
paulmckibbenMy 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.
Comment #5
mcannell CreditAttribution: mcannell commentedThat 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.
Comment #6
wasilij CreditAttribution: wasilij commentedwell I suppose that if you changed in common.inc
$default_from = variable_get('site_mail', ini_get('sendmail_from'));
to
everything would be ok :D
Comment #7
Panchomcannell:
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.
Comment #8
scor CreditAttribution: scor commentedsee also the related issue #131737: Ensure that the Return-Path is set when sending mail on both Windows and non-Windows systems.
Comment #9
mcannell CreditAttribution: mcannell commentedThe 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.
Comment #10
mcannell CreditAttribution: mcannell commentedComment #11
wildmtsky CreditAttribution: wildmtsky commentedI have hostmonster also and I am encountering this same problem. Does this hack mentioned work?
to
****FYI**** THIS DOES NOT WORK!!!!!
Comment #12
mparas CreditAttribution: mparas commentedTo solve the "on behalf of" problem, set a "Sender" value in the headers.
Comment #13
wildmtsky CreditAttribution: wildmtsky commentedThank you but could you elaborate?
Comment #14
vaporizers CreditAttribution: vaporizers commentedAfter 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!
Comment #15
wildmtsky CreditAttribution: wildmtsky commentedInteresting. 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.
Comment #16
drummClosing since this is not a Drupal issue. Drupal doesn't control email server configuration.
Comment #17
ianwesty CreditAttribution: ianwesty commented#12 - mparas.
Your suggestion worked for me - thanks!
Comment #18
SamuelRuiz24 CreditAttribution: SamuelRuiz24 commentedSamuelRuiz24
email addres ryamaha24@msn.com
Comment #19
SamuelRuiz24 CreditAttribution: SamuelRuiz24 commentedchange email to
ryamaha24@msn.com
Thank you
Comment #20
SamuelRuiz24 CreditAttribution: SamuelRuiz24 commentedwant to chamge email to ryamaha24@msn.com
Comment #21
cweagansResetting 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
Comment #22
dharmendra singh CreditAttribution: dharmendra singh commentedI got the solution , install mimemail and go to settings of mime mail and add default from mail addresses, And it works great for me ,
Comment #23
dharmendra singh CreditAttribution: dharmendra singh commentedThnaks ....for your help and support.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedwww.serverfault.com/questions/548826/exim-change-sender-address-when-sen...
This was the only thing I could get to work...