On 3/13/2013 10:22 AM, Wietse Venema wrote: > Gerald Vogt: >> On 13.03.2013 15:54, Wietse Venema wrote: >>>> 2. This still won't help to accept e-mails for users regardless of what >>>> comes after the @ and reject it if the user does not exist. >>> >>> To reject non-existent recipients, list the existing ones in >>> relay_recipient_maps. If you can't populate that table, use >> >> And how do I create a list to accept e-mails for [email protected] and >> user@*.example.com for a known set of user names? > > In that case one should normalize the address ([email protected] > -> [email protected]) before consulting a table with all [email protected]. > > Unfortunately, Postfix has (up to now) no way to feed the result > from one table into another table, but there is a workaround > which requires Postfix 2.7 or later: > > /etc/postfix/main.cf: > smtpd_command_filter = pcre:/etc/postfix/command_filter > > /etc/postfix/command_filter: > /^RCPT\s+TO:\s*<([^@]+)@.+\.example\.com>(.*)/ RCPT > TO:<${[email protected]>$2 > > (address forms without <> left as an exercise for the reader). > > This normalizes [email protected] -> [email protected] before > the SMTP server subjects the address to recipient validion, with all > valid [email protected] instances listed with relay_recipient_maps. > > This is admittely a bit gross but so is the problem. > > Wietse >
An alternative is to put the recipients in an sql table and use a relay_recipient_maps query that ignores or wildcards the domain name. This requires a postfix built with *sql support. -- Noel Jones
