Wietse Venema: > > The "sendmail -bv" can be used by spamass-milter to resolve destination > > user and to use that users' spamassassin preferences: > > > > -x Pass the recipient address through sendmail -bv, which will > > per? > > form virtusertable and alias expansion. The resulting username > > is then passed to spamc. Requires the -u flag. The > > spamass-mil? > > ter configuration process does its best to find sendmail, but > > it > > is possible to override this compiled-in setting via the > > Well that isn't going to work with Postfix. The sendmail emulation > can only go so far; if you want 100%, use real sendmail. > > > only expanding virtual aliases should be fine. > > The following: > > (postmap -q u...@example.com maptype:mapname || > postmap -q @example.com) > > will exit with status 0 (success) if a match was found. > > It'll take more code to handle the third form: stripping an > address extension. Let me know if you need help.
In the course of Postfix 3.x development I made the table lookup sequences configurable internally, but haven't found the time to expose that as main.cf settings. For that, the underlying code needs to make fewer assumptions about how it will be used. The idea is that given a full email address, postmap -q user+...@example.com -m virtual_alias maptype:mapname would query the table with the same sequence of full and partial addresses as virtual_alias_maps, and thereby take some of the mystery out of how Postfix works. I suppose it might be educational if postmap can make its generated queries visible. Wietse