我正在寻找有关如何配置jenkins电子邮件插件(ext-mail)来加密通知的说明?叔叔谷歌并没有太多帮助我。
答案 0 :(得分:2)
此功能不是开箱即用的,您需要自定义ExtendedEmailPublisher以满足您的需求。
MimeMessage msg = createMail(mailType, build, listener);
Address[] allRecipients = msg.getAllRecipients();
if (allRecipients != null) {
StringBuilder buf = new StringBuilder("Sending email to:");
for (Address a : allRecipients) {
buf.append(' ').append(a);
}
listener.getLogger().println(buf);
Transport.send(msg);
if (build.getAction(MailMessageIdAction.class) == null) {
build.addAction(new MailMessageIdAction(msg.getMessageID()));
}
return true;
}
您可以获取签名/加密的收件人和电子邮件,并最后调用Transport.send(msg)。