In postfix can we restrict inbound mails from gmail.com, and other free domains if they have more than one recipient?

Following conditions to consider:

  1. Email is from Free Email domain like gmail.com, hotmail.com, etc, have one recipient address then it is ok and mail will be delivered to recipient address.

  2. Email have more than one recipient address then mail will be forwarded to alternate email address so the administrator can review the mail before delivery to end users.

  3. Deny emails to Group accounts from free domains like gmail.com


The bad news is postfix doesn't support the complex rules in its built-in mechanisms

The good news is postfix can delegate decisions to an external policy server. Policy delegation is now the preferred method for adding policies to Postfix. It's much easier to develop a new feature in few lines of Perl, Python, Ruby, or TCL, than trying to do the same in C code.

The example of external policy server for your needs is policyd and postfwd. See this Postfix Addon page for other options.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.