No one have idea what is wrong here?
On 07-Jun-24 4:10 PM, George Asenov via dovecot wrote:
Hello,
I have very strange issue. Sieve generate copies of users messages i.e.
not real copies but hardlinks for the same message. It happens to many
messages but not every message and not every time, it is not a single
user issue I have couple users with that issue.
It happens during auto reporting for spam/ham with sieve.
But I'm unable to reproduce it.
At some point the hardlinks copies become so many that the mailbox index
files become so bug that dovecot start throwing error:
dovecot[3385911]: imap(redac...@domain.tld)<1992901>:
Error: Mailbox Junk: mmap(size=520636784) failed with file
/var/lib/dovecot-virtualmin/index/redac...@domain.tld/.Junk/dovecot.index.cache: Cannot allocate memory
other relevant logs are:
dovecot: imap-login: Login: user=, method=PLAIN,
rip=YYY.YYY.YYY.YYY, lip=XXX.XXX.XXX.XXX, mpid=3393763, TLS,
session=
dovecot: imap(redacted.user)<3393763>: sieve: DEBUG:
learn-spam.sieve was triggered on imap.cause=COPY:
msgid=<87584056G78841203D85243127W62181551P@idomziqnd>
dovecot: imap(redacted.user)<3393763>: sieve: DEBUG:
learn-spam on imap.cause=COPY: from=redacted.mail, to=redacted2.mail,
subject=Asseyez-vous confortablement, n'importe où...,
msgid=<87584056G78841203D85243127W62181551P@idomziqnd>,
X-Spamd-Result=default: False [4.49 / 15.00];
FORGED_RECIPIENTS(2.00)[m:redacted2.mail,s:redacted.user.fr];
BAYES_SPAM(1.89)[88.30%]; MID_RHS_NOT_FQDN(0.50)[];
BAD_REP_POLICIES(0.10)[]; RCVD_NO_TLS_LAST(0.10)[];
MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain];
ASN(0.00)[asn:34300, ipnet:62.173.128.0/19, country:RU];
RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~,5:+];
RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[];
RCVD_VIA_SMTP_AUTH(0.00)[]; GREYLIST(0.00)[pass,body];
R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];
R_SPF_ALLOW(0.00)[+mx]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[or.mg];
NEURAL_SPAM(0.00)[0.000]
dovecot: imap(redacted.user)<3393763>: sieve: DEBUG:
learn-spam send to rspamd spam
dovecot: imap(redacted.user)<3393763>: program
exec:/var/lib/dovecot/sieve/rspamd-learn-spam.sh (3397238): Terminated
with non-zero exit code 1
dovecot: imap(redacted.user)<3393763>: Error: sieve:
failed to execute to program `rspamd-learn-spam.sh': refer to server log
for more information. [2024-06-03 07:36:40]
dovecot: imap(redacted.user)<3393763>: Disconnected:
Connection closed (UID FETCH finished 32.173 secs ago) in=2914 out=39237
deleted=1 expunged=1 trashed=0 hdr_count=14 hdr_bytes=10705 body_count=1
body_bytes=1606
I know that this is because the mail which is reported is too big for
curl but documentation say that
$
pipe :copy :try "rspamd-learn-spam.sh";
$
this should ignore the error.
I have tested also to change it like that:
$
pipe :copy "rspamd-learn-spam.sh";
$
but the issue still persists
I can't confirm that the issue is that error because these errors are
way less than the messages with hardlink copies.
Also sometimes one mail have more than two hardlinks to it.
here is a example:
inode# hardlink_count filename
2430090371 23850
./Maildir/.Trash/cur/1714190559.M355157P25776.redacted.hostname,S=39259,W=40217:2,S
2430090371 23850
./Maildir/.Trash/cur/1714190562.M259778P25902.redacted.hostname,S=39259,W=40217:2,S
2430090371 23850
./Maildir/.Trash/cur/1714190565.M188090P26028.redacted.hostname,S=39259,W=40217:2,S
2430090371 23850
./Maildir/.Trash/cur/1714190568.M340582P26179.redacted.hostname,S=39259,W=40217:2,S
yes this is "23850" hardlinks to the same Inode
###
The issue is somewhere in the sieve ham/spam reporting to rspamd but
cant figure out where and why.
Is this a bug or my configuration is wrong?
Here are all related configurations (feel free to ask for more if needed):
##
# doveconf -n
# 2.3.16 (7e2e900c1a): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.16 (09c29328)
# OS: Linux 4.18.0-513.24.1.el8_9.x86_64 x86_64 Rocky Linux release 8.9
(Green Obsidian)
# Hostname: redacteddomain.tld
auth_mechanisms = plain login
disable_plaintext_auth = no
first_valid_uid = 1000
mail_location =
maildir:~/Maildir:INDEX=/var/lib/dovecot-virtualmin/index/%u:CONTROL=/var/lib/dovecot-virtualmin/control/%u
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime
foreverypart extracttext vacation-seconds imapsieve vnd.dovecot.imapsieve
mbox_write_locks = fcntl
namespace inbox {
inbox =