Commits

Zhang Huangbin committed b602e77

* Move sample config files to new folders: samples/{mysql,spamassassin}/.
* Remove unused sample file: samples/freshclam.init.

  • Participants
  • Parent commits f790b7f

Comments (0)

Files changed (8)

File iRedMail/functions/cleanup.sh

             Y|y|* )
                 backup_file ${MYSQL_MY_CNF}
                 ECHO_INFO "Copy MySQL sample file: ${MYSQL_MY_CNF}."
-                cp -f ${SAMPLE_DIR}/my.cnf ${MYSQL_MY_CNF}
+                cp -f ${SAMPLE_DIR}/mysql/my.cnf ${MYSQL_MY_CNF}
 
                 ECHO_INFO "Enable SSL support for MySQL server."
                 perl -pi -e 's/^#(ssl-cert.*=)(.*)/${1} $ENV{SSL_CERT_FILE}/' ${MYSQL_MY_CNF}

File iRedMail/functions/mysql.sh

     # Warning: We must have 'mysql_enable=YES' before start/stop mysql daemon.
     freebsd_enable_service_in_rc_conf 'mysql_enable' 'YES'
 
-    ECHO_DEBUG "Copy sample/my.cnf to ${MYSQL_MY_CNF}."
     if [ ! -f ${MYSQL_MY_CNF} ]; then
-        cp ${SAMPLE_DIR}/my.cnf ${MYSQL_MY_CNF} &>/dev/null
+        ECHO_DEBUG "Copy sample MySQL config file: ${SAMPLE_DIR}/mysql/my.cnf -> ${MYSQL_MY_CNF}."
+        cp ${SAMPLE_DIR}/mysql/my.cnf ${MYSQL_MY_CNF} &>/dev/null
     fi
 
     # Disable 'skip-networking' in my.cnf.

File iRedMail/functions/spamassassin.sh

 
     backup_file ${SA_LOCAL_CF}
 
-    ECHO_DEBUG "Generate new configuration file: ${SA_LOCAL_CF}."
-    cp -f ${SAMPLE_DIR}/sa.local.cf ${SA_LOCAL_CF}
+    ECHO_DEBUG "Copy sample SpamAssassin config file: ${SAMPLE_DIR}/spamassassin/local.cf -> ${SA_LOCAL_CF}."
+    cp -f ${SAMPLE_DIR}/spamassassin/local.cf ${SA_LOCAL_CF}
 
     #ECHO_DEBUG "Disable plugin: URIDNSBL."
     #perl -pi -e 's/(^loadplugin.*Mail.*SpamAssassin.*Plugin.*URIDNSBL.*)/#${1}/' ${SA_INIT_PRE}

File iRedMail/samples/freshclam.init

-#!/bin/sh
-
-# Author: Zhang Huangbin (zhb _at_ iredmail.org)
-
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-# chkconfig: 345 90 90
-# description: run freshclam as daemon.
-
-. /etc/rc.d/init.d/functions
-
-PROG='freshclam'
-FRESHCLAM_BIN='/usr/bin/freshclam'
-OPTIONS='-d -c 2'
-PID='/var/run/clamav/freshclam.pid'
-
-start()
-{
-    if [ -e ${PID} ]; then
-        echo -n "${PROG} is already running: "
-        echo -n "$(pidof ${PROG})" && success
-        echo
-    else
-        echo -n "Starting ${PROG}:"
-        daemon ${FRESHCLAM_BIN} ${OPTIONS} && success || failure
-        echo
-    fi
-}
-
-stop()
-{
-    if [ -e ${PID} ]; then
-        echo -n "Stopping ${PROG}:"
-        kill $(cat ${PID}) && success || failure
-        echo
-    else
-        echo -n "${PROG} is already stopped." && success
-        echo
-    fi
-}
-
-reload()
-{
-    if [ -e ${PID} ]; then
-        echo -n "Reloading ${PROG}:"
-        kill -HUP $(cat ${PID}) && success || failure
-        echo
-    else
-        echo -n "${PROG} isn't running." && failure
-        echo
-    fi
-}
-
-usage()
-{
-    echo "Usage: $0 [start|stop|restart|status|reload]"
-}
-
-case $1 in
-    start) start ;;
-    stop) stop ;;
-    restart) stop; start ;;
-    status) status ${PROG};;
-    reload) reload ;;
-    *) usage ;;
-esac

