mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-25 09:21:19 +08:00
prefer user email as the username for plugins
This commit is contained in:
parent
28cf0e9ff1
commit
032c468e8a
5 changed files with 11 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,3 +6,5 @@ config/production.*
|
|||
config/development.*
|
||||
package-lock.json*
|
||||
certs/test-*
|
||||
zmta-milter
|
||||
zmta-milter.toml
|
|
@ -2992,6 +2992,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
|
|||
let message = maildrop.push(
|
||||
{
|
||||
user: userData._id,
|
||||
userEmail: userData.address,
|
||||
reason: 'submit',
|
||||
from: envelope.from,
|
||||
to: envelope.to,
|
||||
|
|
|
@ -465,6 +465,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
|
|||
let message = maildrop.push(
|
||||
{
|
||||
user: userData._id,
|
||||
userEmail: userData.address,
|
||||
parentId: messageId,
|
||||
reason: 'submit',
|
||||
from: compiledEnvelope.from,
|
||||
|
|
|
@ -13,8 +13,7 @@ module.exports = (options, callback) => {
|
|||
|
||||
targets: options.targets,
|
||||
|
||||
interface: 'forwarder',
|
||||
runPlugins: true
|
||||
interface: 'forwarder'
|
||||
};
|
||||
|
||||
let message = options.maildrop.push(mail, (err, ...args) => {
|
||||
|
|
|
@ -97,7 +97,12 @@ class Maildropper {
|
|||
};
|
||||
|
||||
if (options.user) {
|
||||
envelope.user = options.user.toString();
|
||||
envelope.userId = options.user.toString();
|
||||
}
|
||||
|
||||
if (options.userEmail) {
|
||||
// prefer email address as the username
|
||||
envelope.user = options.userEmail;
|
||||
}
|
||||
|
||||
if (options.parentId) {
|
||||
|
|
Loading…
Reference in a new issue