/** * Produces an ack MDN message for the incoming message. * @param envelope The incoming message that will have an MDN ack message sent to the senders. * @return A collection of notification messages that will be sent to the incoming message senders. */ public Collection<NotificationMessage> produce(IncomingMessage envelope) { if (envelope == null) { throw new IllegalArgumentException(); } if (!settings.isAutoResponse() || !envelope.hasDomainRecipients() || NotificationHelper.isMDN(envelope.getMessage())) { LOGGER.info("No MDN messages to send."); return Collections.emptyList(); } LOGGER.info("Generating MDN \"processed\" messages"); Collection<InternetAddress> senders = envelope.getDomainRecipients().toInternetAddressCollection(); Collection<NotificationMessage> notifications = NotificationHelper.createNotificationMessages(envelope.getMessage(), senders, this); return notifications; }
notificationProducer.produce(new Message(msg), recipients.toInternetAddressCollection()); if (notifications != null && notifications.size() > 0)
notificationProducer.produce(new Message(msg), xdRecipients.toInternetAddressCollection()); if (notifications != null && notifications.size() > 0)
(List<InternetAddress>)recipients.toInternetAddressCollection(), (InternetAddress)sender);