From 2dc4ca27cbebf616cfb6d87a7717ffc41cac7e8b Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Wed, 21 Feb 2024 19:42:41 +0530 Subject: [PATCH] bz-68462 Don't consider empty email addresses in mailer --- src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java index 54514b9843..6a55312d3a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java +++ b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java @@ -280,6 +280,10 @@ private static InternetAddress[] internetAddresses(final Vector li final List addrs = new ArrayList<>(); for (final EmailAddress addr : list) { + if (addr.getAddress().isEmpty()) { + // skip + continue; + } final String name = addr.getName(); addrs.add((name == null) ? new InternetAddress(addr.getAddress())