Bug 47030 - Amavis/Spamassassin not running after installation - no mail delivery
Amavis/Spamassassin not running after installation - no mail delivery
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Mail
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: Mail maintainers
Mail maintainers
:
Depends on: 46555
Blocks: 48944 53751
  Show dependency treegraph
 
Reported: 2018-05-17 17:56 CEST by Sönke Schwardt-Krummrich
Modified: 2023-02-01 13:36 CET (History)
8 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-05-17 17:56:06 CEST
Our jenkins environments produce from time to time a lot of failing mail tests due to a broken amavis:

May 17 00:35:51 unassigned-hostname amavis[12771]: No decoder for       .rar
May 17 00:35:51 unassigned-hostname amavis[12771]: No decoder for       .rpm
May 17 00:35:51 unassigned-hostname amavis[12771]: No decoder for       .swf
May 17 00:35:51 unassigned-hostname amavis[12771]: No decoder for       .zoo
May 17 00:35:51 unassigned-hostname amavis[12771]: Using primary internal av scanner code for Clam Antivirus-clamd
May 17 00:35:51 unassigned-hostname amavis[12771]: Deleting db files nanny.db,__db.001,__db.003,__db.002,snmp.db in /var/lib/amavis/db
May 17 00:35:51 unassigned-hostname amavis[12771]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.55, libdb 5.3
May 17 00:35:51 unassigned-hostname amavis[12771]: (!!)TROUBLE in pre_loop_hook: config: no rules were found!  Do you need to run 'sa-update'?
May 17 00:35:51 unassigned-hostname amavis[12771]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: config: no rules were found!  Do you need to run 'sa-update'?

Looks like the DNS or the connectivity were broken at the time of installation of spamassassin so the SA rules have not been updated.

Maybe we should consider in installing a hardcoded ruleset during setup. sa-update is called each day by cron which would overwrite the hardcoded ruleset with the latest one.



+++ This bug was initially created as a clone of Bug #46555 +++

Amavis/Spamassassin were not running after installation of 
univention-mail-server:

univention-install univention-mail-server --ignoressh --noninteractive


univention-antivir-mail (9.0.0-4A~4.3.0.201801081055) wird eingerichtet ...
Create mail/antivir/scanner
Create mail/antivir
Not updating mail/antispam/requiredhits
Multifile: /etc/postfix/main.cf
Multifile: /etc/postfix/master.cf
Füge Benutzer »clamav« der Gruppe »amavis« hinzu ...
Benutzer clamav wird zur Gruppe amavis hinzugefügt.
Fertig.          
chown: Zugriff auf '/var/run/clamav/' nicht möglich: Datei oder Verzeichnis nicht gefunden
Create clamav/archive/maxfiles
Create clamav/archive/maxfilesize
Create clamav/archive/maxrecursion
Create clamav/database/mirror
Create clamav/checks
Create mail/antivir/banned/double_ext
Create mail/antivir/banned/basic_ext
Create mail/antivir/banned/long_ext
Create mail/antivir/banned/file_type
Create mail/antivir/banned/mime_type
Create mail/antivir/banned/rfc2046
Multifile: /etc/postfix/main.cf
Multifile: /etc/postfix/master.cf
Create mail/antivir/amavis/autostart
Create clamav/daemon/autostart
Create clamav/freshclam/autostart
Create mail/antispam/bodysizelimit
Multifile: /etc/postfix/main.cf
Module: autostart
Multifile: /etc/postfix/master.cf
File: /etc/clamav/freshclam.conf
File: /etc/amavis/conf.d/60-univention
File: /etc/clamav/clamd.conf
File: /etc/amavis/conf.d/15-content_filter_mode
Restarting clamav-daemon (via systemctl): clamav-daemon.service.
File: /etc/clamav/clamd.conf
File: /etc/amavis/conf.d/15-content_filter_mode
Restarting clamav-daemon (via systemctl): clamav-daemon.service.
Restarting spamassassin (via systemctl): spamassassin.serviceJob for spamassassin.service failed because the control process exited with error code.
See "systemctl status spamassassin.service" and "journalctl -xe" for details.
 failed!         
