1

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.

1 Answer 1

2

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;
        }

you can get Recipients and Email message for sign/encrypt and call Transport.send(msg) at last.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.