本文整理了Java中org.apache.mailet.Mail.setRecipients()
方法的一些代码示例,展示了Mail.setRecipients()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mail.setRecipients()
方法的具体详情如下:
包路径:org.apache.mailet.Mail
类名称:Mail
方法名:setRecipients
[英]Sets the message recipients as a Collection of MailAddress objects.
[中]将邮件收件人设置为MailAddress对象的集合。
代码示例来源:origin: org.apache.james/james-server-smtpserver
/**
* (non-Javadoc)
* @see org.apache.james.protocols.smtp.MailEnvelope#setRecipients(java.util.List)
*/
public void setRecipients(List<MailAddress> recipientCollection) {
mail.setRecipients(recipientCollection);
}
代码示例来源:origin: org.apache.james/apache-standard-mailets
@Override
public void service(Mail mail) throws MessagingException {
Iterator<MailAddress> rcpts = mail.getRecipients().iterator();
List<MailAddress> newRcpts = new ArrayList<MailAddress>();
while(rcpts.hasNext()) {
newRcpts.add(new MailAddress(rcpts.next().toString().toLowerCase(Locale.US)));
}
mail.setRecipients(newRcpts);
}
代码示例来源:origin: org.apache.james/james-server-mailets
private void serviceSingleServer(Mail mail, String originalName, Map.Entry<Domain, Collection<MailAddress>> entry) {
if (configuration.isDebug()) {
LOGGER.debug("Sending mail to {} on host {}", entry.getValue(), entry.getKey());
}
mail.setRecipients(entry.getValue());
mail.setName(originalName + NAME_JUNCTION + entry.getKey().name());
try {
queue.enQueue(mail);
} catch (MailQueueException e) {
LOGGER.error("Unable to queue mail {} for recipients {}", mail.getName(), mail.getRecipients(), e);
}
}
代码示例来源:origin: org.apache.james/james-server-mailets
public static void removeRecipient(Mail mail, ActionContext context) {
mail.setRecipients(mail.getRecipients()
.stream()
.filter(mailAddress -> !mailAddress.equals(context.getRecipient()))
.collect(Guavate.toImmutableList()));
}
}
代码示例来源:origin: org.nhind/xdmail
mail.setRecipients(getSmtpRecips(recipAddresses));
代码示例来源:origin: org.apache.james/james-server-mailets
mail.setRecipients(invalidAddresses);
bouncer.bounce(mail, sfe);
mail.setRecipients(validUnsentAddresses);
if (enhancedMessagingException.hasReturnCode()) {
boolean isPermanent = enhancedMessagingException.isServerError();
mail.setRecipients(invalidAddresses);
return logAndReturn(mail, ExecutionResult.permanentFailure(sfe));
代码示例来源:origin: org.apache.james/james-server-mailets
public void processMail(Mail mail) throws MessagingException {
RrtExecutionResult executionResults = executeRrtFor(mail);
if (!executionResults.recipientWithError.isEmpty()) {
MailImpl newMail = MailImpl.builder()
.name(mail.getName())
.sender(mail.getMaybeSender())
.recipients(executionResults.recipientWithError)
.mimeMessage(mail.getMessage())
.state(errorProcessor)
.build();
mailetContext.sendMail(newMail);
}
if (executionResults.newRecipients.isEmpty()) {
mail.setState(Mail.GHOST);
}
mail.setRecipients(executionResults.newRecipients);
}
代码示例来源:origin: org.apache.james/james-server-mailetcontainer-camel
mail.setRecipients(rcpts);
newMail.setRecipients(matchedRcpts);
代码示例来源:origin: org.nhind/gateway
mail.setRecipients(newRCPTList);
内容来源于网络,如有侵权,请联系作者删除!