SuiteCRM Bounce handling when sending to *.prod.outlook.com #5371

Open
opened 2026-02-20 17:00:17 -05:00 by deekerman · 0 comments
Owner

Originally created by @jobst on GitHub (Feb 8, 2026).

Issue

After a campaign was sent there are two locations for bounce reports below “View Status” for a campaign:

Bounced Messages, Invalid Email
Bounced Messages, Other

While the email addresses are marked INVALID for ALL email addresses found for the first case “Invalid Email” this cannot be said for second case “Other”.

My mail server reports correctly for all of the many cases - I checked the first 20 and my mail server has reported correctly that the recipient mail server reported “user unknown” as in:

Feb 5 12:57:08 korolev sendmail[402961]: 6151v5DH402945: to=RECIPIENT_EMAIL_ADDRESS, ctladdr=BOUNCE_EMAIL_ADDRESS (2291/2291), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=12017, relay=RECIPIENT_EMAIL_ADDRESS_DOMAIN.mail…[ction.outlook.com](http://ction.outlook.com/). [52.101.40.0], dsn=5.4.1, stat=User unknown

Yet the email address is NOT marked invalid - this is a little frustrating, I have quite a lot of them (400+ in fact)
This is the actual return reciept:

Reporting-MTA: dns; barrett.com.au
Received-From-MTA: DNS; localhost
Arrival-Date: Thu, 5 Feb 2026 12:57:06 +1100

Final-Recipient: RFC822; EMAIL_ADDRESS_RECIPIENT
Action: failed
Status: 5.4.1
Remote-MTA: DNS; DOMAIN_RECIPIENT.mail.protection.outlook.com
Diagnostic-Code: SMTP; 550 5.4.1 Recipient address rejected: Access denied. For more information see  [CY4PEPF0000FCC0.namprd03.prod.outlook.com 2026-02-05T01:57:08.183Z 08DE63A2ECABE068]
Last-Attempt-Date: Thu, 5 Feb 2026 12:57:08 +1100

This happens ONLY when receiving from *.prod.outlook.com or *.mail.protection.outlook.com.

Possible Fix

On line 161 (or thereabouts) in file /modules/Campaigns/ProcessBouncedEmails.php is following statement:

        // Permanent error with smtp error code for non-existent email address
        if ($match[1] == '5' && preg_match('/^Diagnostic-Code:\s*smtp\s*;.*550/m', $email_description)) {
            return true;
        }

However this ONLY allows lowercase "smtp" diagnostic code, MICROSOFT outlook servers in fact return

Diagnostic-Code: SMTP; 550 5.4.1 Recipient address rejected: Access denied.

The statement SHOULD BE:

        // Permanent error with smtp error code for non-existent email address
        if ($match[1] == '5' && preg_match('/^Diagnostic-Code:\s*smtp\s*;.*550/im', $email_description)) {
            return true;
        }

Not the additional "i" allowing for both LOWER and UPPERCASE smtp.

Steps to Reproduce the Issue

1. Send a campaign to email addresses hosted by prod.outlook.com based servers
2. include email addresse NOT active or invalid
3. they will NOT be marked invalid due to MICROSOFT returning an UPPERCASE "SMTP" and the regular expression chcking for lower case only.

Context

ALL invalid addresses returned by *.prod.outlook.com or *.mail.protection.outlook.com are not marked INVALID although my mailserver correctly identifies them as invalid.

Version

7.14.4

What browser are you currently using?

Other

Browser Version

N/A (the browser does NOT matter)

Environment Information

PHP 8.2.29 (mysql has no influence on this bug)

Operating System and Version

AlmaLinux release 8.10 (although it does NOT matter in this case)

Originally created by @jobst on GitHub (Feb 8, 2026). ### Issue After a campaign was sent there are two locations for bounce reports below “View Status” for a campaign: Bounced Messages, Invalid Email Bounced Messages, Other While the email addresses are marked INVALID for ALL email addresses found for the first case “Invalid Email” this cannot be said for second case “Other”. My mail server reports correctly for all of the many cases - I checked the first 20 and my mail server has reported correctly that the recipient mail server reported “user unknown” as in: ``` Feb 5 12:57:08 korolev sendmail[402961]: 6151v5DH402945: to=RECIPIENT_EMAIL_ADDRESS, ctladdr=BOUNCE_EMAIL_ADDRESS (2291/2291), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=12017, relay=RECIPIENT_EMAIL_ADDRESS_DOMAIN.mail…[ction.outlook.com](http://ction.outlook.com/). [52.101.40.0], dsn=5.4.1, stat=User unknown ``` Yet the email address is NOT marked invalid - this is a little frustrating, I have quite a lot of them (400+ in fact) This is the actual return reciept: ``` Reporting-MTA: dns; barrett.com.au Received-From-MTA: DNS; localhost Arrival-Date: Thu, 5 Feb 2026 12:57:06 +1100 Final-Recipient: RFC822; EMAIL_ADDRESS_RECIPIENT Action: failed Status: 5.4.1 Remote-MTA: DNS; DOMAIN_RECIPIENT.mail.protection.outlook.com Diagnostic-Code: SMTP; 550 5.4.1 Recipient address rejected: Access denied. For more information see [CY4PEPF0000FCC0.namprd03.prod.outlook.com 2026-02-05T01:57:08.183Z 08DE63A2ECABE068] Last-Attempt-Date: Thu, 5 Feb 2026 12:57:08 +1100 ``` This happens ONLY when receiving from *.prod.outlook.com or *.mail.protection.outlook.com. ### Possible Fix On line 161 (or thereabouts) in file /modules/Campaigns/ProcessBouncedEmails.php is following statement: ``` // Permanent error with smtp error code for non-existent email address if ($match[1] == '5' && preg_match('/^Diagnostic-Code:\s*smtp\s*;.*550/m', $email_description)) { return true; } ``` However this ONLY allows lowercase "smtp" diagnostic code, MICROSOFT outlook servers in fact return `Diagnostic-Code: SMTP; 550 5.4.1 Recipient address rejected: Access denied.` The statement SHOULD BE: ``` // Permanent error with smtp error code for non-existent email address if ($match[1] == '5' && preg_match('/^Diagnostic-Code:\s*smtp\s*;.*550/im', $email_description)) { return true; } ``` Not the additional "i" allowing for both LOWER and UPPERCASE smtp. ### Steps to Reproduce the Issue ```bash 1. Send a campaign to email addresses hosted by prod.outlook.com based servers 2. include email addresse NOT active or invalid 3. they will NOT be marked invalid due to MICROSOFT returning an UPPERCASE "SMTP" and the regular expression chcking for lower case only. ``` ### Context ALL invalid addresses returned by *.prod.outlook.com or *.mail.protection.outlook.com are not marked INVALID although my mailserver correctly identifies them as invalid. ### Version 7.14.4 ### What browser are you currently using? Other ### Browser Version N/A (the browser does NOT matter) ### Environment Information PHP 8.2.29 (mysql has no influence on this bug) ### Operating System and Version AlmaLinux release 8.10 (although it does NOT matter in this case)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5371
No description provided.