8000 allow sub-classes to change the way the message id parsed · symfony/symfony@622cd01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 622cd01

Browse files
committed
allow sub-classes to change the way the message id parsed
1 parent 5667f62 commit 622cd01

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
147147
throw $e;
148148
}
149149

150-
if ($this->mtaResult && $messageId = $this->parseMessageId()) {
150+
if ($this->mtaResult && $messageId = $this->parseMessageId($this->mtaResult)) {
151151
$message->setMessageId($messageId);
152152
}
153153

@@ -156,15 +156,15 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
156156
return $message;
157157
}
158158

159-
protected function parseMessageId(): string
159+
protected function parseMessageId(string $mtaResult): string
160160
{
161161
$regexps = [
162162
'/250 Ok (?P<id>[0-9a-f-]+)\r?$/mis',
163-
'/250 Ok:? queued as (?P<id>[A-Z0-9]+)\r?$/mis'
163+
'/250 Ok:? queued as (?P<id>[A-Z0-9]+)\r?$/mis',
164164
];
165165
$matches = [];
166166
foreach ($regexps as $regexp) {
167-
if (preg_match($regexp, $this->mtaResult, $matches)) {
167+
if (preg_match($regexp, $mtaResult, $matches)) {
168168
return $matches['id'];
169169
}
170170
}

0 commit comments

Comments
 (0)
0