• bogdanh

    (@bogdanhapcayardicom)


    Hello,

    It seems that the value of the Message-ID header is not formatted as per https://www.rfc-editor.org/rfc/rfc2822. It should be enclosed in angled brackets.

    We ran into an issue where Mandrill would flag our emails as spammy, because of that. Applying the following change fixed the problem:

    /**
             * Creates the Message-ID
             *
             * @return string
             */
            public function createMessageId() {
    
                $id = md5(uniqid(time()));
    
                if (isset($_SERVER["SERVER_NAME"])) {
                    $hostName = sanitize_text_field($_SERVER["SERVER_NAME"]);
                } else {
                    $hostName = php_uname('n');
                }
    
                //return $id . '@' . str_replace('www.', '', $hostName);  -- CHANGED BY US
                return '<' . $id . '@' . str_replace('www.', '', $hostName) . '>'; // ++ CHANGED BY US
    
            }
    

    Could you please include it in future releases, if it makes sense?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @bogdanhapcayardicom,

    I hope you are doing well,

    Thank you for your findings. Let us reproduce this on our end. We will let you know once we will have a solution.

    Thanks and regards,
    Support Team – WPExperts?

    Plugin Author Saad Iqbal

    (@saadiqbal)

    Hi @bogdanhapcayardicom ,

    Hope you are doing good. In past we did add this patch in 2.1.4;
    REF: Changeset 2775491 for post-smtp/trunk/Postman/PostmanWpMail.php

    But the result was more destructive as many issues were reported by the users, so we had to revert it in the next version.

    We have no plan to retry this in the future. Still do let us know if there is anything else we can help you with.

    Thanks!

    • This reply was modified 1 year, 7 months ago by Saad Iqbal.
    Thread Starter bogdanh

    (@bogdanhapcayardicom)

    Thank you for the reply.

    May I suggest adding a hook (action or filter) to allow customizing that behavior for folks that need it? Otherwise we’d need to keep patching the plugin after each update. And apparently we’re not the only one that need those angled brackets.

    With such a hook you’d appease both camps :).

    Plugin Author Saad Iqbal

    (@saadiqbal)

    @bogdanhapcayardicom Yes. While writing the response, I was thinking the same ? . We’ll try to manage it in our upcoming release.

    Will keep you updated.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Message-ID header incorrectly formatted’ is closed to new replies.