• Following up on this closed topic as the issue is still present nearly 3 years later.

    The missing angle brackets around the Message-ID header cause Google Workspace to bounce emails with:

    550 5.7.1 Messages missing a valid Message-ID header are not accepted.

    RFC 5322 requires Message-ID to be in the format . Without the brackets, Google stamps the message as SMTPIN_ADDED_BROKEN and downstream Workspace recipients reject it entirely — meaning password resets, order
    confirmations, and any other transactional email silently fails for a large portion of users.

    I understand angle brackets were attempted before and reverted due to compatibility issues, so I’ve submitted a PR that takes a safer approach — the default behaviour is unchanged, but a post_smtp_message_id filter is added so users can
    opt in to the fix:

    add_filter( 'post_smtp_message_id', function( $messageId ) {
    return '<' . $messageId . '>';
    } );

    PR: https://github.com/wpexpertsio/Post-SMTP/pull/130

    Would appreciate a review — it’s a one-line change.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support M Aqib Khan

    (@aqibkhan9)

    Hi @pross ,

    Thank you for the detailed explanation and for taking the time to submit the PR we really appreciate the effort and the thoughtful approach with the opt-in filter.

    We’ve shared your PR with our development team for review. They’ll evaluate the implementation, especially considering the compatibility concerns you mentioned, and assess how it can be incorporated safely.

    We’ll keep you posted once we have feedback from the team.

    Plugin Support M Aqib Khan

    (@aqibkhan9)

    Hey @pross ,

    I appreciate your patience and cooperation while we worked through the issue.

    I’m pleased to inform you that our team has resolved it. Please download and install the beta plugin, and share your feedback at your convenience.

    Thread Starter Simon Prosser

    (@pross)

    Im not sure I understand your fix.

    In a previous support thread here it was said that you tried to add angle brackes before and had to remove them as it broke support for something else, so my PR added a filter to allow uses to add the brackets if the desired and leave the default as it was, I gave you a PR for that.

    I downloaded the “beta” version and it looks like you are now adding the angle brackets anyway now so breaking backwards compatibility and the filter now does essentially nothing.

        private function apply_default_headers( $message ) {
            /**
             * Filter the Message-ID addr-spec (unbracketed id@domain) before the RFC 5322 header is built.
             *
             * @since 3.9.2
             *
             * @param string $addr_spec Message-ID without angle brackets.
             */
            $addr_spec = apply_filters( 'post_smtp_message_id', $this->createMessageId() );
            $addr_spec = trim( (string) $addr_spec );
            $len       = strlen( $addr_spec );
            if ( $len >= 2 && '<' === $addr_spec[0] && '>' === substr( $addr_spec, -1 ) ) {
                $addr_spec = substr( $addr_spec, 1, -1 );
            }
            $headers[] = 'Message-ID: <' . $addr_spec . '>';
            $message->addHeaders( $headers );
        }
    Plugin Support M Aqib Khan

    (@aqibkhan9)

    Hi,

    Thank you for your detailed feedback.

    Just to clarify the current implementation:

    We’ve added the post_smtp_message_id filter around createMessageId(), while keeping the default behavior unchanged to maintain backward compatibility.

    This means:

    • By default, the Message-ID format remains as it was (no enforced angle brackets globally)
    • Users who require angle brackets (e.g., for stricter providers like Google Workspace) can now opt in using the filter, they are no longer forced across all environments

    So the intention is to preserve compatibility while still allowing flexibility where needed.

    It sounds like the beta you tested may not reflect the latest adjustment. Could you please download and test the updated beta from the link below?

    Let us know your findings, your input here is extremely valuable in making sure we get this right across different environments.

    Thread Starter Simon Prosser

    (@pross)

    Looks like the new version from today uses the filter in the way I suggested now allowing people to opt in and add angle brackets to make the email rfc compliant.

    You can close the PR now.

    Plugin Support M Aqib Khan

    (@aqibkhan9)

    Thanks for confirming.

    Plugin Support M Aqib Khan

    (@aqibkhan9)

    This has been shipped in an offical release.

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

You must be logged in to reply to this topic.