Score:1

Dovecot quota - infinite loop when mailbox full

cn flag

We get an infinite loop once quota is exceeded.

Having set up the dovecot quota as per https://doc.dovecot.org/configuration_manual/quota/

Here are the parameters I modified (my setup was working with no concern):

90-quota.conf
plugin {
    quota = maildir:User quota
    quota_rule = *:storage=100MB
    # 10% of 1GB = 100MB
    quota_rule2 = Trash:storage=+10%%
    # 20% of 1GB = 200MB
    quota_rule3 = Spam:storage=+20%%
    quota_max_mail_size = 30M

# Quota messages incl. user is no longer over quota
quota_warning   = storage=90%% quota-warning 95 %u %d
quota_warning2  = storage=80%% quota-warning 90 %u %d
quota_warning3 = -storage=100%% quota-warning below %u %d
#quota_exceeded_message = ERROR:422 - Mailbox full
}
  
service quota-warning {
  executable = script /var/mail/quota-warning.sh
  # use some unprivileged user for executing the quota warnings
  unix_listener quota-warning {
      user = mail


  }
}

With a script, that I did make inoperant by commenting the lines, hence the error does not come from the script actions:

quota-warning.sh 
#!/bin/sh
PERCENT=$1
USER=$2
DOMAIN=$3
#cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
#From: [email protected]
#Subject: quota warning
#Your mailbox is now $PERCENT% full.
#EOF

Here is what the output of journalctl -f -u postfix -u dovecot (CentOS):

