OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: recipient restrictions based on user id

From: mouss (moussnetoyen.net)
Date: Wed Apr 02 2008 - 12:24:52 CDT


punit jain wrote:
> Hi ,
>
> I am trying to achieve following:-
>
> In a domain say test.com with 10 users say user1test.com ....till
> user10test.com
> I want that user9 should recieve mail from only user 2. which means if mail
> is recieved for user9 from user1 it should be rejected.
> Is it possible ? i tried using recipient maps but does doesnt work. Can
> anyone point me to right directive ?
>

http://www.postfix.org/RESTRICTION_CLASS_README.html

smtpd_restriction_classes =
    restricted_recipient
    ...

smtpd_sender_restrictions =
    check_recipient_access hash:/etc/postfix/restricted_recipient
    ...

restricted_recipient =
    check_sender_access hash:/etc/postfix/unrestricted_sender
    reject

== restricted_recipient
user9example.com restricted_recipient

== unrestricted_sender
user1example.com OK

Note that this is put under smtpd_SENDER_restrictions for safety. it
will only work in the default postfix setup (smtpd_delay_reject=yes). if
you've changed this, it's your fault ;-p