From: Dinko Korunic <Dinko.Korunic@CARNet.hr>
Date: Tue, 16 Oct 2007 14:47:54 +0000 (+0000)
Subject: r11: - enable DCC plugin
X-Git-Tag: v3.3.1-1~19
X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=3173912c8a40b82b62ef2c5cb5e34bb75c535380;p=spamassassin-cn.git

r11: - enable DCC plugin
- enable DKIM plugin
---

diff --git a/debian/control b/debian/control
index d4783c6..efbd1ba 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
 
 Package: spamassassin-cn
 Architecture: all
-Depends: spamassassin (>= 3.1.7-1~bpo.1), razor (>= 2.670-1sarge2), libnet-dns-perl, carnet-tools-cn (>= 2.0), dcc-client (>= 1.2.74-2), gnupg (>= 1.4.1-1.sarge7), ${misc:Depends}
+Depends: spamassassin (>= 3.1.7-1~bpo.1), razor (>= 2.670-1sarge2), libnet-dns-perl, carnet-tools-cn (>= 2.0), dcc-client (>= 1.2.74-2), gnupg (>= 1.4.1-1.sarge7), libmail-dkim-perl (>= 0.19-3), ${misc:Depends}
 Conflicts: pyzor (<< 1:0.4.0+cvs20030201-3)
 Recommends: amavis
 Description: Perl-based spam filter using text analysis
diff --git a/debian/postinst b/debian/postinst
index 0fc4320..ed61747 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -208,6 +208,30 @@ if [ -f $examdir/local.cf ]; then
     rm -f $confdir/local.cf.$$
 fi
 
+# enable requested plugins in SA
+list=$(find /etc/spamassassin -type -f -name 'v*.pre')
+for i in $list; do
+    # enable DCC if requested
+    if [ "$use_dcc" = "true" ]; then
+        plugin="loadplugin Mail::SpamAssassin::Plugin::DCC"
+        cp_check_and_sed "^.*#.*$plugin.*$" \
+            "s/^.*#.*$plugin.*$/$plugin/g" $i.$$ || true
+        if ! cmp -s $i.$$ $i; then
+            mv -f $i.$$ $i
+        fi
+        rm -f $i.$$
+    fi
+
+    # enable DKIM
+    plugin="loadplugin Mail::SpamAssassin::Plugin::DKIM"
+    cp_check_and_sed "^.*#.*$plugin.*$" \
+        "s/^.*#.*$plugin.*$/$plugin/g" $i.$$ || true
+    if ! cmp -s $i.$$ $i; then
+        mv -f $i.$$ $i
+    fi
+    rm -f $i.$$
+done
+
 # check and replace /etc/default/spamasassin if needed
 if [ "$run_service" = "true" -a \
         -f $examdir/etc-default-spamassassin-$run_as_user ]; then