mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-26 01:40:48 +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.*
|
config/development.*
|
||||||
package-lock.json*
|
package-lock.json*
|
||||||
certs/test-*
|
certs/test-*
|
||||||
|
zmta-milter
|
||||||
|
zmta-milter.toml
|
|
@ -2992,6 +2992,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
|
||||||
let message = maildrop.push(
|
let message = maildrop.push(
|
||||||
{
|
{
|
||||||
user: userData._id,
|
user: userData._id,
|
||||||
|
userEmail: userData.address,
|
||||||
reason: 'submit',
|
reason: 'submit',
|
||||||
from: envelope.from,
|
from: envelope.from,
|
||||||
to: envelope.to,
|
to: envelope.to,
|
||||||
|
|
|
@ -465,6 +465,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
|
||||||
let message = maildrop.push(
|
let message = maildrop.push(
|
||||||
{
|
{
|
||||||
user: userData._id,
|
user: userData._id,
|
||||||
|
userEmail: userData.address,
|
||||||
parentId: messageId,
|
parentId: messageId,
|
||||||
reason: 'submit',
|
reason: 'submit',
|
||||||
from: compiledEnvelope.from,
|
from: compiledEnvelope.from,
|
||||||
|
|
|
@ -13,8 +13,7 @@ module.exports = (options, callback) => {
|
||||||
|
|
||||||
targets: options.targets,
|
targets: options.targets,
|
||||||
|
|
||||||
interface: 'forwarder',
|
interface: 'forwarder'
|
||||||
runPlugins: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let message = options.maildrop.push(mail, (err, ...args) => {
|
let message = options.maildrop.push(mail, (err, ...args) => {
|
||||||
|
|
|
@ -97,7 +97,12 @@ class Maildropper {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.user) {
|
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) {
|
if (options.parentId) {
|
||||||
|
|
Loading…
Reference in a new issue