Using Drupal core's Contact module, the messages I receive through it always have my website's e-mail address as the "from" field. While it really should be the e-mail address of the person who sent me the message.
This seems similar to http://drupal.org/node/200415, but I don't think it's the same thing.
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | smtp.replyto.patch | 826 bytes | franz |
| #41 | smtp.replyto.patch | 826 bytes | franz |
| #40 | smtp.replyto.patch | 826 bytes | franz |
| #39 | smtp.replyto.patch | 826 bytes | franz |
| #38 | smtp.replyto.patch | 826 bytes | franz |
Comments
Comment #1
clivesj commentedI have the same thing.
Although this report deals with Dr4.x the problem i'm having is the same.
It worked good before until some 4 weeks ago. The problems began when I:
I will try to de-patch module.smtp and see what happens.
Also have a look at:
http://www.drupal.org/node/135320
http://www.drupal.org/node/133789
Comment #2
oadaeh commentedAre you both sure you're using the latest version of this module? I've tested this every way I can think of, and I always get the e-mail address that is in the field labeled "Your e-mail address". Would you please re-download and re-install the module (and make sure there isn't another copy lying around somewhere) and see if it is still doing it.
Maybe more details of your configuration might help.
I do see that the from name is always the site name, unless specified on the settings page to be something different. Based on the way the e-mail is sent in the module, I don't think I can change that.
Edit: also, including a list of steps you went through to produce this behavior would be very helpful to me.
Comment #3
wim leersYes I was/am using the latest version of this module. I only installed the module once and can assure you no other version is lying around. When I find the time, I'll collect more details.
Comment #4
clivesj commentednamens = 'on behalf of' in Dutch.
With these options set:
With these options set:
So the from_email on the contact_form will only show-up when you actually open to view the email. It will be shown after the websites name or the name entered in de SMTP config.
When you fwd this mail -e.g. to a person to attend the mail, the from_email will disappear, whilst a few months ago it would show-up in the body of the email being forwarded.
If you need more info or if there are diff things i have to check, let me know.
Comment #5
clivesj commentedI have traced to behaviour-change to the change made in common.inc in D5.2.
Since I went from 5.1 to 5.3 directly this change remained unnoticed to me until then.
So this patch doesn't work well for me.
I switched back to 5.1 common.inc and now the mail behaviour is like I want.
Maybe Wim could confirm these finding. If confirmed, we can close this issue and file a new one under core.
Comment #6
wim leersWhen I find the time, I'll do some Drupal debugging to find the exact cause.
Sidenote:
Actually the behavior is correct: the e-mail is being sent from my site, so my site's e-mail address should be used. However, the reply-to should contain the e-mail address of the person who contacted me.
But Drupal 5 (nor 6) allows us to set the "reply-to" separately from the "from". Hence we should continue to use the "from".
Comment #7
mr.j commentedSame problem. Subscribing
Comment #8
open-keywords commentedYou may give a try to this one http://drupal.org/node/224601
Comment #9
wim leersThe patch you posted there is working! Marking this issue as a duplicate of yours.
Comment #10
wim leersUgh, I'm not sure how blind I was, but it's *not* working.
Comment #11
wim leersThe modifications to get the reply-to field filled in properly turned out to be super easy… You were assigning a variable to
$mail->AddReplyTo, while that actually was a function! Additionally, I added a check to see if the Reply-To header matches the Return-Path header, and if so, don't add a Reply-To address.Patch attached.
Comment #12
oadaeh commented@Wim Leers, are you saying that the patch in comment #11 fixes the problem you originally reported?
@clivesj, does the patch fix your probelm as well?
Comment #13
wim leers@oadaeh: yes, it fixes the original problem.
However, the original problem states that the sender of the contact message should be in the "From" header. That's incorrect, as many e-mail services don't allow the "From" header to be different from the actual sender, including Gmail. So the correct solution is to set the reply-to address. You were already doing this, but you had done so incorrectly (stupid minor bug).
Comment #14
open-keywords commented@Wim Leers,
thanks for finding sorting this out.
But I don't understand what you're trying to do by comparing to the value of Return-Path.
It would be interesting to test the value of From, but Return-Path is :
--------------
quote from http://www.ietf.org/rfc/rfc2821.txt :
The primary purpose of the Return-path is to designate the address to
which messages indicating non-delivery or other mail system failures
are to be sent. For this to be unambiguous, exactly one return path
SHOULD be present when the message is delivered. Systems using RFC
822 syntax with non-SMTP transports SHOULD designate an unambiguous
address, associated with the transport envelope, to which error
reports (e.g., non-delivery messages) should be sent.
--------------
Replies are set to the From, unless there is a Reply-To header with a different value.
What do you think ?
Comment #15
wim leersHm, perhaps something else than Return-Path should be used. But it's definitely useful to compare.
This is a dump of the arguments drupal_mail_wrapper() receives:
As you can see, the From value equals the Reply-To value. Which makes sense.
However, the From value that you can see here, is *not* respected by the SMTP module. It will override it with the e-mail address of the SMTP account that is used to send e-mail. And that's perfectly fine.
So that's why I'm comparing with Return-Path. Maybe comparing with Sender is better?
Comment #16
open-keywords commentedWim,
In my opinion, I would leave PHP Mailer classes decide on the business logic, and then on such precedence or comparisons, since it has (should have) the experience and knowledge of proper SMTP usages and policies.
However, where the STMP module should be perfect, is in its integration of PHP Mailer. The integration shouldn't loose any header value, shouldn't feed the From value as the recipient, etc...
This requires a little review of the PHP Mailer classes to understand their assumptions, and proper algorithmic of the SMTP module.
You pointed out a bug in the integration (API usage), Great ! Don't fix it with a superfluous and inappropriate business logic !
Comment #17
wim leersFirst of all: it's just a minor thing: it's just to avoid a superfluous header. This could even be considered information overhead, thus an annoyance for the recipient.
Next, I completely understand and respect your point of view. Note however, that this is *above* the level of PHP Mailer: it's in smtp.module's code.
Comment #18
clivesj commentedWim's patch in #11 works OK.
Will it be incorporated in the module?
Comment #19
wim leersSince we won't see another tester, marking this RTBC to get attention from the developer. Thanks for the review, clivesj.
Comment #20
oadaeh commentedApplied here: http://drupal.org/cvs?commit=104807
Comment #21
wim leersYay! Thanks :)
Comment #22
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #23
Chad_Dupuis commentedI'm not sure this is fixed, although the patch certainly helps. It appears to be a problem with the interpretation of various mail clients - most particularly gmail.
I have been using the smtp module and google apps for my email on a number of domains for quite some time with no issues - however, I use an imap client instead of reading it online. When you read the mails via the web client (i.e. gmail) you get the wrong reply to address when you click reply.
This is what you see in the headers:
Gmail picks up the section in within
<>on the from field and replys to that even though the from and the reply-to addresses are both correct. If you read the same message in a reasonable mail client (i.e. thunderbird, evolution, etc.) it does the right thing.So I'm not sure whether the smtp module should leave out the section in
<>on the from field or if this is just a problem with gmail that should be reported??Comment #24
Chad_Dupuis commentedUpon further investigation this appears to be a known "bug" with gmail. Basically if you are sending outbound with the same address you are reading with, gmail ignores the from and reply-to fields and just uses the sent as address. If you go outbound with a different account say "outbound@yourdomain.com" and read it with "webmaster@yourdomain.com" it respects the fields.
Not sure the smtp module can do anything about this.... so I'll leave it open in case you have any ideas, but feel free to close it if there is nothing that can be done. Just wanted to save some folks some time if possible....
Comment #25
moklett commented@Chad_Dupuis: Do you have any references to this "known bug" behavior of Gmail? I haven't been able to find any other mentions of it (and if there are other potential workarounds)
Comment #26
Chad_Dupuis commentedThere are numerous discussions of it within google groups and other places (google "gmail ignores reply-to header"), I also verified it myself. I do, however, use google apps instead of regular gmail, but I think I tried that as well. The best workaround would probably be to use a separate account for outbound mail from the site. That way it will always respect the fields.
Comment #27
CMangrum commentedEDIT: I'm leaving the original comment below since it was still an issue as of this morning. However, during my troubleshooting I disabled and re-enabled the SMTP module from within the module's settings area and it now appears to be working correctly again. Perhaps the module needed to be kicked in the head following my drupal update (6.7-6.8). The headers are correct as follows:
from No Reply
reply-to test@test.com
to contact@site.info
date Thu, Dec 25, 2008 at 2:41 PM
subject [Contact site] contact
mailing list contact.site.info
---
I believe this is also an issue in D6.8. I have SMTP Authentication Support v. 6.x-1.0-beta3 installed and sometime in the last month the behavior changed. I use Gmail but the user in the SMTP server settings is different from the recipient address. Now I'm stuck trying to figure out whether the issue is with Gmail, the SMTP module, D6.8 (since I just upgraded from a previous release), or some combination of those. Since it appears to stem from the reply-to address being wrong (see below), I would guess that it has something to do with the D6.8 contact module's interaction with the SMTP module.
Prior to the middle of November, email sent from the sitewide contact form would have a headers like this (the reply-to is correctly filled in with the contact form value):
from No Reply
reply-to user@hotmail.com
to contact@site.info
date Sat, Nov 15, 2008 at 2:37 PM
subject [Contact Site]
Now I see the following (notice that the reply-to is now the same as the from field):
from No Reply
reply-to do-not-reply@site.info
to contact@site.info
date Thu, Dec 25, 2008 at 11:02 AM
subject [Contact Site]
mailing list contact.site.info
My SMTP settings have the account info filled for using Gmail, a blank "From address", and a populated "From name".
Comment #28
wwwoliondorcom commentedHi,
My websites are sending emails to users (comment notifications, etc...).
Some users might have changed their email or closed the email address used to register.
How to know when my websites are sending emails to addresses that do not exist anymore and how to know about errors when sending emails through my websites ? (delivery failure messages?)
Knowing which mails do not work anymore i could update my users list and avoid sending emails that return errors and bounce back again in the future.
Thanks for help.
Comment #29
wwwoliondorcom commentedAny help ?
Thank you.
Comment #30
clivesj commentedoliondor,
I think your question is "off-topic".
But anyway: The delivery failure messages should automatically go to your reply-to address.
In my setup this is no-reply@domain.com.
Be aware that you will get a lot of failure messages since also delayed deliveries will be sent to you.
In my case no-reply is a VALID address (it excists) however it is routed to // (Which is the trash-bin)
So I don't see the failure mails.
Things may also depent on your mailserver (serverside) setup.
Good luck
Comment #31
wwwoliondorcom commentedThank you, but i have never set any reply to address ?! Are you speaking about your email address at the Site information ?
And I never got any bouncing email since 2 years that i am using Drupal, so i guess there is something wrong ?
Thanks again.
Comment #32
clivesj commentedYes it will use the email entered on the Site Information Page.
BUT, if you have SMTP module installed the value entered on that page (email from) will superseed the value entered on site info.
In my set-up the SMTP-page-email is left blank, so it uses the other one.
You can have a look a look in your cache table, the value van the variable "site_mail" is the one being used.
Regards
Comment #33
ferrangil commentedSorry to revamp this issue, but it looks something is happening with the reply-to header.
It was working fine, using the contact form, and one could just reply and the email was sent to the user entered email (in the form), not to the original email.
Please see the screenshots attached. some_time_ago.png was a sample old email I get and I could reply just by clicking reply. Note the Reply-To header is on place (and working).
The screenshot today_emails.png is what I get now. Clicking Reply (both in thunderbird and also on gmail, etc..) results in an email sent to the original "system" email, not to the user who used the contact form.
Its a big problem as I'm getting replys between users to the website email!! They doesn't know they need to manual specify the email or the reply is not going to be received by the user who firstly contacted them...
Any help will be appreciated! Thanks
Comment #34
wim leersSame problem here … something broke this!
Comment #35
ferrangil commentedIt might be related with Google Apps? Are you using them, Wim? Maybe they remove the reply-to header, to fight spam or some other reason...
If anyone have more info, please explain!
Comment #36
Chad_Dupuis commentedI believe I've fixed this in the contact module both 5.x and 6.x -- (this has nothing to do with the SMTP module as far as I can tell). See - http://drupal.org/node/366238
And just to save you some time, you'll need a similar fix for the forward module if you happen to use that - http://drupal.org/node/366926
Let me know if that helps you.
Comment #37
ferrangil commentedThanks; also using the Forward module in fact, so thanks again.
Comment #38
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
This patch fix of that on the 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Since it sets the header
Comment #39
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
This patch fix of that on the 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Since it sets the header
Comment #40
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
This patch fix of that on the 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Since it sets the header
Comment #41
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
This patch fix of that on the 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Since it sets the header
Comment #42
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
This patch fix of that on the 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Comment #43
franzping
Comment #44
franzFirst of all, it seems quite clear that the gmail SMTP overwrites the from address only to match the account used to login, if you're using SMTP module to send the mail trough smtp.gmail.com.
I fixed 6.x-dev using the code from #36's link. It also tries to be smart and not overwrite mail that other modules might have send with a proper reply-to address. I tested this with the Contact form, and it's working nicely. =)
http://drupalcode.org/viewvc/drupal/contributions/modules/smtp/smtp.modu...
Someone could work on a similar patch for the 5.x-dev, if it still applies.
Comment #45
wundo commented