File iRedMail/samples/my.cnf

-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-#
-# Sample MySQL configuration file. It should be localted at:
-#
-#   - RHEL/CentOS:  /etc/my.cnf
-#   - FreeBSD (www/mysql56-server): /var/db/mysql/my.cnf
-#
-# Shipped within iRedMail project:
-#   http://www.iredmail.org/
-#
-
-[mysqld]
-#bind-address            = 127.0.0.1
-port                    = 3306
-#default-character-set   = utf8
-#datadir                 = /var/lib/mysql
-#socket                  = /var/lib/mysql/mysql.sock
-#user                    = mysql
-
-#general_log = 1
-#general_log_file = /var/log/mysql.log
-
-#slow_query_log
-#slow_query_log_file = /var/log/mysql_slow.log
-
-skip-external-locking
-#skip-bdb
-#skip-networking
-
-query-cache-type    = 1
-# Use up to 64Mb of RAM to store query results.
-query-cache-size    = 64M
-query_cache_limit   = 10M
-
-thread_cache_size   = 8
-
-#max_connections=1024
-#max_connect_errors=150
-
-# If you got error message like "The total number of locks exceeds the lock table size",
-# please try to increase 'innodb_buffer_pool_size' to a reasonable value.
-# Restarting MySQL server is required to make new value work.
-# You can get current value with SQL command:
-#
-#   mysql> SHOW ENGINE INNODB STATUS \G
-#          [...]
-#          Buffer pool size   512
-#          [...]
-#
-#innodb_buffer_pool_size=512M
-
-# Creates each new table using its own .ibd file for storing data and indexes,
-# rather than in the system tablespace (ibdata*).
-# Reference:
-# http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table
-innodb_file_per_table
-
-#ssl-ca =
-#ssl-cert =
-#ssl-key =
-#ssl-cipher = ALL
-
-[client]
-default-character-set=utf8
-
-#[mysql.server]
-#user        = mysql
-#basedir     = /var/lib
-
-#[mysqld_safe]
-#log-error   = /var/log/mysqld.log
-#pid-file    = /var/run/mysqld/mysqld.pid

File iRedMail/samples/mysql/my.cnf

+#---------------------------------------------------------------------
+# This file is part of iRedMail, which is an open source mail server
+# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
+#
+# iRedMail is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# iRedMail is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
+#---------------------------------------------------------------------
+
+#
+# Sample MySQL configuration file. It should be localted at:
+#
+#   - RHEL/CentOS:  /etc/my.cnf
+#   - FreeBSD (www/mysql56-server): /var/db/mysql/my.cnf
+#
+# Shipped within iRedMail project:
+#   http://www.iredmail.org/
+#
+
+[mysqld]
+#bind-address            = 127.0.0.1
+port                    = 3306
+#default-character-set   = utf8
+#datadir                 = /var/lib/mysql
+#socket                  = /var/lib/mysql/mysql.sock
+#user                    = mysql
+
+#general_log = 1
+#general_log_file = /var/log/mysql.log
+
+#slow_query_log
+#slow_query_log_file = /var/log/mysql_slow.log
+
+skip-external-locking
+#skip-bdb
+#skip-networking
+
+query-cache-type    = 1
+# Use up to 64Mb of RAM to store query results.
+query-cache-size    = 64M
+query_cache_limit   = 10M
+
+thread_cache_size   = 8
+
+#max_connections=1024
+#max_connect_errors=150
+
+# If you got error message like "The total number of locks exceeds the lock table size",
+# please try to increase 'innodb_buffer_pool_size' to a reasonable value.
+# Restarting MySQL server is required to make new value work.
+# You can get current value with SQL command:
+#
+#   mysql> SHOW ENGINE INNODB STATUS \G
+#          [...]
+#          Buffer pool size   512
+#          [...]
+#
+#innodb_buffer_pool_size=512M
+
+# Creates each new table using its own .ibd file for storing data and indexes,
+# rather than in the system tablespace (ibdata*).
+# Reference:
+# http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table
+innodb_file_per_table
+
+#ssl-ca =
+#ssl-cert =
+#ssl-key =
+#ssl-cipher = ALL
+
+[client]
+default-character-set=utf8
+
+#[mysql.server]
+#user        = mysql
+#basedir     = /var/lib
+
+#[mysqld_safe]
+#log-error   = /var/log/mysqld.log
+#pid-file    = /var/run/mysqld/mysqld.pid

