• Resolved wlperry95672

    (@wlperry95672)


    BPS security sends nice emails letting me know when one of my sites is under attack. Unfortunately, recently something is being mangled in the message and my mail server blocks it. I finally found the following message associated with one of the emails:
    INVALID HEADER
    Duplicate header field: “MIME-Version”

    I think that I have finally found a way to check the mail source and I do in fact see the following snippit of code:

    X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer)
    MIME-Version: 1.0
    MIME-Version: 1.0
    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    https://ww.wp.xz.cn/plugins/bulletproof-security/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author AITpro

    (@aitpro)

    I assume you are referring to the automated Security Log zip email? If so, the Mime header is only added once in the BPS code and uses wp_mail PHPMailer to send the email.

    $attachments = array( $SecurityLogZip );
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    $headers .= "From: $bps_email_from" . "\r\n";
    $headers .= "Cc: $bps_email_cc" . "\r\n";
    $headers .= "Bcc: $bps_email_bcc" . "\r\n";
    $subject = " BPS Security Log - $timestamp ";
    $message = '<p><font color="blue"><strong>Security Log File For:</strong></font></p>';
    $message .= '<p>Site: '."$justUrl".'</p>';
    $message .= '<p><font color="blue"><strong>Total # of Security Log Entries by Type:</strong></font>'. $SecLogEntries .'</p>';
    
    $mailed = wp_mail($bps_email_to, $subject, $message, $headers, $attachments);
    Plugin Author AITpro

    (@aitpro)

    I checked all other BPS code that sends mail and all of the code that does anything with mail headers is all ok with only 1 MIME-Version header.

    Plugin Author AITpro

    (@aitpro)

    I see the problem now and was able to confirm the duplicate headers problem. This will be fixed in the next BPS version release. Thanks for letting us know about this.

    Plugin Author AITpro

    (@aitpro)

    If you want to fix this manually and modify the BPS code now then here is the new “headers” code below. We should have BPS .53.6 ready for release by next Monday May 1st if you want to wait.

    Replace the “headers” code:

    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    $headers .= "From: $bps_email_from" . "\r\n";
    $headers .= "Cc: $bps_email_cc" . "\r\n";
    $headers .= "Bcc: $bps_email_bcc" . "\r\n";

    With this new “headers” code:

    $headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . $bps_email_from, 'Cc: ' . $bps_email_cc, 'Bcc: ' . $bps_email_bcc );
    Plugin Author AITpro

    (@aitpro)

    The new headers code has been added in BPS .53.6

    Thread Start Date: 4-27-2016
    Thread Resolved/Current Date: 4-28-2016

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

The topic ‘Duplicate header field’ is closed to new replies.