mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.32k stars 1.13k forks source link

sieve crashes dovecot #5303

Closed flo1212 closed 1 week ago

flo1212 commented 1 year ago

Contribution guidelines

I've found a bug and checked that ...

Description

in a user account is in the path /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/domain.de/user.name/sieve
two files:
sogo.sieve
USER.sieve

Contents:
-------------------------------------------------- ------------------------------------------------
# USER management script
#
# This script includes the various active sieve scripts
# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!
#
# For more information, see http://wiki.kolab.org/KEP:14#USER
#

require ["include"];

include :personal "sogo";
-------------------------------------------------- ------------------------------------------------

When restarting dovecot there is this error:
mailcowdockerized-dovecot-mailcow-1 | sievec: Fatal: failed to compile sieve script '/var/vmail/domain.de/user.name/sieve/USER.sieve'

The Dovecot container then no longer has a network and the mail functions are disrupted

The user uses a KDE Sieve editor.

Logs:

mailcowdockerized-dovecot-mailcow-1 | sievec: Fatal: failed to compile sieve script '/var/vmail/domain.de/user.name/sieve/USER.sieve'

Steps to reproduce:

We do not know how the USER.sieve was created

Which branch are you using?

master

Operating System:

Debian 11

Server/VM specifications:

32 GB RAM, 8 Cores

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

KVM

Docker version:

24.0.2

docker-compose version or docker compose version:

v2.7.0

mailcow version:

2023-05a

Reverse proxy:

Nginx

Logs of git diff:

nothing

Logs of iptables -L -vn:

nothing

Logs of ip6tables -L -vn:

nothing

Logs of iptables -L -vn -t nat:

nothing

Logs of ip6tables -L -vn -t nat:

nothing

DNS check:

nothing
flo1212 commented 1 year ago

The problem could be reproduced on a test server. The user has with this Sieve Editor https://software.manjaro.org/package/pim-sieve-editor uploaded a rules file. A section of the rule file then creates an additional file USER.sieve when uploading. This file is responsible for the crash.

This area creates the USER.sieve within the rules file

##################

if anyof (address :regex ["to", "cc"] "status.@yyy\.net", address :regex ["to", "cc"] "status.@xxx\.com" ) { if not body :contains "ERROR: Non-zero exit code!" { addflag "\Seen"; addflag "$label3"; } else { addflag "$label1"; }

 fileinto :create "INBOX/status";

}

##################

But the real bug is that every user can crash the dovecot container if such or other incompatible Sieve scripts are created. Mailcow must be able to catch this problem!

xfy777 commented 6 months ago

Seconding this, this happens quite literally every day randomly for us.

dylanjamesdev commented 6 months ago

This also happens to me, the container does not restart even with the restart always flag. We have not changed any Sieve scripts.

DerLinkman commented 1 week ago

Duplicate of https://github.com/mailcow/mailcow-dockerized/issues/4770