Restarting amavis (via systemctl): amavis.service.
Reloading postfix configuration (via systemctl): postfix.service.
Trigger für dovecot-core (1:2.2.27-3+deb9u2) werden verarbeitet ...
univention-mail-dovecot (4.0.0-8A~4.3.0.201803011723) wird eingerichtet ...
Lege Systembenutzer »dovemail« (UID 126) an ...


root@master44:~# systemctl status spamassassin.service
● spamassassin.service - Perl-based spam filter using text analysis
   Loaded: loaded (/lib/systemd/system/spamassassin.service; disabled; vendor preset: enabled)
   Active: activating (start) since Thu 2018-03-08 16:52:52 CET; 1s ago
Cntrl PID: 26627 (/usr/sbin/spamd)
    Tasks: 2 (limit: 4915)
   Memory: 26.7M
      CPU: 283ms
   CGroup: /system.slice/spamassassin.service
           └─26627 /usr/sbin/spamd -d --pidfile=/var/run/spamd.pid --create-prefs --max-children 10 --helper-home-dir

Mär 08 16:52:52 master44 systemd[1]: Starting Perl-based spam filter using text analysis...
Mär 08 16:52:52 master44 spamd[26627]: logger: removing stderr method
Mär 08 16:52:52 master44 spamd[26629]: config: no rules were found! Do you need to run 'sa-update'?
root@master44:~#
root@master44:~# systemctl restart spamassassin.service
Job for spamassassin.service failed because the control process exited with error code.
See "systemctl status spamassassin.service" and "journalctl -xe" for details.
root@master44:~# systemctl status spamassassin.service 
● spamassassin.service - Perl-based spam filter using text analysis
   Loaded: loaded (/lib/systemd/system/spamassassin.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-03-08 16:52:55 CET; 1min 12s ago
  Process: 26633 ExecStart=/usr/sbin/spamd -d --pidfile=/var/run/spamd.pid $OPTIONS (code=exited, status=255)
      CPU: 311ms

Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Unit entered failed state.
Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Failed with result 'exit-code'.
Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Service hold-off time over, scheduling restart.
Mär 08 16:52:55 master44 systemd[1]: Stopped Perl-based spam filter using text analysis.
Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Start request repeated too quickly.
Mär 08 16:52:55 master44 systemd[1]: Failed to start Perl-based spam filter using text analysis.
Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Unit entered failed state.
Mär 08 16:52:55 master44 systemd[1]: spamassassin.service: Failed with result 'exit-code'.
root@master44:~# sa-update
root@master44:~# systemctl status spamassassin.service
● spamassassin.service - Perl-based spam filter using text analysis
   Loaded: loaded (/lib/systemd/system/spamassassin.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-03-08 16:54:13 CET; 1s ago
  Process: 26682 ExecStart=/usr/sbin/spamd -d --pidfile=/var/run/spamd.pid $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 26684 (/usr/sbin/spamd)
    Tasks: 3 (limit: 4915)
   Memory: 79.7M
      CPU: 1.433s
   CGroup: /system.slice/spamassassin.service
           ├─26684 /usr/sbin/spamd -d --pidfile=/var/run/spamd.pid --create-prefs --max-children 10 --helper-home-dir
           ├─26685 spamd child
           └─26686 spamd child
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2018-09-11 10:48:13 CEST
I'm raising the priority since this issue breaks regularly our automatic mail tests. Despite that: it affects all customers that are doing an offline installation.
Comment 2 Felix Botner univentionstaff 2018-12-03 12:14:03 CET
added workaround for autotest-09* tests

e21d2ea0a7bbd88627c2d83d9861275e05a50ddc
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2018-12-04 10:23:28 CET
(In reply to Felix Botner from comment #2)
> added workaround for autotest-09* tests
> 
> e21d2ea0a7bbd88627c2d83d9861275e05a50ddc

Back to REOPENED because it's not fixed for our customers.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2018-12-04 10:25:29 CET
The problem is reproducible on a dc master, if univention-mail-server is about to be installed and via iptables the access to the internet has been limited to the repository server only.
Comment 5 Felix Botner univentionstaff 2018-12-04 15:34:42 CET
(In reply to Sönke Schwardt-Krummrich from comment #3)
> (In reply to Felix Botner from comment #2)
> > added workaround for autotest-09* tests
> > 
> > e21d2ea0a7bbd88627c2d83d9861275e05a50ddc
> 
> Back to REOPENED because it's not fixed for our customers.

ups, yes that is correct i mistakenly closed the bug

please remove the workaround once this is fixed
Comment 6 Daniel Tröder univentionstaff 2019-03-20 12:09:45 CET
http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/AutotestUpgrade/lastBuild/SambaVersion=s4,Systemrolle=master/artifact/test/autotest-071-master-s4.log

[master071] 2019-03-20T00:22:16.450638	+ sa_bug47030
[master071] 2019-03-20T00:22:16.450638	+ sa-update -v --install /root/1854818.tar.gz
[master071] 2019-03-20T00:22:18.436745	cannot open /root/1854818.tar.gz

[master071] 2019-03-20T00:22:22.473902	+ service spamassassin restart
[master071] 2019-03-20T00:22:23.739502	Job for spamassassin.service failed because the control process exited with error code.
[master071] 2019-03-20T00:22:23.739502	See "systemctl status spamassassin.service" and "journalctl -xe" for details.

Happens on:
* UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=s4,Systemrolle=master

Succeeds on:
* UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=master
* UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=s4,Systemrolle=slave
* UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=samba-pdc,Systemrolle=slave
* UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave
Comment 7 Felix Botner univentionstaff 2019-03-20 12:26:52 CET
(In reply to Daniel Tröder from comment #6)
> http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/
> AutotestUpgrade/lastBuild/SambaVersion=s4,Systemrolle=master/artifact/test/
> autotest-071-master-s4.log
> 
> [master071] 2019-03-20T00:22:16.450638	+ sa_bug47030
> [master071] 2019-03-20T00:22:16.450638	+ sa-update -v --install
> /root/1854818.tar.gz
> [master071] 2019-03-20T00:22:18.436745	cannot open /root/1854818.tar.gz
> 
> [master071] 2019-03-20T00:22:22.473902	+ service spamassassin restart
> [master071] 2019-03-20T00:22:23.739502	Job for spamassassin.service failed
> because the control process exited with error code.
> [master071] 2019-03-20T00:22:23.739502	See "systemctl status
> spamassassin.service" and "journalctl -xe" for details.
> 
> Happens on:
> * UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=s4,Systemrolle=master
> 
> Succeeds on:
> * UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=master
> * UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=s4,Systemrolle=slave
> * UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=samba-pdc,Systemrolle=slave
> * UCS-4.4/UCS-4.4-0/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave

thanks, fixed
Comment 8 Felix Botner univentionstaff 2019-05-17 11:45:55 CEST
added workaround to 4.3-4 test cfg's

autotest-070-update-master-no-samba.cfg autotest-071-update-master-s4.cfg autotest-074-update-slave-no-samba.cfg autotest-075-update-slave-s4.cfg autotest-078-update-slave-samba-pdc.cfg autotest-090-master-no-samba.cfg autotest-091-master-s4.cfg autotest-094-slave-no-samba.cfg autotest-095-slave-s4.cfg autotest-098-slave-samba-pdc.cfg
Comment 9 Ingo Steuwer univentionstaff 2019-07-11 08:58:22 CEST
AFAIK we are not allowed to ship these signatures by ourself, so the only option i see here is to inform the administrative user in a better way. That should be done by implementing #48944 and #49835
Comment 10 Philipp Hahn univentionstaff 2021-02-11 13:21:00 CET
(In reply to Felix Botner from comment #8)
> added workaround to 4.3-4 test cfg's

scenarios/autotest-091-master-s4.cfg not contains this:
 71 files:
 72  ~/ec2/scripts/activate-errata-test-scope.sh /root/
 73  ~/ec2/license/license.secret /etc/
 74  ~/ec2/spamassassin/1854818.tar.gz.sha256 /root/                                                                                                                        
 75  ~/ec2/spamassassin/1854818.tar.gz.asc /root/
 76  ~/ec2/spamassassin/1854818.tar.gz.sha512 /root/
 77  ~/ec2/spamassassin/1854818.tar.gz /root/

I don't have these files on my notebook, so the CFG is now unusable for me.
Where can I get those files?

These required files are a pain for on-boarding new colleagues.
I've created a new PRIVATE git repository for this: https://git.knut.univention.de/univention/jenkins-data