Fruneau/pfixtools — pull request #8 by driskell (2014-01-22 21:31:49+00:00)
Title: Docs update and decoding adjustment

Hi Fruneau,

I've adjusted the docs slightly to fix links and add references to the socketmap protocol capability.

More importantly, I found an issue with the use of canonical to decode. When ignoring external domains, it would return 200/OK with the same address as given, if the domain was external. However, if it was internal, and didn't need decoding, it would return 400/NOT FOUND Not an SRS address (due to the error return from srs_decode).

However, it seems that if a canonical rewrite returns OK, postfix will bypass local recipient checks. This means if someone tries to send to an address that would normally be rejected as "not in virtual mailbox table" for example, and it was considered external domain, we'd return an OK with the same address and cause that check to be bypassed. This meant the email would be accepted, and a bounce report generated.

So I've adjusted the decoder to always return NOT FOUND unless it did in fact decode something.

Thanks,

Jason