我正在寻找有关如何配置jenkins电子邮件插件(ext-mail)以加密通知的说明?Google叔叔对我没有太多帮助。
此类功能不是开箱即用的,您需要根据需要自定义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)。