Using Drupal 7 on CentOS 6 with stock Postfix 2.6.6 and since recently any mails sent by Drupal on behalf of users with @yahoo.com mail addresses are bounced hard:

Diagnostic-Code: smtp; 550 5.7.1 Message rejected due to DMARC policy for

And also:

Message not accepted for policy reasons.  See
    http://postmaster.yahoo.com/errors/postmaster-28.html (in reply to end of
    DATA command)

I think this is result of Yahoo changing its mail policy, so that all other big mail providers participating in DMARC (like Gmail or Mail.ru or ...) only accept @yahoo.com senders from Yahoo mail servers (and thus not from my little Drupal website).

enter image description here

Has anyone affected by this change found a good workaround on the Drupal site for this problem?


My Postfix installation works well and is not the problem.

The problem with Yahoo users should be solved in Drupal hook for sending contact and registration mails. I think (from reading Yahoo docs) the "From" header there should be replaced by "Reply-To" or something similar.

Note: My question affects Drupal and has to be solved with Drupal means (which is why IMO it belongs in this SE-site).

  • Not really sure there s anything on the Drupal side for this. I am pretty sure this is all in the MTA's court (Postfix in your case). I can migrate to ServerFault if you want, but I would check for a dup there, first.
    – mpdonadio
    Jun 24, 2014 at 23:04
  • You can use drupal.org/project/smtp and send emails to yahoo clients via your yahoo email account.
    – Nikit
    Jun 24, 2014 at 23:47
  • @Nikit I reopened this if you want to write up a good answer about how the SMTP module can solve this problem.
    – mpdonadio
    Jun 25, 2014 at 0:24
  • 1
    drupal.org/project/phpmailer - In Advanced SMTP settings: Enable 'Always set "Reply-To" address' checkbox.
    – Nikit
    Jun 25, 2014 at 8:53
  • 1
    Well, you can create custom module for api.drupal.org/api/drupal/modules%21system%21system.api.php/… and put there Reply-To
    – Nikit
    Jun 25, 2014 at 9:32

3 Answers 3


You are correct in your update that:

  1. This is a Drupal problem, in that the script must change how it sends emails.
  2. What Drupal uses in the "from" field should actually be in the "reply-to" field.
  3. This can be fixed using a hook. (Specifically, hook_mail_alter().)

If you don't want to write any code, I suggest you use the Contact Reply To module by rfay.

Alternatively, I wrote a more general-use module that I described here.

I use my solution on all of my sites and have not had any trouble yet.

Some of the other suggestions are incorrect, in that hook_mail() does not catch every email, and therefore is not appropriate, and you cannot use some of the other smtp solutions, because the "from" email address is not consistent (ie., it is provided by site visitors).


You should never send email on behalf of an @yahoo.com email address. Yahoo has made this crystal clear.

You should always send from a domain you have permission to send from.

To send mail on behalf of an @yahoo.com email address you will need to use your own domain in the "from" field, and use the @yahoo address in the 'reply-to' field.

In my experience, attempting to send from an @yahoo.com email address without having your message originate from an @yahoo.com mail server will ensure your message will be blocked.


This doesn't work with Yahoo emails, but for all other emails one solution on Drupal 7 is to go to: admin/config/content/webform

And tick:

Use Reply-To header Sends all e-mail from the domain of the default address above and sets the "Reply-To" header to the actual sender. Helps prevent e-mail from being flagged as spam.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.