Amavisd supports wildcards by performing decreasingly specific SQL lookups:
9 - lookup for firstname.lastname@example.org 8 - lookup for email@example.com 7 - lookup for user+foo 6 - lookup for user 5 - lookup for @sub.example.com 3 - lookup for @.sub.example.com 2 - lookup for @.example.com 1 - lookup for @.com 0 - lookup for @. (catchall)
idn_to_*() returns an empty string if the domain has a leading dot
which means lookups 0-3 cannot be used. This is fixed by removing the
leading dot before encoding or decoding and adding it back just before
returning the domain.
Now all amavis SQL lookups are possible.
Closes #5533 (closed)