IRedMail/FAQ/Enable.Throttling/RHEL.CentOS

From iRedMail

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by ZhangHuangbin (Talk) to last revision by Shake.chen)
(4 intermediate revisions not shown)
Line 1: Line 1:
iRedMail ships Policyd-1.8.x for sender & recipient throttling, but it's disabled by default. You can enable it by follow below steps on RHEL/CentOS:
iRedMail ships Policyd-1.8.x for sender & recipient throttling, but it's disabled by default. You can enable it by follow below steps on RHEL/CentOS:
-
* Disable throttling in '''/etc/postfix-policyd.conf''':
+
* Disable sender throttling in '''/etc/postfix-policyd.conf''', but enable recipient throttling:
{{cfg|/etc/policyd.conf|<pre>
{{cfg|/etc/policyd.conf|<pre>
SENDERTHROTTLE=0
SENDERTHROTTLE=0
Line 7: Line 7:
SENDER_THROTTLE_HOST=0
SENDER_THROTTLE_HOST=0
-
RECIPIENTTHROTTLE=0
+
RECIPIENTTHROTTLE=0         # <-- Disable recipient throttling in this instance.
</pre>}}
</pre>}}
-
* Enable throttling in '''/etc/postfix-policyd_sender_throttle.conf''':
+
* Enable throttling in '''/etc/policyd_sender_throttle.conf''':
{{cfg|/etc/policyd_sender_throttle.conf|<pre>
{{cfg|/etc/policyd_sender_throttle.conf|<pre>
SENDERTHROTTLE=1
SENDERTHROTTLE=1
SENDER_THROTTLE_SASL=1
SENDER_THROTTLE_SASL=1
-
SENDER_THROTTLE_HOST=1
+
SENDER_THROTTLE_HOST=0
-
RECIPIENTTHROTTLE=1
+
RECIPIENTTHROTTLE=1           # <-- Enable recipient throttling in this instance.
</pre>}}
</pre>}}
-
* Edit '''/etc/init.d/postfix-policyd''', set '''ENABLE_SENDER_THROTTLE='YES'''' to start another policyd instance for throttling:
+
Note: You may only enable '''SENDER_THROTTLE_SASL''' or '''SENDER_THROTTLE_HOST''' but '''NOT''' both.
 +
 
 +
* Edit '''/etc/init.d/policyd''', set '''ENABLE_SENDER_THROTTLE='YES'''' to start another policyd instance for throttling:
{{cfg|/etc/init.d/policyd|<pre>
{{cfg|/etc/init.d/policyd|<pre>
ENABLE_SENDER_THROTTLE="YES"
ENABLE_SENDER_THROTTLE="YES"
Line 46: Line 48:
</pre>}}
</pre>}}
-
That's all. Enjoy. :)
+
That's all.
 +
 
 +
Refer to Policyd official documentation to set throttling: http://policyd.sourceforge.net/readme.html
[[Category: iRedMail]]
[[Category: iRedMail]]

Revision as of 14:09, 26 July 2012

iRedMail ships Policyd-1.8.x for sender & recipient throttling, but it's disabled by default. You can enable it by follow below steps on RHEL/CentOS:

  • Disable sender throttling in /etc/postfix-policyd.conf, but enable recipient throttling:
File: /etc/policyd.conf
SENDERTHROTTLE=0
SENDER_THROTTLE_SASL=0
SENDER_THROTTLE_HOST=0

RECIPIENTTHROTTLE=0         # <-- Disable recipient throttling in this instance.
  • Enable throttling in /etc/policyd_sender_throttle.conf:
File: /etc/policyd_sender_throttle.conf
SENDERTHROTTLE=1
SENDER_THROTTLE_SASL=1
SENDER_THROTTLE_HOST=0

RECIPIENTTHROTTLE=1           # <-- Enable recipient throttling in this instance.

Note: You may only enable SENDER_THROTTLE_SASL or SENDER_THROTTLE_HOST but NOT both.

  • Edit /etc/init.d/policyd, set ENABLE_SENDER_THROTTLE='YES' to start another policyd instance for throttling:
File: /etc/init.d/policyd
ENABLE_SENDER_THROTTLE="YES"
  • Restart policyd service:
Terminal:
# /etc/init.d/policyd restart

It will listen on two ports: 10031, 10032. You can verify it via command netstat:

Terminal:
# netstat -ntlp | grep -i 1003
tcp        0      0 127.0.0.1:10031             0.0.0.0:*                   LISTEN      3454/policyd        
tcp        0      0 127.0.0.1:10032             0.0.0.0:*                   LISTEN      3459/policyd
  • Enable throttling in Postfix /etc/postfix/main.cf:
File: /etc/postfix/main.cf
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10032

Restart postfix:

Terminal:
# /etc/init.d/postfix restart

That's all.

Refer to Policyd official documentation to set throttling: http://policyd.sourceforge.net/readme.html

Personal tools