diff -Nur smeserver-spamassassin-2.7.0.old/createlinks smeserver-spamassassin-2.7.0/createlinks --- smeserver-spamassassin-2.7.0.old/createlinks 2021-02-21 22:06:00.033000000 -0500 +++ smeserver-spamassassin-2.7.0/createlinks 2021-02-21 23:01:18.362000000 -0500 @@ -15,6 +15,7 @@ foreach (qw( /etc/mail/spamassassin/local.cf + /etc/sysconfig/spamassassin )) { templates2events("$_",qw( @@ -32,10 +33,11 @@ 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/spamd"); +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/spamd"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/spamassassin"); diff -Nur smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/defaults/spamd/status smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/defaults/spamd/status --- smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/defaults/spamd/status 2003-06-26 12:07:33.000000000 -0400 +++ smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/defaults/spamd/status 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ -enabled diff -Nur smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/defaults/spamd/type smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/defaults/spamd/type --- smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/defaults/spamd/type 2003-03-14 14:26:45.000000000 -0500 +++ smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/defaults/spamd/type 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ -service diff -Nur smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/migrate/10spamassassin smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/migrate/10spamassassin --- smeserver-spamassassin-2.7.0.old/root/etc/e-smith/db/configuration/migrate/10spamassassin 2006-03-15 19:41:02.000000000 -0500 +++ smeserver-spamassassin-2.7.0/root/etc/e-smith/db/configuration/migrate/10spamassassin 2021-02-21 22:57:36.008000000 -0500 @@ -32,4 +32,15 @@ $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 -Nur smeserver-spamassassin-2.7.0.old/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options smeserver-spamassassin-2.7.0/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options --- smeserver-spamassassin-2.7.0.old/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-spamassassin-2.7.0/root/etc/e-smith/templates/etc/sysconfig/spamassassin/10options 2021-02-21 22:39:49.693000000 -0500 @@ -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 -Nur smeserver-spamassassin-2.7.0.old/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf smeserver-spamassassin-2.7.0/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf --- smeserver-spamassassin-2.7.0.old/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf 2021-02-21 22:06:00.026000000 -0500 +++ smeserver-spamassassin-2.7.0/root/usr/lib/systemd/system/spamassassin.service.d/49koozali.conf 2021-02-21 23:02:46.934000000 -0500 @@ -1,3 +1,5 @@ [Service] -ExecStart= -ExecStart=/bin/false +ExecStartPre=-/sbin/e-smith/service-status spamassassin + +[Install] +WantedBy=sme-server.target diff -Nur smeserver-spamassassin-2.7.0.old/root/usr/lib/systemd/system/spamd.service smeserver-spamassassin-2.7.0/root/usr/lib/systemd/system/spamd.service --- smeserver-spamassassin-2.7.0.old/root/usr/lib/systemd/system/spamd.service 2021-02-21 22:06:00.026000000 -0500 +++ smeserver-spamassassin-2.7.0/root/usr/lib/systemd/system/spamd.service 1969-12-31 19:00:00.000000000 -0500 @@ -1,16 +0,0 @@ -[Unit] -Description=Spamassassin daemon -After=syslog.target network.target -Wants=sa-update.timer - -[Service] -EnvironmentFile=-/etc/sysconfig/spamassassin -ExecStart=/usr/bin/spamd $SPAMDOPTIONS -StandardOutput=null -StandardError=null -Restart=always - -[Install] -WantedBy=multi-user.target sme-server.target -# Create a shortcut spamassassin to spamd -Alias=spamassassin.service