sign gpg messages

This commit is contained in:
Andris Reinman 2016-04-16 10:51:22 -07:00
parent ac8ac7c6d6
commit db2a7f8aff
4 changed files with 38 additions and 4 deletions

View file

@ -83,7 +83,7 @@ function getTemplate(template, callback) {
}
function createMailer(callback) {
settings.list(['smtpHostname', 'smtpPort', 'smtpEncryption', 'smtpUser', 'smtpPass', 'smtpLog', 'smtpDisableAuth', 'smtpMaxConnections', 'smtpMaxMessages', 'smtpSelfSigned'], (err, configItems) => {
settings.list(['smtpHostname', 'smtpPort', 'smtpEncryption', 'smtpUser', 'smtpPass', 'smtpLog', 'smtpDisableAuth', 'smtpMaxConnections', 'smtpMaxMessages', 'smtpSelfSigned', 'pgpPrivateKey', 'pgpPassphrase'], (err, configItems) => {
if (err) {
return callback(err);
}
@ -109,7 +109,10 @@ function createMailer(callback) {
rejectUnauthorized: !configItems.smtpSelfSigned
}
});
module.exports.transport.use('stream', openpgpEncrypt());
module.exports.transport.use('stream', openpgpEncrypt({
signingKey: configItems.pgpPrivateKey,
passphrase: configItems.pgpPassphrase
}));
return callback(null, module.exports.transport);
});