Reject external mails to certain aliases

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reject external mails to certain aliases

Roberto Carna
We need to reject external mails coming from Internet to certain aliases from our Postfix email domain, but we have to permit internal mails to these given aliases.

In this way:

Internet --> [hidden email] REJECT

Is it possible?

Special thanks !!!

Reply | Threaded
Open this post in threaded view
|

Re: Reject external mails to certain aliases

Nick-5
On 2020-04-03 17:42 BST, Roberto Carna wrote:
> Internet --> [hidden email] REJECT
> [hidden email] --> [hidden email] PERMIT
>
> Is it possible?

Yes, with check_recipient_access.  Set it to a list of the
internal-only aliases, rejecting all of them.  E.g.

   smtpd_recipient_restrictions =
      ...
      check_recipient_access hash:/etc/postfix/check-recipient-access-inbound

In check-recipient-access-inbound,

   internal-only@    REJECT My hovercraft is full of eels
   
Ensure it's set for smtpd only and not for submission.

HTH,
--
Nick