Commits

Zhang Huangbin committed 44de1ed

Increase default Amavisd prefork children to 10 (default is 2).

  • Participants
  • Parent commits 519e99d

Comments (0)

Files changed (3)

File iRedMail/ChangeLog

     * Drop support for below releases:
         - Ubuntu 13.04, 13.10
 
+    * Increase default Amavisd prefork children to 10 (default is 2).
     * Allows sasl authentication ONLY over a TLS-encrypted smtp connection.
     * Enable LMTP service in Dovecot by default.
       To use LMTP instead of Dovecot LDA as per-domain or per-user local

File iRedMail/conf/amavisd

 export AMAVISD_LOGFILE='/var/log/amavisd.log'
 export AMAVISD_LOGROTATE_FILE="${LOGROTATE_DIR}/amavisd"
 export AMAVISD_DKIM_SELECTOR='dkim'
-export AMAVISD_DKIM_DIR='/var/lib/dkim'
 export AMAVISD_RC_SCRIPT_NAME='amavisd'
 
+# Num of pre-forked children.
+export AMAVISD_MAX_SERVERS='10'
+
+export AMAVISD_DKIM_DIR='/var/lib/dkim'
 export AMAVISD_VIRUSMAILS_DIR='/var/virusmails'
 
 # Database used to store incoming & outgoing email related information.

File iRedMail/functions/amavisd.sh

     cat >> ${TIP_FILE} <<EOF
 DNS record for DKIM support:
 
+EOF
+    if [ X"${DISTRO}" == X'RHEL' ]; then
+        cat >> ${TIP_FILE} <<EOF
 $(${AMAVISD_BIN} -c ${AMAVISD_CONF} showkeys 2>/dev/null)
-
 EOF
+    else
+        cat >> ${TIP_FILE} <<EOF
+$(${AMAVISD_BIN} showkeys 2>/dev/null)
+EOF
+    fi
 
     echo 'export status_amavisd_dkim="DONE"' >> ${STATUS_FILE}
 }
 
     cat >> ${AMAVISD_CONF} <<EOF
 
+# Num of pre-forked children.
+# WARNING: it must match (equal to or larger than) the number set in
+# /etc/postfix/master.cf "maxproc" column for the 'smtp-amavis' service.
+\$max_servers = ${AMAVISD_MAX_SERVERS};
+
 1;  # insure a defined return
 EOF
     # ------------- END configure /etc/amavisd.conf ------------
 
     # Configure postfix: master.cf.
     cat >> ${POSTFIX_FILE_MASTER_CF} <<EOF
-smtp-amavis unix -  -   -   -   2  smtp
+smtp-amavis unix -  -   -   -   ${AMAVISD_MAX_SERVERS}  smtp
     -o smtp_data_done_timeout=1200
     -o smtp_send_xforward_command=yes
     -o disable_dns_lookups=yes