haraka / haraka-plugin-aliases

Email aliases for Haraka
https://www.npmjs.com/package/haraka-plugin-aliases
MIT License
1 stars 8 forks source link

Aliases plugin not working as expected: order of rules #15

Closed deburau closed 6 months ago

deburau commented 8 years ago

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.

darkpixel commented 8 years ago

I see it. I'll get PR up in a few minutes for testing.

celesteking commented 4 years ago

Thanks for the PR, but additional tests are needed. Let's close this issue otherwise.