ept. 29 15:40:22 mail.domain.net systemd[1]: Starting Dovecot IMAP/POP3 email server...
sept. 29 15:40:22 mail.domain.net dovecot[807534]: master: Dovecot v2.3.16 (7e2e900c1a) starting up for imap, pop3, lmtp
sept. 29 15:40:22 mail.domain.net systemd[1]: Started Dovecot IMAP/POP3 email server.
sept. 29 15:40:39 mail.domain.net auth[807553]: pam_sss(dovecot:auth): authentication success; logname= uid=0 euid=0 tty=dovecot ruser=comm rhost=192.168.1.30 user=comm
sept. 29 15:40:40 mail.domain.net dovecot[807537]: imap-login: Login: user=<comm>, method=PLAIN, rip=192.168.1.30, lip=192.168.1.20, mpid=807557, TLS, session=<r5W3eSLN+K4KCAAD>
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: initializing the server-side TLS engine
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: connect from unknown[192.168.1.30]
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: setting up TLS connection from unknown[192.168.1.30]
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: unknown[192.168.1.30]: TLS cipher list "aNULL:-aNULL:HIGH:MEDIUM:+RC4:@STRENGTH"
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:before SSL initialization
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:before SSL initialization
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS read client hello
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS write server hello
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS write change cipher spec
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:TLSv1.3 write encrypted extensions
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS write certificate
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:TLSv1.3 write server certificate verify
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS write finished
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:TLSv1.3 early data
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:TLSv1.3 early data
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS read finished
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: unknown[192.168.1.30]: Issuing session ticket, key expiration: 1632924649
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: SSL_accept:SSLv3/TLS write session ticket
sept. 29 15:40:50 mail.domain.net postfix/submission/smtpd[807564]: Anonymous TLS connection established from unknown[192.168.1.30]: TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
sept. 29 15:40:51 mail.domain.net auth[807553]: pam_sss(dovecot:auth): authentication success; logname= uid=0 euid=0 tty=dovecot ruser=comm rhost=192.168.1.30 user=comm
sept. 29 15:40:52 mail.domain.net postfix/submission/smtpd[807564]: B898A7F9E7C: client=unknown[192.168.1.30], sasl_method=PLAIN, sasl_username=comm
sept. 29 15:40:53 mail.domain.net postfix/cleanup[807516]: B898A7F9E7C: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: B898A7F9E7C: from=<[email protected]>, size=829, nrcpt=2 (queue active)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Connect from local
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Connect from local
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807581><AkBAEedsVGGdUgwAgoIkEA>: sieve: msgid=<[email protected]>: failed to store into mailbox 'INBOX': Quota exceeded (mailbox for user is full)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807581><AkBAEedsVGGdUgwAgoIkEA>: sieve: Execution of script /var/spool/mail/SpamAndBcc.sieve failed with unsuccessful implicit keep
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807520]: B898A7F9E7C: to=<[email protected]>, relay=mail.domain.net[private/dovecot-lmtp], delay=2.9, delays=2.9/0/0.02/0.01, dsn=5.2.2, status=bounced (host mail.domain.net[private/dovecot-lmtp] said: 552 5.2.2 <[email protected]> Quota exceeded (mailbox for user is full) (in reply to end of DATA command))
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(archive)<807580><tDXGEOdsVGGcUgwAgoIkEA>: sieve: msgid=<[email protected]>: failed to store into mailbox 'INBOX': Quota exceeded (mailbox for user is full)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(archive)<807580><tDXGEOdsVGGcUgwAgoIkEA>: sieve: Execution of script /var/spool/mail/SpamAndBcc.sieve failed with unsuccessful implicit keep
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807518]: B898A7F9E7C: to=<[email protected]>, relay=mail.domain.net[private/dovecot-lmtp], delay=2.9, delays=2.9/0/0.01/0.02, dsn=5.2.2, status=bounced (host mail.domain.net[private/dovecot-lmtp] said: 552 5.2.2 <[email protected]> Quota exceeded (mailbox for user is full) (in reply to end of DATA command))
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 4C21A7F9E81: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: B898A7F9E7C: sender non-delivery notification: 4C21A7F9E81
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 4C21A7F9E81: from=<>, size=3725, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 4E1987F9E83: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Connect from local
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: B898A7F9E7C: postmaster non-delivery notification: 4E1987F9E83
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 4E1987F9E83: from=<[email protected]>, size=3735, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: B898A7F9E7C: removed
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Connect from local
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807580><4MiYE+dsVGGcUgwAgoIkEA>: sieve: msgid=<[email protected]>: failed to store into mailbox 'INBOX': Quota exceeded (mailbox for user is full)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807580><4MiYE+dsVGGcUgwAgoIkEA>: sieve: Execution of script /var/spool/mail/SpamAndBcc.sieve failed with unsuccessful implicit keep
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807518]: 4E1987F9E83: to=<[email protected]>, orig_to=<postmaster>, relay=mail.domain.net[private/dovecot-lmtp], delay=0.01, delays=0.01/0/0/0, dsn=5.2.2, status=bounced (host mail.domain.net[private/dovecot-lmtp] said: 552 5.2.2 <[email protected]> Quota exceeded (mailbox for user is full) (in reply to end of DATA command))
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 564EF7F9E85: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 4E1987F9E83: sender non-delivery notification: 564EF7F9E85
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 564EF7F9E85: from=<>, size=5838, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 564EF7F9E85: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (undeliverable postmaster notification discarded)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 564EF7F9E85: removed
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 582FA7F9E86: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 4E1987F9E83: postmaster non-delivery notification: 582FA7F9E86
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 582FA7F9E86: from=<[email protected]>, size=2273, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 4E1987F9E83: removed
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Connect from local
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807580><ANfqFedsVGGcUgwAgoIkEA>: sieve: msgid=<[email protected]>: failed to store into mailbox 'INBOX': Quota exceeded (mailbox for user is full)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807580><ANfqFedsVGGcUgwAgoIkEA>: sieve: Execution of script /var/spool/mail/SpamAndBcc.sieve failed with unsuccessful implicit keep
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807580): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(comm)<807581><YGYhE+dsVGGdUgwAgoIkEA>: sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807520]: 4C21A7F9E81: to=<[email protected]>, relay=mail.domain.net[private/dovecot-lmtp], delay=0.06, delays=0.01/0/0/0.05, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> YGYhE+dsVGGdUgwAgoIkEA Saved)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 4C21A7F9E81: removed
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807518]: 582FA7F9E86: to=<[email protected]>, orig_to=<postmaster>, relay=mail.domain.net[private/dovecot-lmtp], delay=0.01, delays=0/0/0/0, dsn=5.2.2, status=bounced (host mail.domain.net[private/dovecot-lmtp] said: 552 5.2.2 <[email protected]> Quota exceeded (mailbox for user is full) (in reply to end of DATA command))
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 5C8387F9E88: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 582FA7F9E86: sender non-delivery notification: 5C8387F9E88
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 5C8387F9E88: from=<>, size=4376, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 5C8387F9E88: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (undeliverable postmaster notification discarded)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 5C8387F9E88: removed
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807601]: 5E7F37F9E89: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 582FA7F9E86: postmaster non-delivery notification: 5E7F37F9E89
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 5E7F37F9E89: from=<[email protected]>, size=2273, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 582FA7F9E86: removed
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Connect from local
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807581><YBy8F+dsVGGdUgwAgoIkEA>: sieve: msgid=<[email protected]>: failed to store into mailbox 'INBOX': Quota exceeded (mailbox for user is full)
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(james)<807581><YBy8F+dsVGGdUgwAgoIkEA>: sieve: Execution of script /var/spool/mail/SpamAndBcc.sieve failed with unsuccessful implicit keep
sept. 29 15:40:55 mail.domain.net dovecot[807537]: lmtp(807581): Disconnect from local: Logged out (state=READY)
sept. 29 15:40:55 mail.domain.net postfix/lmtp[807520]: 5E7F37F9E89: to=<[email protected]>, orig_to=<postmaster>, relay=mail.domain.net[private/dovecot-lmtp], delay=0.02, delays=0.01/0/0/0.01, dsn=5.2.2, status=bounced (host mail.domain.net[private/dovecot-lmtp] said: 552 5.2.2 <[email protected]> Quota exceeded (mailbox for user is full) (in reply to end of DATA command))
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807516]: 644BE7F9E8B: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 5E7F37F9E89: sender non-delivery notification: 644BE7F9E8B
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 644BE7F9E8B: from=<>, size=4376, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 644BE7F9E8B: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (undeliverable postmaster notification discarded)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 644BE7F9E8B: removed
sept. 29 15:40:55 mail.domain.net postfix/cleanup[807601]: 65F957F9E8C: message-id=<[email protected]>
sept. 29 15:40:55 mail.domain.net postfix/bounce[807514]: 5E7F37F9E89: postmaster non-delivery notification: 65F957F9E8C
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 65F957F9E8C: from=<[email protected]>, size=2273, nrcpt=1 (queue active)
sept. 29 15:40:55 mail.domain.net postfix/qmgr[807513]: 5E7F37F9E89: removed

And it keeps going the same way until I restart postfix & dovecot. It looks like the system geneates an email from postmaster to james, and since james's mailbox is full it keeps looping. Any clue on a parameter to fix this ?

Thanks in advance.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.