IRedMail/FAQ/Enable.Throttling/Debian.Ubuntu
From iRedMail
(Difference between revisions)
| Line 2: | Line 2: | ||
* Disable sender throttling in '''/etc/postfix-policyd.conf''', but enable recipient throttling: | * Disable sender throttling in '''/etc/postfix-policyd.conf''', but enable recipient throttling: | ||
| - | {{cfg|/etc/policyd.conf|<pre> | + | {{cfg|/etc/postfix-policyd.conf|<pre> |
SENDERTHROTTLE=0 | SENDERTHROTTLE=0 | ||
SENDER_THROTTLE_SASL=0 | SENDER_THROTTLE_SASL=0 | ||
| Line 10: | Line 10: | ||
</pre>}} | </pre>}} | ||
| - | * Enable throttling in '''/etc/postfix- | + | * Enable throttling in '''/etc/postfix-policyd_throttle.conf''': |
| - | {{cfg|/etc/postfix- | + | {{cfg|/etc/postfix-policyd_throttle.conf|<pre> |
SENDERTHROTTLE=1 | SENDERTHROTTLE=1 | ||
SENDER_THROTTLE_SASL=1 | SENDER_THROTTLE_SASL=1 | ||
| Line 28: | Line 28: | ||
# | # | ||
# ---- Change below variables ---- | # ---- Change below variables ---- | ||
| - | CONFIG='/etc/postfix- | + | CONFIG='/etc/postfix-policyd_throttle.conf' |
| - | PIDFILE='/var/run/ | + | PIDFILE='/var/run/policyd_throttle.pid' |
# | # | ||
Revision as of 04:59, 13 September 2011
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 Debian:
- Disable sender throttling in /etc/postfix-policyd.conf, but enable recipient throttling:
| File: /etc/postfix-policyd.conf |
SENDERTHROTTLE=0 SENDER_THROTTLE_SASL=0 SENDER_THROTTLE_HOST=0 RECIPIENTTHROTTLE=1 # <-- Enable recipient throttling in this instance. |
- Enable throttling in /etc/postfix-policyd_throttle.conf:
| File: /etc/postfix-policyd_throttle.conf |
SENDERTHROTTLE=1 SENDER_THROTTLE_SASL=1 SENDER_THROTTLE_HOST=0 RECIPIENTTHROTTLE=0 # <-- Disable recipient throttling in this instance. |
- Copy /etc/init.d/postfix-policyd to /etc/init.d/postfix-policyd_sender_throttle, change file locations of PID and config file, comment 3 lines:
| File: /etc/init.d/postfix-policyd_sender_throttle |
# # ---- Change provides in file header ---- # # Provides: postfix-policyd_sender_throttle # # ---- Change below variables ---- CONFIG='/etc/postfix-policyd_throttle.conf' PIDFILE='/var/run/policyd_throttle.pid' # # ---- Comment below 3 lines ---- # #if [ -f /etc/default/postfix-policyd ] ; then # . /etc/default/postfix-policyd #fi |
- Start policyd via /etc/init.d/postfix-policyd_sender_throttle:
| Terminal: |
# update-rc.d postfix-policyd_sender_throttle defaults # /etc/init.d/postfix-policyd_sender_throttle restart # /etc/init.d/postfix-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
