Phil Howard: > I'd like to do something like this. I have a domain, let's call > example.com. This domain has a set of users. I want to have email > accepted for any user in any hostname that is a part of this domain. > And, regardless of which hostname in this domain was involved, if the > user doesn't exist, the RCPT command should be rejected. This would > correspond to using a wildcard (e.g. a * label) in DNS for the zone > for that domain. The ability to make exceptions for this (e.g. a > special hostname in the domain handled differently) would be a plus, > but not essential. It seems what I need is some kind of RCPT command > time rewrite.
Postfix supports wildcards via regexp/pcre tables. 1) You can use them for all the tables that define Postfix address classes: mydestination + aliases, virtual_alias_domains + virtual_alias_maps, virtual_mailbox_domains + virtual_mailbox_maps, relay_domains + relay_recipient_maps. Simply replacing one domain name by another does not produce the expected result. 2) Postfix 2.7 supports SMTP command rewriting (smtpd_command_filter) However this would produce an incorrect error message: RCPT TO:<u...@foo.example.com> smtpd_command_filter strips this to ``RCPT TO:<u...@example.com>'' The Postfix SMTP server then responds with: 550 5.1.1 <u...@example.com> User unknown Wietse