Zhang Huangbin avatar Zhang Huangbin committed ae63eea

* Control supported backends with global variables:
+ ENABLE_BACKEND_OPENLDAP
+ ENABLE_BACKEND_MYSQL
+ ENABLE_BACKEND_PGSQL
* Add settings in SpamAssassin sample config file for storing Bayesian data in SQL database.

Comments (0)

Files changed (4)

iRedMail/ChangeLog

         + User authentication in Roundcube is case sensitive (login_lc).
 
 iRedMail-0.8.0-beta1:
-    * It now supports PostgreSQL as backend.
+    * It now supports PostgreSQL as backend on Ubuntu 11.10/12.04.
     * Package update:
         + Roundcube webmail -> 0.7.1
 

iRedMail/conf/global

 # Current storage node.
 export STORAGE_NODE='vmail1'
 
+# Enabled backends.
+export ENABLE_BACKEND_OPENLDAP='YES'
+export ENABLE_BACKEND_MYSQL='YES'
+export ENABLE_BACKEND_PGSQL='NO'
+
 # For distribute deployment.
 # MySQL server
 export MYSQL_SERVER='127.0.0.1'
             export DISTRO_CODENAME="oneiric"
         fi
 
+        # Support PGSQL backend since Ubuntu 11.10.
+        if [ X"${DISTRO_CODENAME}" != X"hardy" \
+            -a X"${DISTRO_CODENAME}" != X"intrepid" \
+            -a X"${DISTRO_CODENAME}" != X"jaunty" \
+            -a X"${DISTRO_CODENAME}" != X"karmic" \
+            -a X"${DISTRO_CODENAME}" != X"lucid" \
+            -a X"${DISTRO_CODENAME}" != X"maverick" \
+            -a X"${DISTRO_CODENAME}" != X"natty" \
+            ]; then
+            export ENABLE_BACKEND_PGSQL='YES'
+        fi
+
     elif [ -f /etc/debian_version ]; then
         # Debian
         export DISTRO='DEBIAN'

iRedMail/dialog/config_via_dialog.sh

 # --------------------- Backend --------------------
 # --------------------------------------------------
 # PGSQL is available on Ubuntu 11.04, 11.10.
-if [ X"${DISTRO_CODENAME}" == X"oneiric" \
-    -o X"${DISTRO_CODENAME}" == X"precise" \
-    ]; then
+if [ X"${ENABLE_BACKEND_PGSQL}" == X"YES" ]; then
     ${DIALOG} \
     --title "Choose your preferred backend used to store mail accounts" \
     --radiolist "\

iRedMail/samples/sa.local.cf

 report_safe         0
 lock_method         flock
 
-use_bayes           1
-bayes_auto_learn    1
-bayes_auto_expire   0
+# 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 SQL database
+#bayes_store_module Mail::SpamAssassin::BayesStore::SQL
+# For MySQL
+#bayes_sql_dsn      DBI:mysql:database:sql_server:sql_port
+# For PostgreSQL
+#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
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.