From 15f376f91f6be46a00dc5c82552957bb7058aba9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 26 Aug 2021 17:13:41 +0200 Subject: [PATCH 5/6] Bug 28870: Use Email::Address->parse Content-Type: text/plain; charset="utf-8" Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- Koha/Email.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Email.pm b/Koha/Email.pm index dcf674dacd..b0cdc6cd23 100644 --- a/Koha/Email.pm +++ b/Koha/Email.pm @@ -195,7 +195,8 @@ Return true is the email address passed in parameter is valid following RFC 2822 sub is_valid { my ( $class, $email ) = @_; - return ($email =~ m{$Email::Address::mailbox}) ? 1 : 0; + my @addrs = Email::Address->parse($email); + return @addrs ? 1 : 0; } 1; -- 2.25.1