File iRedMail/samples/sa.local.cf

-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-#
-# Sample SpamAssassin rules. It should be localted at:
-#   /etc/mail/spamassassin/local.cf
-#
-# Shipped within iRedMail project:
-#   * http://iRedMail.googlecode.com/
-#
-# See also:
-#    $ man Mail::SpamAssassin::Conf
-#
-
-
-# These two lines will not affect due to Amavisd use its
-# own variables setting in /etc/amavisd.conf.
-required_score      5.0
-rewrite_header      subject [ SPAM ]
-
-report_safe         0
-lock_method         flock
-
-# Bayesian support
-# References:
-# - http://wiki.apache.org/spamassassin/BayesInSpamAssassin
-# - http://svn.apache.org/repos/asf/spamassassin/branches/3.3/sql/README.bayes
-# Addition plugin for Roundcube webmail to call sa-learn
-# - http://www.tehinterweb.co.uk/roundcube/#pimarkasjunk2
-#
-use_bayes          1
-bayes_auto_learn   1
-bayes_auto_expire  1
-
-# Store bayesian data in MySQL
-#bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
-#bayes_sql_dsn      DBI:mysql:database:sql_server:sql_port
-
-# Store bayesian data in MySQL
-#bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
-#bayes_sql_dsn      DBI:Pg:database:sql_server:sql_port
-#
-#bayes_sql_username db_username
-#bayes_sql_password db_password
-#
-# Override the username used for storing
-# data in the database. This could be used to group users together to
-# share bayesian filter data. You can also use this config option to
-# trick sa-learn to learn data as a specific user.
-#
-#bayes_sql_override_username vmail
-
-score ALL_TRUSTED -10.000
-
-# Turn off ALL DNSBL (DNS Blocklists)
-#skip_rbl_checks  1
-# Turn off DNSBL: rhsbl.ahbl.org.
-# Check /usr/share/spamassassin/20_dnsbl_teest.cf to see the rule name.
-score DNS_FROM_AHBL_RHSBL 0
-
-score URIBL_AB_SURBL 0 0.3306 0 0.3812
-score URIBL_JP_SURBL 0 0.3360 0 0.4087
-score URIBL_OB_SURBL 0 0.2617 0 0.3008
-score URIBL_PH_SURBL 0 0.2240 0 0.2800
-score URIBL_SBL 0 0.1094 0 0.1639
-score URIBL_SC_SURBL 0 0.3600 0 0.4498
-score URIBL_WS_SURBL 0 0.1533 0 0.2140
-
-# For Mail::SPF
-spf_timeout         5
-
-# For SpamAssassin-3.2.x. Reference:
-# http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_SPF.html
-#do_not_use_mail_spf 0
-#do_not_use_mail_spf_query   1
-#ignore_received_spf_header  1
-
-# Trusted networks. Examples:
-#   192.168/16            # all in 192.168.*.*
-#   212.17.35.15          # just that host
-#   !10.0.1.5 10.0.1/24   # all in 10.0.1.* but not 10.0.1.5
-#   DEAD:BEEF::/32        # all in that ipv6 prefix
-# Local host (127.0.0.1) will automatically be trusted implicitly.
-#trusted_networks 192.168/16
-
-# Whitelist from SPF.
-#whitelist_from_spf joe@example.com fred@example.com
-#whitelist_from_spf *@example.com
-
-# Whitelist from DKIM.
-loadplugin Mail::SpamAssassin::Plugin::DKIM
-whitelist_from_dkim *@paypal.com
-whitelist_from_dkim *@linkedin.com
-whitelist_from_dkim *@twitter.com
-whitelist_from_dkim *@bounce.twitter.com
-
-# Whitelist domains.
-# Reference: http://wiki.apache.org/spamassassin/ManualWhitelist
-#whitelist_from         *@gmail.com
-
-# Locales.
-ok_locales          all
-
-# Some sample custom file rules. Refer to SpamAssassin wiki site for more
-# details: http://wiki.apache.org/spamassassin/WritingRules
-#
-# Filter Headers.
-# -- Subject
-#header LOCAL_DEMONSTRATION_SUBJECT      Subject =~ /\btest\b/i
-#score LOCAL_DEMONSTRATION_SUBJECT       0.1
-# -- From
-#header LOCAL_DEMONSTRATION_FROM From =~ /test\.com/i
-#score LOCAL_DEMONSTRATION_FROM  0.1
-# -- Look at all the headers and match if any of them contain the specified regex:
-#header LOCAL_DEMONSTRATION_ALL  ALL =~ /test\.com/i
-#score LOCAL_DEMONSTRATION_ALL   0.1
-#
-# Filter mail body.
-#body LOCAL_DEMONSTRATION_RULE /test/
-#score LOCAL_DEMONSTRATION_RULE 0.1
-#describe LOCAL_DEMONSTRATION_RULE This is a simple test rule
-
-# Decrease score for authenticated senders.
-# IMPORTANT NOTES:
-#
-#   1) Please replace 'your\.server\.com' by the value of Postfix parameter
-#      "myhostname".
-#   2) Please set 'smtpd_sasl_authenticated_header = yes' in Postfix main.cf.
-#
-#header AUTHENTICATED_SENDER Received =~ /Authenticated\ sender\:.*by\ your\.server\.com/
-#describe AUTHENTICATED_SENDER Header 'Received:' contains 'Authenticated sender:'
-#score AUTHENTICATED_SENDER -3

