Added identity display name and default bcc

This commit is contained in:
M66B
2018-12-10 16:45:52 +01:00
parent bb9068aa0d
commit d5dc15884e
8 changed files with 1334 additions and 10 deletions

View File

@@ -1698,9 +1698,20 @@ public class ServiceSynchronize extends LifecycleService {
// Create message
MimeMessage imessage = MessageHelper.from(this, message, isession);
// Add reply to
if (ident.replyto != null)
imessage.setReplyTo(new Address[]{new InternetAddress(ident.replyto)});
// Add bcc
if (ident.bcc != null) {
List<Address> bcc = new ArrayList<>();
Address[] existing = imessage.getRecipients(Message.RecipientType.BCC);
if (existing != null)
bcc.addAll(Arrays.asList(existing));
bcc.add(new InternetAddress(ident.bcc));
imessage.setRecipients(Message.RecipientType.BCC, bcc.toArray(new Address[0]));
}
// defacto standard
if (ident.delivery_receipt)
imessage.addHeader("Return-Receipt-To", ident.replyto == null ? ident.email : ident.replyto);