0

Can any one help me bypassing smtpd_recipient_limit to 100 or 150 for a single domain in postfix ?

Apart from those domain all other domains smtpd_recipient_limit should be 50.

Anand Shrestha
  • 41
  • 5
  • 12

1 Answers1

1

This is a global setting that affects on how many recipients there can be for a single message.

smtpd_recipient_limit (default: 1000)

The maximal number of recipients that the Postfix SMTP server accepts per message delivery request.

Therefore, there is no way to set this by domain, since it affects the whole SMTPD in use.

You haven't specified what you mean by for a single domain; as it doesn't make any sense that this would be the domain of recipients, because the same message may and most likely have recipients across several domains, I assume you wan't to use different policy per sender domain. However, it's not possible to set this based on the domain in MAIL FROM SMTP command, alone.

You could have separate submission settings for different clients, if you use more than one port for submission. That's exactly how the submission is arranged in the first place, as you could have SMTPD listening simultaneously on port 25 (for other MTAs), 587 (submission) and 465 (smtps).

Here's an example of master.conf lines (submission settings unrelated to the question removed):

# Submission on standard port 587
submission inet n - - - - smtpd
  -o smtpd_recipient_limit=50
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sender_restrictions=reject_sender_login_mismatch
  -o smtpd_sender_login_maps=hash:/etc/postfix/virtual

# Submission for users allowed to add more recipients (port 5870)
5870 inet n - - - - smtpd
  -o smtpd_recipient_limit=150
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sender_restrictions=reject_sender_login_mismatch
  -o smtpd_sender_login_maps=hash:/etc/postfix/more_recipients

In this example, /etc/postfix/more_recipients set in smtpd_sender_login_maps specifies SALS authenticated users & addresses they are allowed to use while using this additional submission on port 5870, just like the /etc/postfix/virtual binds addresses with users on the normal submissions, when the reject_sender_login_mismatch is used.

Likewise, you could use smtpd_sender_restrictions = check_sender_access type:table.

However, these are quite advanced settings and it may be hard to get this all together, if you are new to Postfix. I'd recommend simply to raise this setting for all users, instead, as it's already so much lower than the default value of 1000.

Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129
  • Thank you. So the domain defined on more_recipients section should use 5870 port to send emails, right ? – Anand Shrestha Aug 08 '17 at 10:49
  • In order to apply these different settings, yes. However, this is not a complete setup you can copy/paste, but you have to duplicate other submission settings from your configuration, create the sender-login maps etc. – Esa Jokinen Aug 08 '17 at 11:14
  • Could mails matching a sender domain be sent to a smptd daemon like the 5870 with a lower limit, while others are not? – sebix Aug 08 '17 at 19:33