diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e594810
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.rpm
+*.log
+*spec-20*
+*.tar.xz
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..79ec14b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+# Makefile for source rpm: smeserver-spamassassin
+# $Id: Makefile,v 1.1 2016/02/05 23:26:20 stephdl Exp $
+NAME := smeserver-spamassassin
+SPECFILE = $(firstword $(wildcard *.spec))
+
+define find-makefile-common
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+endef
+
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
+
+ifeq ($(MAKEFILE_COMMON),)
+# attept a checkout
+define checkout-makefile-common
+test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+endef
+
+MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
+endif
+
+include $(MAKEFILE_COMMON)
diff --git a/README.md b/README.md
index 84ea779..e8254f5 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,17 @@
-# smeserver-spamassassin
+# smeserver-spamassassin
-SMEServer Koozali developed git repo for smeserver-spamassassin smeserver
\ No newline at end of file
+SMEServer Koozali developed git repo for smeserver-spamassassin smeserver
+
+## Wiki
+
https://wiki.koozali.org/
+
+## Bugzilla
+Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-spamassassin&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
+
+## Description
+
+
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
+*Once it has been checked, then this comment will be deleted*
+
+
+SpamAssassin is a powerful anti-spam software that helps protect users from unwanted and malicious emails. It works by analyzing email content, headers, and other data to identify spam with high accuracy. SpamAssassin works with your existing mail server and can be used with a wide variety of email clients. It can even be used to provide additional protection against malware and phishing attacks. With its effective and efficient filtering capabilities, SpamAssassin is a great way to keep your inbox free from unsolicited emails.
diff --git a/contriborbase b/contriborbase
new file mode 100644
index 0000000..ef36a67
--- /dev/null
+++ b/contriborbase
@@ -0,0 +1 @@
+sme10
diff --git a/createlinks b/createlinks
new file mode 100644
index 0000000..3043b6e
--- /dev/null
+++ b/createlinks
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+
+use esmith::Build::CreateLinks qw(:all);
+use File::Basename;
+use File::Path;
+
+#--------------------------------------------------
+# functions for manager panel
+#--------------------------------------------------
+# my $panel = "manager";
+
+# panel_link("otheremail", $panel);
+
+my $event;
+
+foreach (qw(
+ /etc/mail/spamassassin/local.cf
+ /etc/sysconfig/spamassassin
+ ))
+{
+ templates2events("$_",qw(
+ post-install
+ post-upgrade
+ bootstrap-console-save
+ console-save
+ email-update
+ smeserver-spamassassin-update
+ ));
+}
+
+# spamassassin-update events
+$event="smeserver-spamassassin-update";
+event_link("systemd-default", $event, "88"); # updates all the service files etc
+event_link("systemd-reload", $event, "89"); # systemctl daemon-reload
+event_link("spamassassin-update", $event, "99"); # Hopefully restarts spamassassin
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/spamassassin");
+templates2events("/etc/rsyslog.conf",$event);
+templates2events("/etc/sysconfig/spamassassin",$event);
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
+
+# email-update events required?
+$event = "email-update";
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/spamassassin");
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/DNSAvailable b/root/etc/e-smith/db/configuration/defaults/spamassassin/DNSAvailable
new file mode 100644
index 0000000..7cfab5b
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/DNSAvailable
@@ -0,0 +1 @@
+yes
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLanguages b/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLanguages
new file mode 100644
index 0000000..0702cb5
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLanguages
@@ -0,0 +1 @@
+all
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLocales b/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLocales
new file mode 100644
index 0000000..0702cb5
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/OkLocales
@@ -0,0 +1 @@
+all
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/RejectLevel b/root/etc/e-smith/db/configuration/defaults/spamassassin/RejectLevel
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/RejectLevel
@@ -0,0 +1 @@
+0
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/ReportSafe b/root/etc/e-smith/db/configuration/defaults/spamassassin/ReportSafe
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/ReportSafe
@@ -0,0 +1 @@
+0
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/Sensitivity b/root/etc/e-smith/db/configuration/defaults/spamassassin/Sensitivity
new file mode 100644
index 0000000..d343e57
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/Sensitivity
@@ -0,0 +1 @@
+medium
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/SkipRBLChecks b/root/etc/e-smith/db/configuration/defaults/spamassassin/SkipRBLChecks
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/SkipRBLChecks
@@ -0,0 +1 @@
+0
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/SortSpam b/root/etc/e-smith/db/configuration/defaults/spamassassin/SortSpam
new file mode 100644
index 0000000..86981e6
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/SortSpam
@@ -0,0 +1 @@
+enabled
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/Subject b/root/etc/e-smith/db/configuration/defaults/spamassassin/Subject
new file mode 100644
index 0000000..6e8c55f
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/Subject
@@ -0,0 +1 @@
+[SPAM]
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/SubjectTag b/root/etc/e-smith/db/configuration/defaults/spamassassin/SubjectTag
new file mode 100644
index 0000000..7a68b11
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/SubjectTag
@@ -0,0 +1 @@
+disabled
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/TagLevel b/root/etc/e-smith/db/configuration/defaults/spamassassin/TagLevel
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/TagLevel
@@ -0,0 +1 @@
+5
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/UseBayes b/root/etc/e-smith/db/configuration/defaults/spamassassin/UseBayes
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/UseBayes
@@ -0,0 +1 @@
+0
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/status b/root/etc/e-smith/db/configuration/defaults/spamassassin/status
new file mode 100644
index 0000000..7a68b11
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/status
@@ -0,0 +1 @@
+disabled
diff --git a/root/etc/e-smith/db/configuration/defaults/spamassassin/type b/root/etc/e-smith/db/configuration/defaults/spamassassin/type
new file mode 100644
index 0000000..24e1098
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/defaults/spamassassin/type
@@ -0,0 +1 @@
+service
diff --git a/root/etc/e-smith/db/configuration/migrate/10spamassassin b/root/etc/e-smith/db/configuration/migrate/10spamassassin
new file mode 100644
index 0000000..f0453fe
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/migrate/10spamassassin
@@ -0,0 +1,46 @@
+{
+ my $sa = $DB->get("spamassassin") or return;
+
+ my %old2new = (
+ required_hits => "TagLevel",
+ skip_rbl_checks => "SkipRBLChecks",
+ sort_spam => "SortSpam",
+ use_bayes => "UseBayes",
+ );
+
+ for my $key (keys %old2new)
+ {
+ next unless (exists $spamassassin{$key});
+
+ my $value = $DB->get_prop_and_delete('spamassassin', $key);
+
+ $DB->set_prop('spamassassin', $old2new{$key}, $value);
+ }
+
+ my $sortspam = $DB->get_prop('spamassassin', 'SortSpam');
+
+ if ($sortspam eq "0" or $sortspam eq "1")
+ {
+ $DB->set_prop('spamassassin', 'SortSpam',
+ ($sortspam eq "1") ? "enabled" : "disabled");
+ }
+
+ my $value = $DB->get_prop_and_delete('spamassassin', 'rewrite_subject');
+
+ if (defined $value)
+ {
+ $DB->set_prop('spamassassin', 'SubjectTag',
+ ($value ? 'enabled' : 'disabled'));
+ }
+
+ # migrate only interesting value from spamd and delete it
+ my $spamd = $DB->get("spamd");
+ if ($spamd){
+ my $SpamLearning = $DB->get_prop('spamassassin', 'SpamLearning') || "empty";
+ if ( exists $spamd{'SpamLearning'} && ! exists $spamassassin{'SpamLearning'} ) {
+ $DB->set_prop('spamassassin', 'SpamLearning', $spamd{'SpamLearning'});
+ }
+ $spamd->delete;
+ }
+
+}
diff --git a/root/etc/e-smith/db/configuration/migrate/20sortspam b/root/etc/e-smith/db/configuration/migrate/20sortspam
new file mode 100644
index 0000000..a4b2b6b
--- /dev/null
+++ b/root/etc/e-smith/db/configuration/migrate/20sortspam
@@ -0,0 +1,11 @@
+{
+ my $dt = $DB->get_prop("qmail", "DeliveryType");
+ my $di = $DB->get_prop("qmail", "DeliveryInstruction");
+
+ return unless ($dt and $di);
+
+ return unless ($dt eq 'program' and $di eq 'sortspam');
+
+ $DB->set_prop("qmail", "DeliveryType", "");
+ $DB->set_prop("qmail", "DeliveryInstruction", "");
+}
diff --git a/root/etc/e-smith/db/spamassassin/defaults/wbl.global/type b/root/etc/e-smith/db/spamassassin/defaults/wbl.global/type
new file mode 100644
index 0000000..b92b8b7
--- /dev/null
+++ b/root/etc/e-smith/db/spamassassin/defaults/wbl.global/type
@@ -0,0 +1 @@
+list
diff --git a/root/etc/e-smith/db/spamassassin/defaults/wbl.global_to/type b/root/etc/e-smith/db/spamassassin/defaults/wbl.global_to/type
new file mode 100644
index 0000000..b92b8b7
--- /dev/null
+++ b/root/etc/e-smith/db/spamassassin/defaults/wbl.global_to/type
@@ -0,0 +1 @@
+list
diff --git a/root/etc/e-smith/templates-user/.qmail/15sortspam b/root/etc/e-smith/templates-user/.qmail/15sortspam
new file mode 100644
index 0000000..136fd62
--- /dev/null
+++ b/root/etc/e-smith/templates-user/.qmail/15sortspam
@@ -0,0 +1,16 @@
+{
+ use esmith::AccountsDB;
+
+ my $db = esmith::AccountsDB->open_ro or return "# AccountsDB: open failed";
+
+ my $user = $db->get($USERNAME) or return "# AccountsDB: No user $USERNAME";
+
+ my $do_sortspam = $user->prop('SortSpam')
+ || $spamassassin{SortSpam}
+ || "enabled";
+
+ return "# sortspam disabled" unless ($do_sortspam eq "enabled");
+
+ return qq(| condredirect $USERNAME-junkmail headermatch 'X-Spam-Status: Yes');
+
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10dns_available b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10dns_available
new file mode 100644
index 0000000..ef45420
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10dns_available
@@ -0,0 +1,3 @@
+{
+ return "dns_available " . ($spamassassin{DNSAvailable} || 'yes');
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10internal_networks b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10internal_networks
new file mode 100644
index 0000000..0254eca
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10internal_networks
@@ -0,0 +1 @@
+{ "internal_networks $LocalIP" }
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10lock_method b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10lock_method
new file mode 100644
index 0000000..31d4091
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10lock_method
@@ -0,0 +1 @@
+{ "lock_method flock" }
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_languages b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_languages
new file mode 100644
index 0000000..d905842
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_languages
@@ -0,0 +1,7 @@
+{
+ $langs = ($spamassassin{OkLanguages} || 'all');
+ return "" if $langs eq 'all';
+ $OUT = "loadplugin Mail::SpamAssassin::Plugin::TextCat\n";
+ $OUT .= "ok_languages $langs";
+ return $OUT;
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_locales b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_locales
new file mode 100644
index 0000000..dd6ebde
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10ok_locales
@@ -0,0 +1,3 @@
+{
+ return "ok_locales " . ($spamassassin{OkLocales} || 'all');
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10paths b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10paths
new file mode 100644
index 0000000..1ba6631
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10paths
@@ -0,0 +1,2 @@
+bayes_path /var/spool/spamd/.spamassassin/bayes
+bayes_file_mode 750
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10report_safe b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10report_safe
new file mode 100644
index 0000000..08e9099
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10report_safe
@@ -0,0 +1,3 @@
+{
+ return "report_safe " . ($spamassassin{ReportSafe} || 0);
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10required_score b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10required_score
new file mode 100644
index 0000000..e37695b
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10required_score
@@ -0,0 +1,16 @@
+{
+ my $sens = $spamassassin{Sensitivity} || 'medium';
+
+ my %sens2hits = (
+ 'veryhigh' => 2,
+ 'high' => 3,
+ 'medium' => 5,
+ 'low' => 7,
+ 'verylow' => 9,
+ );
+
+ my $hits = ($sens eq 'custom') ? $spamassassin{TagLevel}
+ : $sens2hits{$sens};
+
+ return "required_score $hits";
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10rewrite_subject b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10rewrite_subject
new file mode 100644
index 0000000..d52b9c3
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10rewrite_subject
@@ -0,0 +1,7 @@
+{
+ return "" unless ($spamassassin{SubjectTag} eq 'enabled');
+
+ return "" unless ($spamassassin{Subject});
+
+ return "rewrite_header Subject $spamassassin{Subject}";
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10skip_rbl_checks b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10skip_rbl_checks
new file mode 100644
index 0000000..ad0f560
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10skip_rbl_checks
@@ -0,0 +1,3 @@
+{
+ return "skip_rbl_checks " . ($spamassassin{SkipRBLChecks} || 0);
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10trusted_networks b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10trusted_networks
new file mode 100644
index 0000000..d4fedf9
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10trusted_networks
@@ -0,0 +1,4 @@
+{
+ $OUT = "clear_trusted_networks\n";
+ $OUT .= "trusted_networks $LocalIP " . ($spamassassin{TrustedNetworks} || '');
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_auto_whitelist b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_auto_whitelist
new file mode 100644
index 0000000..a645df3
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_auto_whitelist
@@ -0,0 +1,8 @@
+{
+ if (($spamassassin{UseAutoWhitelist} || "0") eq "1")
+ {
+ $OUT = "use_auto_whitelist 1\n";
+ $OUT .= "auto_whitelist_path /var/spool/spamd/.spamassassin/auto-whitelist\n";
+ $OUT .= "auto_whitelist_file_mode 750\n";
+ }
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes
new file mode 100644
index 0000000..1f7de4f
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes
@@ -0,0 +1,3 @@
+{
+ return "use_bayes " . ($spamassassin{UseBayes} || 0);
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes_auto_learn b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes_auto_learn
new file mode 100644
index 0000000..034dbd5
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/10use_bayes_auto_learn
@@ -0,0 +1,18 @@
+{
+ return "# bayes disabled" unless $spamassassin{UseBayes};
+
+ my $AutoLearn = $spamassassin{UseBayesAutoLearn} || 0;
+ # default SA value of 12 is too high
+ my $BayesAutoLearnThresholdSpam = $spamassassin{'BayesAutoLearnThresholdSpam'}||6;
+ # 0.10 is spamassassin default but it is too high, set to -1.15.
+ my $BayesAutoLearnThresholdNonspam = $spamassassin{'BayesAutoLearnThresholdNonSpam'}|| -1.15;
+
+ # should get at least 6: 3 from body and 3 from header.
+ # http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_AutoLearnThreshold.html
+ $BayesAutoLearnThresholdSpam = 6 unless $BayesAutoLearnThresholdSpam >= 6;
+
+ $OUT = "bayes_auto_learn $AutoLearn\n";
+ return unless $AutoLearn == 1;
+ $OUT .= "bayes_auto_learn_threshold_nonspam $BayesAutoLearnThresholdNonspam\n";
+ $OUT .= "bayes_auto_learn_threshold_spam $BayesAutoLearnThresholdSpam\n";
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/20detail_header b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/20detail_header
new file mode 100644
index 0000000..8ddec32
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/20detail_header
@@ -0,0 +1,2 @@
+add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ autolearn=_AUTOLEARN_
+add_header all Details _REPORT_
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/50pyzor_timeout b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/50pyzor_timeout
new file mode 100644
index 0000000..f8e85c3
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/50pyzor_timeout
@@ -0,0 +1,8 @@
+{
+ my $pyzor_timeout = ($spamassassin{PyzorTimeout} || 0);
+ if ($pyzor_timeout ne '0')
+ {
+ return "pyzor_timeout " . ($pyzor_timeout);
+ }
+}
+
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/60globalWBL b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/60globalWBL
new file mode 100644
index 0000000..c55d3ac
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/60globalWBL
@@ -0,0 +1,20 @@
+{
+ use esmith::ConfigDB;
+
+ my $dbh = esmith::ConfigDB->open_ro('spamassassin')
+ || die "Unable to open spamassassin configuration dbase.";
+ my %wbl = $dbh->get('wbl.global')->props;
+
+ $OUT = '';
+ my $parameter = "";
+ my $value = "";
+ while (($parameter,$value) = each(%wbl)) {
+ if ($parameter eq "type") {next;}
+
+ if ($value eq "White") {
+ $OUT .= "whitelist_from " . $parameter . "\n";
+ } elsif ($value eq "Black") {
+ $OUT .= "blacklist_from " . $parameter . "\n";
+ }
+ }
+}
diff --git a/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/70globalWBL_to b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/70globalWBL_to
new file mode 100644
index 0000000..367e326
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/mail/spamassassin/local.cf/70globalWBL_to
@@ -0,0 +1,20 @@
+{
+ use esmith::ConfigDB;
+
+ my $dbh = esmith::ConfigDB->open_ro('spamassassin')
+ || die "Unable to open spamassassin configuration dbase.";
+ my %wbl = $dbh->get('wbl.global_to')->props;
+
+ $OUT = '';
+ my $parameter = "";
+ my $value = "";
+ while (($parameter,$value) = each(%wbl)) {
+ if ($parameter eq "type") {next;}
+
+ if ($value eq "White") {
+ $OUT .= "whitelist_to " . $parameter . "\n";
+ } elsif ($value eq "Black") {
+ $OUT .= "blacklist_to " . $parameter . "\n";
+ }
+ }
+}
diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32spamd b/root/etc/e-smith/templates/etc/rsyslog.conf/32spamd
new file mode 100644
index 0000000..451b86c
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32spamd
@@ -0,0 +1,5 @@
+
+#spamd
+:programname, isequal, "spamd" /var/log/spamd/spamd.log
+& stop
+
diff --git a/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options b/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options
new file mode 100644
index 0000000..e08c4e3
--- /dev/null
+++ b/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options
@@ -0,0 +1,18 @@
+{
+
+ # Default options to spamd
+ #SPAMDOPTIONS="-c -m5 -H --razor-home-dir='/var/lib/razor/' --razor-log-file='sys-syslog'"
+ # previous sme9 options
+ # -u spamd --syslog=stderr --ipv4-only
+ my @args = qw(-u spamd -c -m5 -H --ipv4-only --razor-home-dir='/var/lib/razor/' --razor-log-file='sys-syslog');
+
+ my $bayes = $spamassassin{'UseBayes'} || '0';
+ my $tell = $spamassassin{'SpamLearning'} || 'disabled';
+
+ if ($bayes =~ m/^1|yes|on|enabled$/ && $tell =~ m/^1|yes|on|enabled$/){
+ push @args, '--allow-tell';
+ }
+
+ $OUT .= "SPAMDOPTIONS=\"@args\"";
+
+}
diff --git a/root/etc/logrotate.d/spamd b/root/etc/logrotate.d/spamd
new file mode 100644
index 0000000..dae928a
--- /dev/null
+++ b/root/etc/logrotate.d/spamd
@@ -0,0 +1,13 @@
+/var/log/spamd/spamd.log
+{
+ missingok
+ notifempty
+ sharedscripts
+ delaycompress
+ su root root
+ create 600 root root
+ postrotate
+ /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
+ endscript
+}
+
diff --git a/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf b/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf
new file mode 100644
index 0000000..d80bd13
--- /dev/null
+++ b/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf
@@ -0,0 +1,5 @@
+[Service]
+ExecStartPre=-/sbin/e-smith/service-status spamassassin
+
+[Install]
+WantedBy=sme-server.target
diff --git a/root/var/log/spamd/.gitignore b/root/var/log/spamd/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/root/var/service/qpsmtpd/.spamassassin/.gitignore b/root/var/service/qpsmtpd/.spamassassin/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/root/var/spool/spamd/.spamassassin/.gitignore b/root/var/spool/spamd/.spamassassin/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/smeserver-spamassassin.spec b/smeserver-spamassassin.spec
new file mode 100644
index 0000000..1fca3d4
--- /dev/null
+++ b/smeserver-spamassassin.spec
@@ -0,0 +1,557 @@
+# $Id: smeserver-spamassassin.spec,v 1.27 2023/07/05 14:03:17 jcrisp Exp $
+
+Summary: SME Server - spamassassin anti-spam module
+%define name smeserver-spamassassin
+Name: %{name}
+%define version 2.7.0
+%define release 13
+Version: %{version}
+Release: %{release}%{?dist}
+License: GPL
+Group: Networking/Daemons
+Source: %{name}-%{version}.tar.xz
+
+BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
+Requires: e-smith-email >= 4.13.0-38
+Requires: headermatch
+Requires: spamassassin >= 4.0.0
+Requires: perl(Crypt::OpenSSL::Bignum)
+Requires: perl(IO::Socket::INET6)
+Requires: perl(IP::Country)
+Requires: perl(Net::DNS) >= 0.34-1
+Requires: perl(Net::Ident)
+Requires: perl(Compress::Zlib)
+Requires: perl(Mail::DKIM)
+Requires: perl(Mail::DMARC) >= 1.20200214
+Requires: ucspi-tcp daemontools
+Requires: e-smith-lib >= 1.13.1-90
+Requires: e-smith-base >= 4.13.16
+Requires: e-smith-qmail >= 1.9.0-09sme02
+Requires: smeserver-clamav >= 2.7.0
+Requires: perl-Razor-Agent
+Requires: DCC
+Requires: pyzor
+Obsoletes: FuzzyOcr
+Obsoletes: e-smith-spamassassin
+Provides: e-smith-spamassassin
+BuildArchitectures: noarch
+BuildRequires: e-smith-devtools >= 1.11.0-12
+AutoReqProv: no
+
+%description
+SME Server - spamassassin anti-spam module
+
+%changelog
+* Mon Jul 10 2023 cvs2git.sh aka Brian Read 2.7.0-13.sme
+- Roll up patches and move to git repo [SME: 12338]
+
+* Mon Jul 10 2023 BogusDateBot
+- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
+ by assuming the date is correct and changing the weekday.
+
+* Wed Jul 05 2023 John Crisp 2.7.0-12.sme
+- Add requires perl-Mail-DMARC for spamassassin 4
+
+* Tue Mar 07 2023 John Crisp 2.7.0-11.sme
+- update for Spamassassin 4 - thanks for the patch Zsolt [SME: 12330]
+
+* Wed Apr 07 2021 Jean-Philippe Pialasse 2.7.0-10.sme
+- prevent noise in log at spamassassin call from qpsmtpd [SME: 11491]
+
+* Tue Mar 16 2021 Jean-Philippe Pialasse 2.7.0-9.sme
+- clean rsyslog syntax for spamd [SME: 11422]
+
+* Tue Feb 23 2021 Jean-Philipe Pialasse 2.7.0-8.sme
+- remove warning while trying to delete file when missing in post script [SME: 11375]
+
+* Sun Feb 21 2021 Jean-Philipe Pialasse 2.7.0-7.sme
+- remove spamd reference as service use spamassassin.service [SME: 11375]
+ migrate spamd propertie SpamLearning to spamassassin
+ template for /etc/sysconfig/spamassassin, revert --allow-tell option
+ stop spamassassin spamd and delete /etc/systemd/system/spamassassin.service link if exists
+
+* Sun Feb 21 2021 Jean-Philipe Pialasse 2.7.0-6.sme
+- fix typo [SME: 11361]
+
+* Thu Feb 18 2021 Jean-Philipe Pialasse 2.7.0-5.sme
+- fix spamd unable to load [SME: 11361]
+- redirect spamd loging to spamd.log instead of message [SME: 11362]
+
+* Wed Feb 17 2021 Jean-Philipe Pialasse 2.7.0-4.sme
+- add requires DCC as we have built it [SME: 11065]
+
+* Fri Jan 08 2021 Jean-Philipe Pialasse 2.7.0-3.sme
+- fix smeserver-spamassassin-update event fix [SME: 11166]
+
+* Wed Dec 16 2020 John Crisp 2.7.0-1
+- Start systemd migration. Remove symlinks [SME: 11224]
+- remove refresh clam as this will be provided by clamav
+- require spamassassin 3.4.4 +
+
+* Wed Jun 28 2017 Jean-Philipe Pialasse 2.6.0-8.sme
+- disable auto_learn by default when enabling Bayes [SME: 8160]
+- added properties UseBayesAutoLearn, BayesAutoLearnThresholdSpam and BayesAutoLearnThresholdNonSpam
+
+* Wed Mar 8 2017 Daniel Berteaud 2.6.0-7.sme
+- Rewrite spamd run script to add support for --allow-tell [SME: 10137]
+
+* Wed Apr 20 2016 Daniel Berteaud 2.6.0-6.sme
+- Add X-Spam-Details header (and simplify X-Spam-Status) [SME: 9471]
+
+* Fri Mar 18 2016 Jean-Philipe Pialasse 2.6.0-5.sme
+- fix claim to own /usr/bin [SME: 9348]
+- rebuild for Bug [SME: 9347]
+
+* Fri Mar 18 2016 Daniel Berteaud 2.6.0-4.sme
+- Update dependency for perl-Razor-Agent [SME: 9336]
+
+* Fri Mar 18 2016 Daniel Berteaud 2.6.0-3.sme
+- Remove dependency on dcc as it's non free software [SME: 9331]
+
+* Fri Mar 18 2016 Jean-Philippe Pialasse 2.6.0-2.sme
+- Change Requires DCC to dcc [SME: 9343]
+
+* Sat Feb 06 2016 stephane de Labrusse 2.6.0-1.sme
+- Initial release to sme10
+
+* Thu Jan 07 2016 Daniel Berteaud 2.4.0-6.sme
+- Disable ipv6 support to prevent a warning during startup [SME: 9153]
+
+* Wed Jan 29 2014 Ian Wells 2.4.0-5.sme
+- Remove workarounds for how qpsmtpd tags spam email [SME: 8109]
+- Fix whitespace in 10required_score
+
+* Thu Jan 2 2014 Ian Wells 2.4.0-4.sme
+- Include /usr/bin/refreshclam [SME: 8108]
+
+* Fri Jul 5 2013 Ian Wells 2.4.0-3.sme
+- Load TextCat plugin if ok_languages is enabled [SME: 7757]
+
+* Sun May 19 2013 chris burnat 2.4.0-2.sme
+- Fix how qpsmtpd tags spam email, codes by Charlie Brady [SME: 7604]
+
+* Wed Feb 6 2013 Shad L. Lords 2.4.0-1.sme
+- Roll new stream for sme9
+
+* Sun Apr 8 2012 Jonathan Martens 2.2.0-9
+- Add template fragment for pyzor timeout [SME: 6896]
+
+* Fri Jan 20 2012 Jonathan Martens 2.2.0-8
+- Actually apply patch to remove spamd restart from bootstrap-console-save event [SME: 6717]
+
+* Fri Dec 23 2011 Jonathan Martens 2.2.0-7
+- Remove spamd restart from bootstrap-console-save event [SME: 6717]
+
+* Sat Aug 7 2010 Ian Wells 2.2.0-6.sme
+- Work around how qpsmtpd tags spam email, by Michael McCarn [SME: 5603]
+
+* Mon Apr 19 2010 Shad L. Lords 2.2.0-5.sme
+- Remove cron.daily jobs that are no longer needed
+- Previous patch make spamassassin restart correctly [SME: 3304]
+- Newer spamassassin imports keys on install [SME: 5889]
+
+* Wed Feb 17 2010 Filippo Carletti 2.2.0-4.sme
+- Requires SpamAssassin 3.3.0 [SME: 5741]
+- Remove FuzzyOcr [SME: 5771]
+- Use ATrpm package (partially remove previous patch)
+
+* Tue Feb 16 2010 Filippo Carletti 2.2.0-3.sme
+- Requires SpamAssassin 3.3.0 [SME: 5741]
+- Remove FuzzyOcr [SME: 5771]
+- Run sa-update every two hours and check restart every hour
+- Redirect cron job output to logfile to avoid mail noise
+
+* Tue Nov 25 2008 Giacomo Sanchietti 2.2.0-2.sme
+- Fix invalid service name in sa-update [SME: 3304]
+
+* Tue Oct 7 2008 Shad L. Lords 2.2.0-1.sme
+- Roll new stream to separate sme7/sme8 trees [SME: 4633]
+
+* Sat Mar 8 2008 chris burnat 1.4.0-18
+- Edit and rename deprecated template fragment [SME: 3857]
+
+* Tue Dec 25 2007 Shad L. Lords 1.4.0-17
+- Import all spamassassin keys correctly [SME: 3206]
+
+* Sat Sep 8 2007 Shad L. Lords 1.4.0-16
+- Import spamassassin keys correctly [SME: 3206]
+
+* Thu Sep 6 2007 Shad L. Lords 1.4.0-15
+- Import spamassassin keys if sa_update is found [SME: 3206]
+- Restart spamassassin if update successful [SME: 3351]
+
+* Sun Jun 24 2007 Shad L. Lords 1.4.0-14
+- Fix log (lint) noise [SME: 3100]
+
+* Sun Apr 29 2007 Shad L. Lords
+- Clean up spec so package can be built by koji/plague
+
+* Sun Feb 18 2007 Shad L. Lords 1.4.0-13
+- Add FuzzyOcr to spamassassin to detect graphic spam [SME: 1985]
+
+* Fri Feb 16 2007 Shad L. Lords 1.4.0-12
+- Change runsvctrl to sv to support runit v1.7.x [SME: 2486]
+
+* Wed Jan 24 2007 Shad L. Lords 1.4.0-11
+- Add requires for new spamassassin modules
+
+* Thu Dec 07 2006 Shad L. Lords
+- Update to new release naming. No functional changes.
+- Make Packager generic
+
+* Fri Nov 10 2006 Gordon Rowell 1.4.0-09
+- Only match X-Spam-Status in headers, via headermatch [SME: 1924]
+
+* Thu Jul 13 2006 Gordon Rowell 1.4.0-08
+- Anchor X-Spam-Status check to start of line [SME: 1712]
+
+* Wed Jun 14 2006 Gordon Rowell 1.4.0-07
+- Missing space in last change [SME: 1571]
+
+* Wed Jun 14 2006 Gordon Rowell 1.4.0-06
+- Add check for spamassassin{UseAutoWhitelist}, defaulting to 0 (off)
+ [SME: 1571]
+
+* Fri Jun 9 2006 Shad L. Lords 1.4.0-05
+- Add path/perm for auto_whitelist [SME: 1571]
+
+* Fri Jun 9 2006 Gordon Rowell 1.4.0-04
+- Adjust perl dependencies to perl module rather than RPM [SME: 1548]
+
+* Fri Jun 9 2006 Gordon Rowell 1.4.0-03
+- Correct previous changelog and rebuild [SME: 1548]
+
+* Wed Jun 7 2006 Shad L. Lords 1.4.0-02
+- Update config for spamassassin 3.10+ [SME: 1548]
+
+* Wed Mar 15 2006 Charlie Brady 1.4.0-01
+- Roll stable stream version. [SME: 1016]
+
+* Wed Feb 22 2006 Gavin Weight 1.3.0-07
+- Renamed 40customScore_BAYES_90 to 40customScore_BAYES_95,
+ Edited 40customScore_BAYES_95 to change 90 to 95. [SME: 836]
+
+* Tue Feb 7 2006 Shad L. Lords 1.3.0-06
+- Add db default for wbl.global_to|type [SME: 693]
+
+* Sat Jan 28 2006 Shad L. Lords 1.3.0-05
+- Add global white/black lists for to addresses [SME: 594]
+
+* Thu Nov 03 2005 Filippo Carletti 1.3.0-04
+- Avoid runit spinning if spamd is disabled [SF: 1312897]
+
+* Wed Nov 02 2005 Filippo Carletti 1.3.0-03sme01
+- Start spamd only if spam filter is enabled [SF: 1312897]
+
+* Mon Oct 10 2005 Gordon Rowell 1.3.0-03
+- Migrate SortSpam property from 0/1 to disabled/enabled [SF: 1321319]
+
+* Fri Oct 7 2005 Gordon Rowell 1.3.0-02
+- Clear qmail{DeliveryInstruction} and qmail{DeliveryType} if
+ they were set for the obsoleted sortspam [SF: 1315596]
+
+* Fri Sep 23 2005 Gordon Rowell
+- [1.3.0]
+- Package renamed to smeserver-spamassassin
+
+* Fri Sep 23 2005 Gordon Rowell
+- [1.1.0-08sme01]
+- Simplify .qmail template fragment and add Requires header
+ for recent e-smith-qmail since we need 00setup from it [SF: 1252336]
+
+* Tue Aug 2 2005 Shad Lords
+- [1.1.0-08]
+- Prepare for change of default database location. [SF: 1216546]
+
+* Tue May 31 2005 Charlie Brady
+- [1.1.0-07]
+- Default spamassassin{RejectLevel}==0 [Gordon SF:1202399]
+
+* Fri May 13 2005 Charlie Brady
+- [1.1.0-06]
+- Another update from Gordon.
+- Use condredirect (redirecting to $USERNAME-junkmail)
+ instead of sortspam [SF:1200336]
+- Provide template for .qmail-junkmail
+- Remove db defaults for qmail{DeliveryType,DeliveryInstruction}.
+ We don't want one delivery instruction, we want as many as the
+ user has requested. Each instruction should be enabled/disabled
+ on a global and per-user basis, as per SortSpam
+- TODO: Simplify e-smithForward20 in e-smith-email
+
+* Fri May 13 2005 Charlie Brady
+- [1.1.0-05]
+- Really add the new files in last patch from Shad/Gordon.
+
+* Thu May 5 2005 Charlie Brady
+- [1.1.0-04]
+- Various contributions from Shad Lords and Gordon Rowell, as follows
+- Add sortspam from Shad Lords' e-smith-spamassassin
+- Add lots of config entries and local.cf templates, also from Shad
+- Modified templates to match new config db names
+- Add migrate fragments
+
+* Wed Apr 27 2005 Charlie Brady
+- [1.1.0-03]
+- Change Requires header to "razor-agents".
+
+* Mon Mar 21 2005 Charlie Brady
+- [1.1.0-02]
+- Update config for SpamAssassin 3.0.2
+
+* Wed Feb 4 2004 Michael Soulier
+- [1.1.0-01]
+- rolling to dev - 1.1.0
+
+* Wed Feb 4 2004 Michael Soulier
+- [1.0.0-01]
+- rolling to stable - 1.0.0
+
+* Thu Aug 28 2003 Michael Soulier
+- [0.0.8-02]
+- Added K* init symlinks to runlevels 0, 1 and 6. [msoulier 9761]
+
+* Thu Jun 26 2003 Gordon Rowell
+- [0.0.8-01]
+- Enable spamd by default [gordonr 9183]
+- Simplify spamassassin-update script [gordonr 9183]
+- Resolve spamd/spamassassing directory confusion [gordonr 9183]
+- Change spamd use home directory to /var/spool/spamd [gordonr 9183]
+- Log as smelog user in /var/log/spamd [gordonr 9183]
+- Update SPEC file with new genfilelist [gordonr 9183]
+
+* Fri Jun 20 2003 Gordon Rowell
+- [0.0.7-23]
+- Add path to /service/spamd so restart works [gordonr 9095]
+
+* Mon Jun 9 2003 Gordon Rowell
+- [0.0.7-22]
+- Put back skip_rbl_checks|0 default [gordonr 8952]
+
+* Mon Jun 9 2003 Gordon Rowell
+- [0.0.7-21]
+- Generate the correct config lines, and make each fragment
+ valid perl [gordonr 8960]
+
+* Mon Jun 9 2003 Gordon Rowell
+- [0.0.7-20]
+- Move spamassassin configuration parameters into main configdb
+ as properties of the spamassassing service [gordonr 8960]
+
+* Mon Jun 9 2003 Charlie Brady
+- [0.0.7-19]
+- Change config to use RBLs by default. [charlieb 8952]
+
+* Wed Jun 4 2003 Charlie Brady
+- [0.0.7-18]
+- Use create-system-user to create spamd user. [charlieb 6033]
+
+* Tue Apr 22 2003 Gordon Rowell
+- [0.0.7-17]
+- Removed %post call - already done in various events [gordonr 2600]
+
+* Tue Apr 22 2003 Gordon Rowell
+- [0.0.7-16]
+- Changed spamd uid (1003 already taken) - [gordonr 8368]
+
+* Mon Apr 21 2003 Gordon Rowell
+- [0.0.7-15]
+- Let useradd add the group in %pre. Don't fail %pre if the uid is not
+ unique [gordonr 8368]
+
+* Wed Apr 9 2003 Charlie Brady
+- [0.0.7-14]
+- Replace serviceControl() calls with "svc-stop" or "svc -t" as required,
+ so that messages don't leak to console when spamd is restarted.
+ [charlieb 7883]
+
+* Thu Apr 3 2003 Gordon Rowell
+- [0.0.7-13]
+- Removed dangling panel link [gordonr 7787]
+
+* Wed Apr 2 2003 Charlie Brady
+- [0.0.7-12]
+- Add default DeliveryInstruction andi DeliveryType default
+ properties for qmail, so that "sortspam" is used for local delivery.
+ Update e-smith-email "requires" version to suit. [charlieb 2600]
+- Change Copyright header to License. [charlieb]
+
+* Wed Apr 2 2003 Charlie Brady
+- [0.0.7-11]
+- Remove panel code. Greg's panel code can now be found in
+ e-smith-spamassassin-panel. [charlieb 7787]
+- Split action into spamassassin config/restart and procmail
+ configure sections. Latter is not yet liked into any
+ actions. [charlieb 2600]
+- Remove db initialization parts of action script - init done by
+ 'defaults' fragments. [charlieb 7526]
+- Do stop/restart of 'spamd', not 'spamassassin'. [charlieb 2600]
+
+* Fri Mar 28 2003 Gordon Rowell
+- [0.0.7-10]
+- Change panel Spam Control -> Spam filtering [gordonr 2600]
+
+* Fri Mar 28 2003 Charlie Brady
+- [0.0.7-09]
+- Fix problem with sorting of sensitivity labels in panel [charlieb 7910]
+
+* Tue Mar 25 2003 Charlie Brady
+- [0.0.7-08]
+- Remove -c from run file which starts spamd - we don't want to try
+ to create missing user config files. [charlieb 2600]
+- Create user spamd and run spamd as that userid. [charlieb 2600]
+
+* Mon Mar 17 2003 Charlie Brady
+- [0.0.7-07]
+- Add conf.global and wbl.global default configuration data. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-06]
+- Various fixes to spamassassin db initialization templates - mostly CVS
+ repository issues. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-05]
+- Add the panel link for the new panel. Configure spamd to be paranoid
+ and to create no use config files. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-04]
+- Remove Greg's full-featured spamassassin panel. Consult CVS if you want
+ to resurrect any of the code. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-03]
+- Fix the minimal FM panel so that it runs. [charlieb 2600]
+- Fix compile problems in spamassassin-update script. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-02]
+- Add starter en-us lexicon for FM version of the panel. [charlieb 2600]
+
+* Fri Mar 14 2003 Charlie Brady
+- [0.0.7-01]
+- Use new defaults directory structure to initialize db entries.
+ Add minimal Fm web panel. Add spamassassin-update to email-update
+ and bootstrap-console-save events. [charlieb 2600]
+
+* Tue Feb 4 2003 Gordon Rowell
+- [0.0.6-01]
+- Roll new source tarball after the merge [gordonr 2600]
+
+* Tue Feb 4 2003 Gordon Rowell
+- [0.0.5-04]
+- Merged in Greg Zartman's contrib
+
+* Wed Jan 29 2003 Greg Zartman
+- Fixed a small typo in spamassassin server-manager
+ panel that caused a menu label to not show correctly
+
+* Wed Jan 29 2003 Greg Zartman
+- [0.0.1-1]
+- initial Alpha release
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.5-03]
+- And rename /service/spamd as well [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.5-02]
+- Renamed spamassassin -> spamd to avoid conflict with spamassassin's
+ init script [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.5-01]
+- Removed stray /etc/tcprules directory [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.4-01]
+- Deleted some detritus [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.3-01]
+- And an -as-source run to build the initial version [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.2-02]
+- Missed some files on initial import [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.2-01]
+- Initial import to 0.0.2
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.1-02]
+- Initial SRPM from CVS [gordonr 2600]
+
+* Sun Dec 29 2002 Gordon Rowell
+- [0.0.1-1]
+- Initial
+
+%prep
+%setup
+rm -rf root/etc/e-smith/templates/usr/
+rm -rf root//usr/lib/systemd/system/spamd.service.d
+rm -rf root/etc/e-smith/db/configuration/defaults/spamd
+mkdir -p root/var/service/qpsmtpd/.spamassassin
+
+%build
+perl createlinks
+
+%install
+rm -rf $RPM_BUILD_ROOT
+(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
+rm -f %{name}-%{version}-%{release}-filelist
+/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
+ --dir /var/log/spamd 'attr(2750,smelog,smelog)' \
+ --dir /var/spool/spamd 'attr(2750,spamd,spamd)' \
+ --dir /var/spool/spamd/.spamassassin 'attr(2750,spamd,spamd)' \
+ --file /etc/cron.hourly/sa-restart 'attr(0755,root,root)' \
+ --dir /usr/lib/systemd/system/spamd.service.d 'attr(0755,root,root)' \
+ --dir /usr/lib/systemd/system/spamassassin.service.d 'attr(0755,root,root)' \
+ --dir /var/service/qpsmtpd/.spamassassin 'attr(2750,spamd,spamd)' \
+ |grep -v "/var/service/qpsmtpd$" \
+ |grep -v "/var/service$" \
+ > %{name}-%{version}-%{release}-filelist
+
+%pre
+/sbin/e-smith/create-system-user spamd 1005 \
+ 'spamassassin daemon user' /var/spool/spamd /bin/false
+#clean 10.0b1 bad choice
+if [[ -L "/etc/systemd/system/spamassassin.service" ]]; then
+ unlink /etc/systemd/system/spamassassin.service; fi
+if [[ -L "/usr/lib/systemd/system/spamassassin.service" ]]; then
+ /usr/bin/systemctl stop spamd.service
+ /usr/bin/systemctl stop spamassassin.service
+fi
+
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+
+# Cleanup old files
+if [[ -d /var/lib/spamassassin/3.004000 ]]; then
+ rm -rf /var/lib/spamassassin/3.004000 2>/dev/null || true
+fi
+
+if [[ ! -d /var/lib/spamassassin/3.004004 ]]; then
+ echo "Installing new spam databases - please be patient"
+ nc -z 8.8.8.8 53 >/dev/null 2>&1
+ online=$?
+ if [ $online -eq 0 ]; then
+ echo "Server Online - updating"
+ /usr/bin/sa-update -v
+ else
+ echo "Offline - please check your network connection and then run sa-update manually"
+ fi
+fi
+
+if [[ -d /usr/lib/systemd/system/spamd.service.d ]]; then
+ rm -rf /usr/lib/systemd/system/spamd.service.d
+fi
+
+%files -f %{name}-%{version}-%{release}-filelist
+%defattr(-,root,root)