The expected replacement recipient is foo@example.com
Observed behavior
The replacement recipient is bar@example.com
Steps to reproduce
Send mail to foo-test@example.com
The reason is that the two if statements "if (config['@'+host]) {" and "if (config[user] || config[match[0]] || config[match[0] + '@' + host]) {" are in the wrong order, they should be reversed.
Haraka version
2.8.8
Expected behavior
Given the rules
{ "@example.com" : { "action" : "alias", "to" : "bar@example.com" }, "foo" : { "action" : "alias", "to" : "foo@example.com" } }
And the recipient foo-test@example.com
The expected replacement recipient is foo@example.com
Observed behavior
The replacement recipient is bar@example.com
Steps to reproduce
Send mail to foo-test@example.com
The reason is that the two if statements "if (config['@'+host]) {" and "if (config[user] || config[match[0]] || config[match[0] + '@' + host]) {" are in the wrong order, they should be reversed.