On 2/2/2013 11:10 AM, Gerben Wierda wrote:
> Dag & Dank Wietse,
> 
> Can I do perl regex, e.g.
> 
> outmail\d\d\d.snc\d.facebook.com      permit
> 
> or globbing like
> 
> outmail*.snc4*.facebook.com

/etc/postfix/main.cf:
    smtpd_recipient_restrictions =
        ...
        reject_unauth_destination
     -> check_client_access pcre:/etc/postfix/client_access
        check_policy_service unix:private/policy

/etc/postfix/client_access:
    /.*facebook\.com$/          permit
    ...

You may want to be more specific.  I made my example very generic as
your expression above seems to miss some of their outbound host rdns,
such as:  outappmail004.snc4.facebook.com

> And secondly, I also get mail I want to leave through where the sender is an 
> operation like messagelabs, but I want to accept only certain senders using 
> messagelabs, e.g. apg.nl or apg-am.nl. So not so much the client but the 
> from, e.g.
> 
> @apg.nl       permit
> 
> how do I do that?

You can also do this with a PCRE table.  If by "from" you mean MAIL
FROM, then check_sender_access is what you want:

http://www.postfix.org/postconf.5.html#check_sender_access

So in the example above, directly after check_client_access, you'd have:

        check_sender_access pcre:/etc/postfix/sender_access

and a file with expressions something like:

/etc/postfix/sender_access
    /.*@apg\.nl$/               permit
    ...

-- 
Stan

Reply via email to