[pfx] Re: restricting sender to single domain

Nick Tait via Postfix-users <[email protected]> Wed, 24 Jun 2026 21:37:28 +1200
Newsgroups gmane.mail.postfix.user
Message-ID <[email protected]>
On 24/06/2026 18:31, Nick Tait via Postfix-users wrote:
> On 24/06/2026 10:40, David Koski via Postfix-users wrote:
>> Hello,
>>
>> I'm looking for a way to restrict a single user to sending only to a 
>> single domain.
>>
>> Regards,
>> David Koski
>> [email protected] 
>
> Hi David.
>
> Assuming that you want to allow [email protected] to only 
> send to [email protected], then you should be able to do 
> something like this:
>
> smtpd_recipient_restrictions = check_sender_access inline:{ {[email protected] = check_recipient_access inline:{ {[email protected] = ok } }, reject } }
>
> Nick.
>
My apologies. I neglected to account for the restrictions documented 
here: https://www.postfix.org/RESTRICTION_CLASS_README.html

The correct configuration would be something like this instead (NB: 
"..." represents the current setting that you have in your configuration):

smtpd_restriction_classes = check_restricted_senders, check_restricted_senders_allowed_recipients
check_restricted_senders = check_sender_access inline:{[email protected]=check_restricted_senders_allowed_recipients }
check_restricted_senders_allowed_recipients = check_recipient_access inline:{[email protected]=ok }, reject
smtpd_recipient_restrictions = ..., check_restricted_senders
mua_sender_restrictions = ..., check_restricted_senders

BTW The last line is only needed if your master.cf contains the 
following parameter specified for "submission" or "submissions" service:

   -o smtpd_sender_restrictions=$mua_sender_restrictions

Nick.

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]