diff --git a/src/Header/AbstractAddressList.php b/src/Header/AbstractAddressList.php index 1cc99891..4a737c48 100644 --- a/src/Header/AbstractAddressList.php +++ b/src/Header/AbstractAddressList.php @@ -118,7 +118,12 @@ static function ($value) use (&$wasEncoded): ?Address { ], $value ); - return empty($value) ? null : Address::fromString($value, $comments); + try { + return Address::fromString($value, $comments); + } catch (\Laminas\Mail\Exception\InvalidArgumentException $e) { + // ignore invalid addresses + return null; + } }, $values );