@@ -1393,7 +1393,7 @@ public EmailPopulatingBuilder withRecipients(@Nullable String name, boolean fixe
13931393 public EmailPopulatingBuilder withRecipients (@ Nullable String name , boolean fixedName , @ NotNull Collection <String > oneOrMoreAddressesEach , @ Nullable RecipientType recipientType ) {
13941394 for (String oneOrMoreAddresses : oneOrMoreAddressesEach ) {
13951395 for (String emailAddress : extractEmailAddresses (oneOrMoreAddresses )) {
1396- withRecipient (MiscUtil . interpretRecipient ( name , fixedName , emailAddress , recipientType ) );
1396+ withRecipient (name , fixedName , emailAddress , recipientType );
13971397 }
13981398 }
13991399 return this ;
@@ -1471,7 +1471,19 @@ public EmailPopulatingBuilder withRecipient(@NotNull final String singleAddress,
14711471 */
14721472 @ Override
14731473 public EmailPopulatingBuilder withRecipient (@ Nullable final String name , @ NotNull final String singleAddress , @ Nullable final RecipientType recipientType ) {
1474- recipients .add (MiscUtil .interpretRecipient (name , true , singleAddress , recipientType ));
1474+ return withRecipient (name , true , singleAddress , recipientType );
1475+ }
1476+
1477+ /**
1478+ * @see EmailPopulatingBuilder#withRecipient(String, boolean, String, RecipientType)
1479+ */
1480+ @ Override
1481+ public EmailPopulatingBuilder withRecipient (@ Nullable final String name , boolean fixedName , @ NotNull final String singleAddress , @ Nullable final RecipientType recipientType ) {
1482+ try {
1483+ recipients .add (MiscUtil .interpretRecipient (name , fixedName , singleAddress , recipientType ));
1484+ } catch (Exception e ){
1485+ // assume recipient was malformed and simply ignore it
1486+ }
14751487 return this ;
14761488 }
14771489
@@ -1829,7 +1841,7 @@ public EmailPopulatingBuilder signWithSmime(@NotNull final Pkcs12Config pkcs12Co
18291841 @ SuppressFBWarnings (value = "OBL_UNSATISFIED_OBLIGATION" , justification = "Input stream being created should not be closed here" )
18301842 public EmailPopulatingBuilder encryptWithSmime (@ NotNull final String pemFile ) {
18311843 try {
1832- return encryptWithSmime (new FileInputStream (new File ( pemFile ) ));
1844+ return encryptWithSmime (new FileInputStream (pemFile ));
18331845 } catch (FileNotFoundException e ) {
18341846 throw new EmailException (format (ERROR_READING_FROM_FILE , pemFile ), e );
18351847 }
0 commit comments