Fixed Some mails sent through the contact form cannot be delivered

For example I tried a test on my board sending an email from a *@yahoo.com address and this is what I get from gmail (contact email address is a gmail account):

Code:
<***@gmail.com>: host gmail-smtp-in.l.google.com[74.125.136.27] said:
    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. 19si20642687wjx.29 - gsmtp (in reply to end of DATA
    command)

This is caused because altering the "From" header apparently violates the DMARC specs.

A better option in my opinion would be to set the reply-to header with the customer email address and leave the from field with the default address.

Something along these lines (in Misc.php):

Code:
            $mail->send(
                XenForo_Application::get('options')->contactEmailAddress, '', array(
                    'Reply-To' => $user['email']
                ),
                XenForo_Application::get('options')->defaultEmailAddress, XenForo_Application::get('options')->boardTitle
            );
 
Last edited:
So this is incredibly frustrating, as there are now a few additional examples of validation systems that ignore the Sender header, despite it being part of RFC 822. It's specifically designed for cases where there is a different technical sender from the person writing the message. This fits perfectly with the contact form (the message is from another user but is wrapped and physically sent by the board).

Yet, we have services commonly ignoring it (despite plenty of requests regarding it). The whole DMARC setup has a specific discussion regarding mailing lists and how to handle things as well (http://www.dmarc.org/faq.html#s_3)

Alas, I guess I'm going to have to flip the system to use the default email address as From and add a Reply-To header. I'll change this for 1.4.
 
Back
Top Bottom