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 u...@example.com and
>> user@*.example.com for a known set of user names?
> 
> In that case one should normalize the address (u...@whatever.example.com
> -> u...@example.com) before consulting a table with all u...@example.com.
> 
> 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:<${1...@example.com>$2
> 
> (address forms without <> left as an exercise for the reader).
> 
> This normalizes u...@whatever.example.com -> u...@example.com before
> the SMTP server subjects the address to recipient validion, with all
> valid u...@example.com 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

Reply via email to