• Resolved macsuibhne

    (@macsuibhne)


    I have a quite a few WordPress websites and this problem has become a common issue.
    When receiving emails from Contact Form 7, headers have started to appear in the body of the email. The following appears first followed by the message itself. I’ve replaced the domain name with sitename.com

    X-PHP-Originating-Script: 6697:class-phpmailer.php
    Date: Thu, 23 Apr 2020 11:19:15 +0000
    From: WordPress <[email protected]>
    Message-ID: <[email protected]>
    X-Mailer: PHPMailer 5.2.27 (https://github.com/PHPMailer/PHPMailer)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8

    When replying to these emails the senders address is not the Reply-To. Instead, the To: field is populated with a server related address, which means the email goes nowhere.

    At first I though this was a problem with Contact Form 7. However, I recently received an email notification from one of the websites to say that a comment had been held for moderation. The same headers were in this email.

    After a bit of investigation I noticed that if I completely disable the Shield Security plugin, the problem stops. I investigated this more thoroughly and noticed that the problem remains if Shield is disabled in the General settings only. The only way to prevent this problem is to completely disable the plugin in the Plugins section.

    Any suggestions?
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Paul

    (@paultgoodchild)

    That’s really very odd indeed.

    Shield doesn’t touch wp_mail() except in 2 specific circumstances:

    1) It’s auditing the email. In this case nothing is changed and it only parses the email info and write to the audit logs.

    2) It’s sending one of its own emails. In this case it adds a couple of filters right before sending, and then immediately removes those filters after sending.

    It also never modifies the body of the email, so I can’t see how Shield would be causing this.

    Could you check:
    1) at the time of sending an email from CF7, are there any errors or notices in your PHP or apache logs?

    2) Have you tested disabling other plugins to see if this problem is resolved?

    While disabling Shield appears to solve the problem, with WordPress and so many plugins interacting, it doesn’t mean it’s actually Shield that’s causing it.

    We’ve had no other reports of this and we’ve also installed and tested CF7 after receiving your message and see nothing out of the ordinary. I’ve also just reviewed all inter

    It also strikes me as odd that it’s only recently started happening. Shield hasn’t been upgraded for over a month now, so it’s unlikely that something in Shield has changed. Likely, I feel, it’s another plugin and it’s somehow interacting with Shield? I’m not sure how. But if you could test disabling 1 plugin at a time (with Shield active) and see if the problem occurs, this will help narrow it down.

    Hopefully we’ll find the cause and if it’s Shield, we’ll happily address it. I’ll continue looking on our side..

    Thread Starter macsuibhne

    (@macsuibhne)

    I’ve got a bit further with this. The site also has the WordFence Plugin activated. Having tested with all other plugins deactivated, this problem occurs when both WordFence and Shield are active at the same time. Deactivate either of them and the problem goes away.

    Also, this isn’t a recent issue. It has been happening for about a month.

    Plugin Author Paul

    (@paultgoodchild)

    I can’t explain that.

    As I said, Shield doesn’t modify email headers, and certainly doesn’t modify the body of emails. I had a look to wordfence’s code and there’s this, which runs with every page load: /wordfence/lib/wordfenceClass.php, line 1163

    add_filter('wp_mail_from', 'wordfence::fixWPMailFromAddress');

    Perhaps try commenting out that line. Other than that, I have no clue to explain what’s happening.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Headers in email’ is closed to new replies.