Per this article: http://www.pcworld.com/article/2141120/yahoo-email-antispoofing-policy-b...
We use the email submitted by the user in the webform as the "E-mail from address". However now that Yahoo has implemented the anti-spoofing policy described in the article, we're getting the following from accounts where Gmail is being used as a corporate email server:
Subject: Mail delivery failed: returning message to sender
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:name@domain.com
SMTP error from remote mail server after end of data:
host aspmx.l.google.com: 550-5.7.1 Unauthenticated email from yahoo.com is not accepted due to domain's
550-5.7.1 DMARC policy. Please contact administrator of yahoo.com domain if
550-5.7.1 this was a legitimate mail. Please visit
550-5.7.1 http://support.google.com/mail/answer/2451690 to learn about DMARC
550 5.7.1 initiative. nv5si1604550igb.42 - gsmtp
What would be worthwhile is to add a new set of fields in the "E-mail Header Details" section on the "Webform > E-mails" sub-tab for a reply-to address. Doing so would allow us to use the client's email address as the "from" address and the user's email address as the reply-to. This would provide a method for client staff to continue to easily reply to emails as they are delivered.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | webform-use_reply_to_instead_of-2236237-15.patch | 4.6 KB | danchadwick |
Comments
Comment #1
quicksketchI agree we need to update how Webform handles headers to better deal with spoofing measures taken by mail servers. They're quite right to enforce such policies, but right now Webform leaves the burden of setting up the correct FROM addresses to users, which is becoming increasingly complicated. Over at webform.com, we use hook_mail_alter() to modify all outgoing e-mails to send all e-mails from the @webform.com domain, but the reply-to header is the FROM address the user provided. I don't think that's necessarily a good solution for everyone however, as it depends on how you have e-mail configured.
For now, I think the best generic solution is to use https://drupal.org/project/webform_reply_to, which lets you manually specify a separate FROM and Reply-to header. Set FROM to be your site's domain (i.e. noreply@example.com) and Reply-to as the user's address.
Comment #2
sgdev commentedThanks for the clarification and quick reply. I did not realize there was a reply-to module... definitely will have to check that out.
Yes, it seems as though mail providers will be taking more serious measures to deal with spoofing in the coming years. I'm sure Yahoo is just the first of many. It does make it challenging for the Webform module to provide the required level of flexibility without over-complicating the solution for users. I'll be interested to see how the requirements set by e-mail providers evolve in the future.
Comment #3
jordanmagnuson commentedThis is becoming more and more common, and another reason that I think Allow setting Reply-To email header is a reasonable request.
Comment #4
quicksketchI re-closed #872382: Allow setting Reply-To email header so we can focus on this issue here.
I'd like to avoid requiring users to understand both FROM and REPLY-TO headers in order to set up a Webform that delivers e-mail. I don't think many users would know that the FROM address needs to be the same domain as the site itself.
I'd like to propose that we add a new site-wide setting that affects how Webform handles the From address. Something like this:
And then a second option, shown only if the first option is selected above:
Then when sending e-mails, we do a quick check comparing the current site's domain to the FROM address domain. If they match, we send the FROM header exactly as entered. If they don't match, we move the FROM header to REPLY-TO and replace FROM with the fallback address. This behavior would be the default, and users who wanted to send e-mails from any address regardless of the spam problem could use the second option to restore the old behavior.
This approach keeps us from adding any new fields to individual webforms, all webforms would start "working" immediately after the setting was added, and new installations would work out-of-the-box without any configuration.
How does that sound?
Comment #5
quicksketchUpdating the issue title to describe the situation a bit more.
Comment #6
tbroberg commentedquicksketch said,
That's exactly how I was thinking about handling this.
Do you feel like letting lazy programmer plagiarize your code here? A peek at how you handle the mail headers would probably save a few hours of experimentation.
Thanks,
- Tim.
Comment #7
quicksketchHaha, that's all I've ever wanted to do. ;) Here's the gist: https://gist.github.com/quicksketch/11124800
If this were to go into the Webform module itself, we could save some guessing by setting these headers directly. Though if we use the approach I described above, it would also add some kind of domain-matching test to allow FROM headers to pass through if possible.
Comment #8
waltercat commentedThe Webform Reply To module fixed this for me! I was completely baffled as to why we were not getting emails that were not Gmail. Glad I found this thread!
Comment #9
danchadwick commented@quicksketch -- Is this something we want to do in webform, or leave this as a site-wide issue for all e-mail? I am using something similar to your webform.com code for my domain. I suggest we either close this issue, or fix it right away, in 7.x-4.0 if possible.
Comment #10
quicksketchHmm, I hadn't considered a site-wide fix. I suppose we could make this some kind of stand-alone module that affected all outgoing e-mails and not just those from Webform. On the other hand, I can't think of any other e-mails in Drupal that allow the FROM address to be manually set, so for my situation, the ONLY place I'd need this to be fixed is in Webform. I imagine that's the case for most other sites out there as well; so I think it'd make sense to fix this in Webform.
I'd love to get this into Webform 4.x, but it doesn't need to be a release blocker for 4.0, since the behavior would have an option to make it backwards compatible (though most sites would want to use the new approach, considering Gmail, Yahoo, Hotmail, etc are probably marking their mails as spam right now).
Comment #11
philsward commented@quicksketch yeah, I'm thinking "something" needs to be done sooner than later... I did some digging and it appears that yahoo implemented the reject spf back around April. It wasn't until June or so that I started receiving bounce notices from Google Apps that the yahoo and aol emails were being rejected... Who knows how many email's were black hole'd and I never knew about them.
Thing is, it's a customer service issue and ultimately "bad for business". Really bad. The sender, with the yahoo email address, has no idea that entering their email address will cause their webform email to possibly go into a black hole. The customer simply thinks the company doesn't care enough about them to respond back, so they either call with the complaint of "I sent an email", OR even worse, they find a different company.
I get why the big email companies are doing it, but in the end it hurts the legitimate folks a lot more than it hurts the spammers...
Going to look at the separate module you referenced and cross my fingers it works for 4.x.
I agree that this issue shouldn't be a stable release blocker, but if yahoo and aol email's make up 15% of all email addresses (number I pulled from thin air) then we're missing out on 15% of potential sales, customer leads etc.
Update: Yes, Webform Reply To module does with with 4.x after applying update from comment #17
Comment #12
jerry commentedWebform Reply To 7.x-2.0 has now been posted with the aforementioned Webform 7.x-4.x compatibility patch included.
Comment #13
danchadwick commentedFor reference, the Print modules provides:
I would support a patch to roll Webform Reply To into webform core. @jerry -- Would would be interested in posting a patch??
Comment #14
danchadwick commentedThe function would simply place the From address into Reply-To address only when the From address isn't the site address.
Maybe something like this (swiped from one of my site's hook_mail_alter):
^^ Forgive the whitespace /line breaks above that are not Drupal coding standards. You get what I mean. :)
Comment #15
danchadwick commentedThe guts of this patch is:
Committed to 7.x-4.x. Need port to 8.x, which I didn't make due to config differences.
Comment #17
danchadwick commentedPatch needs porting to 8.x
Comment #18
darrellduane commentedNow that this is in place, is there any reason to need this module:
https://www.drupal.org/project/webform_reply_to
Can someone who knows these modules well advise if the Webform Reply To module can be deprecated once Webform 7.x-4.x-dev is used? Or is Webform Reply To providing some other functionality?
Comment #19
danchadwick commented@DarrelDuane -- From reading the recently-updated webform_reply_to project page, it would seem like that module is no longer needed if you are using webform 7.x-4.3 or later.
Comment #20
jkingsnorth commentedIt seems the module is no longer required (see linked issue).
But updating to the lastest release of webform actually disabled that module automatically... somehow? Unfortunately none of my reply-to settings have been carried across and this needs to be done manually it seems: #1462192: Integrate into the Webform core module
Comment #21
danchadwick commentedComment #23
fenstratCommitted and pushed to 8.x-4.x. Thanks!