如何配置Jenkins使用gpg发送加密的电子邮件? [英] How to configure Jenkins to send encrypted emails with gpg?
本文介绍了如何配置Jenkins使用gpg发送加密的电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找有关如何配置jenkins电子邮件插件(ext-mail)以加密通知的说明? Google叔叔对我没有太多帮助.
I am looking for instructions on how to configure the jenkins email plugin (ext-mail) to encrypt notifications? The uncle google did not help me too much.
推荐答案
such feature is not out-of-box, you need custom ExtendedEmailPublisher for your needs.
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).
you can get Recipients and Email message for sign/encrypt and call Transport.send(msg) at last.
这篇关于如何配置Jenkins使用gpg发送加密的电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文