mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-03-01 10:24:40 +08:00
special forward settings for relays
This commit is contained in:
parent
9dc18e8a7e
commit
b2d98a007b
1 changed files with 14 additions and 4 deletions
|
@ -321,13 +321,23 @@ class FilterHandler {
|
|||
if (!filterActions.get('delete')) {
|
||||
// forward to default recipient only if the message is not deleted
|
||||
if (userData.targets && userData.targets.length) {
|
||||
userData.targets.forEach(target => {
|
||||
forwardTargets.set(target.value, target);
|
||||
userData.targets.forEach(targetData => {
|
||||
let key = targetData.value;
|
||||
if (targetData.type === 'relay') {
|
||||
targetData.recipient = userData.address;
|
||||
key = `${targetData.recipient}:${targetData.value}`;
|
||||
}
|
||||
forwardTargets.set(key, targetData);
|
||||
});
|
||||
} else if (options.targets && options.targets.length) {
|
||||
// if user had no special targets, then use default ones provided by options
|
||||
options.targets.forEach(target => {
|
||||
forwardTargets.set(target.value, target);
|
||||
options.targets.forEach(targetData => {
|
||||
let key = targetData.value;
|
||||
if (targetData.type === 'relay') {
|
||||
targetData.recipient = userData.address;
|
||||
key = `${targetData.recipient}:${targetData.value}`;
|
||||
}
|
||||
forwardTargets.set(key, targetData);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue