Skip to content

Commit

Permalink
Match SendGrid transaction IDs, trim all IDs, fixes PHPMailer#1193
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Oct 9, 2017
1 parent 0605a0e commit c944cc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PHPMailer Change Log

* Don't make max line length depend on line break format
* Match SendGrid transaction IDs

## Version 6.0.1 (September 14th 2017)
* Use shorter Message-ID headers (with more entropy) to avoid iCloud blackhole bug
Expand Down
3 changes: 2 additions & 1 deletion src/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class SMTP
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/',
'Microsoft_ESMTP' => '/[0-9]{3} 2.[0-9].0 (.*)@(?:.*) Queued mail for delivery/',
'Amazon_SES' => '/[0-9]{3} Ok (.*)/',
'SendGrid' => '[0-9]{3} Ok: queued as (.*)',
];

/**
Expand Down Expand Up @@ -1291,7 +1292,7 @@ protected function recordLastTransactionID()
$this->last_smtp_transaction_id = false;
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
$this->last_smtp_transaction_id = $matches[1];
$this->last_smtp_transaction_id = trim($matches[1]);
break;
}
}
Expand Down

0 comments on commit c944cc8

Please sign in to comment.