File iRedMail/samples/spamassassin/sa.local.cf

+#---------------------------------------------------------------------
+# This file is part of iRedMail, which is an open source mail server
+# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
+#
+# iRedMail is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# iRedMail is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
+#---------------------------------------------------------------------
+
+#
+# Sample SpamAssassin rules. It should be localted at:
+#   /etc/mail/spamassassin/local.cf
+#
+# Shipped within iRedMail project:
+#   * http://iRedMail.googlecode.com/
+#
+# See also:
+#    $ man Mail::SpamAssassin::Conf
+#
+
+
+# These two lines will not affect due to Amavisd use its
+# own variables setting in /etc/amavisd.conf.
+required_score      5.0
+rewrite_header      subject [ SPAM ]
+
+report_safe         0
+lock_method         flock
+
+# Bayesian support
+# References:
+# - http://wiki.apache.org/spamassassin/BayesInSpamAssassin
+# - http://svn.apache.org/repos/asf/spamassassin/branches/3.3/sql/README.bayes
+# Addition plugin for Roundcube webmail to call sa-learn
+# - http://www.tehinterweb.co.uk/roundcube/#pimarkasjunk2
+#
+use_bayes          1
+bayes_auto_learn   1
+bayes_auto_expire  1
+
+# Store bayesian data in MySQL
+#bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
+#bayes_sql_dsn      DBI:mysql:database:sql_server:sql_port
+
+# Store bayesian data in MySQL
+#bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
+#bayes_sql_dsn      DBI:Pg:database:sql_server:sql_port
+#
+#bayes_sql_username db_username
+#bayes_sql_password db_password
+#
+# Override the username used for storing
+# data in the database. This could be used to group users together to
+# share bayesian filter data. You can also use this config option to
+# trick sa-learn to learn data as a specific user.
+#
+#bayes_sql_override_username vmail
+
+score ALL_TRUSTED -10.000
+
+# Turn off ALL DNSBL (DNS Blocklists)
+#skip_rbl_checks  1
+# Turn off DNSBL: rhsbl.ahbl.org.
+# Check /usr/share/spamassassin/20_dnsbl_teest.cf to see the rule name.
+score DNS_FROM_AHBL_RHSBL 0
+
+score URIBL_AB_SURBL 0 0.3306 0 0.3812
+score URIBL_JP_SURBL 0 0.3360 0 0.4087
+score URIBL_OB_SURBL 0 0.2617 0 0.3008
+score URIBL_PH_SURBL 0 0.2240 0 0.2800
+score URIBL_SBL 0 0.1094 0 0.1639
+score URIBL_SC_SURBL 0 0.3600 0 0.4498
+score URIBL_WS_SURBL 0 0.1533 0 0.2140
+
+# For Mail::SPF
+spf_timeout         5
+
+# For SpamAssassin-3.2.x. Reference:
+# http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_SPF.html
+#do_not_use_mail_spf 0
+#do_not_use_mail_spf_query   1
+#ignore_received_spf_header  1
+
+# Trusted networks. Examples:
+#   192.168/16            # all in 192.168.*.*
+#   212.17.35.15          # just that host
+#   !10.0.1.5 10.0.1/24   # all in 10.0.1.* but not 10.0.1.5
+#   DEAD:BEEF::/32        # all in that ipv6 prefix
+# Local host (127.0.0.1) will automatically be trusted implicitly.
+#trusted_networks 192.168/16
+
+# Whitelist from SPF.
+#whitelist_from_spf joe@example.com fred@example.com
+#whitelist_from_spf *@example.com
+
+# Whitelist from DKIM.
+loadplugin Mail::SpamAssassin::Plugin::DKIM
+whitelist_from_dkim *@paypal.com
+whitelist_from_dkim *@linkedin.com
+whitelist_from_dkim *@twitter.com
+whitelist_from_dkim *@bounce.twitter.com
+
+# Whitelist domains.
+# Reference: http://wiki.apache.org/spamassassin/ManualWhitelist
+#whitelist_from         *@gmail.com
+
+# Locales.
+ok_locales          all
+
+# Some sample custom file rules. Refer to SpamAssassin wiki site for more
+# details: http://wiki.apache.org/spamassassin/WritingRules
+#
+# Filter Headers.
+# -- Subject
+#header LOCAL_DEMONSTRATION_SUBJECT      Subject =~ /\btest\b/i
+#score LOCAL_DEMONSTRATION_SUBJECT       0.1
+# -- From
+#header LOCAL_DEMONSTRATION_FROM From =~ /test\.com/i
+#score LOCAL_DEMONSTRATION_FROM  0.1
+# -- Look at all the headers and match if any of them contain the specified regex:
+#header LOCAL_DEMONSTRATION_ALL  ALL =~ /test\.com/i
+#score LOCAL_DEMONSTRATION_ALL   0.1
+#
+# Filter mail body.
+#body LOCAL_DEMONSTRATION_RULE /test/
+#score LOCAL_DEMONSTRATION_RULE 0.1
+#describe LOCAL_DEMONSTRATION_RULE This is a simple test rule
+
+# Decrease score for authenticated senders.
+# IMPORTANT NOTES:
+#
+#   1) Please replace 'your\.server\.com' by the value of Postfix parameter
+#      "myhostname".
+#   2) Please set 'smtpd_sasl_authenticated_header = yes' in Postfix main.cf.
+#
+#header AUTHENTICATED_SENDER Received =~ /Authenticated\ sender\:.*by\ your\.server\.com/
+#describe AUTHENTICATED_SENDER Header 'Received:' contains 'Authenticated sender:'
+#score AUTHENTICATED_SENDER -3