diff options
Diffstat (limited to 'src/com/gitblit/MailExecutor.java')
-rw-r--r-- | src/com/gitblit/MailExecutor.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/gitblit/MailExecutor.java b/src/com/gitblit/MailExecutor.java index 56a4ab58..77dc80ba 100644 --- a/src/com/gitblit/MailExecutor.java +++ b/src/com/gitblit/MailExecutor.java @@ -154,7 +154,12 @@ public class MailExecutor implements Runnable { InternetAddress from = new InternetAddress(fromAddress, "Gitblit");
message.setFrom(from);
- Set<String> uniques = new HashSet<String>(toAddresses);
+ // determine unique set of addresses
+ Set<String> uniques = new HashSet<String>();
+ for (String address : toAddresses) {
+ uniques.add(address.toLowerCase());
+ }
+
Pattern validEmail = Pattern
.compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
List<InternetAddress> tos = new ArrayList<InternetAddress>();
@@ -168,8 +173,8 @@ public class MailExecutor implements Runnable { } catch (Throwable t) {
}
}
- }
- message.setRecipients(Message.RecipientType.TO,
+ }
+ message.setRecipients(Message.RecipientType.BCC,
tos.toArray(new InternetAddress[tos.size()]));
message.setSentDate(new Date());
} catch (Exception e) {
|