High Traffic Usage Due to IMAP Access Attempts on Domain with Exceeded Quota

Django258

Verified User
Joined
Apr 1, 2022
Messages
13
I have observed anomalous traffic on my server originating from a specific IP address. Upon further investigation, I determined that IMAP connections initiated by this IP address were not terminating correctly. Instead, they entered a persistent loop due to the domain's exceeded disk quota. These repeated connection attempts generated thousands of log entries, such as:

Jun 27 17:14:27 server dovecot[3499375]: imap(account@domain)<3692849><dhT1aA4i6aDSFRt>: Error: open(/home/user/imap/domain/account/Maildir/dovecot-uidlist.lock) failed: Disk quota exceeded
Jun 27 17:14:27 server dovecot[3499375]: imap(account@domain)<3692849><dhT1aA4i6aDSFRt>: Error: Mailbox INBOX: file_dotlock_create(/home/user/imap/domain/account/Maildir/dovecot-uidlist) failed: Disk quota exceeded

The anomalous traffic ceased only after I increased the quota to resolve the exceeded state (the affected email account utilizes 9GB).

This suggests that Dovecot/DirectAdmin may not optimally handle connections to accounts with exceeded quotas. Such behavior could lead to systemic issues if multiple heavily accessed accounts simultaneously exceed their quotas.

To mitigate this, I propose implementing the following configuration adjustments:
mkdir -p /usr/local/directadmin/custombuild/custom/dovecot/conf/

cat > /usr/local/directadmin/custombuild/custom/dovecot/conf/10-memlimit.conf <<EOF
service imap {
vsz_limit = 512 M
}
service pop3 {
vsz_limit = 512 M
}
EOF

cat > /usr/local/directadmin/custombuild/custom/dovecot/conf/90-quota.conf <<EOF
quota {
driver = maildir
quota_exceeded_message = "Your disk quota has been exceeded. Free space to enable email operations."
status_overquota = "452 4.2.2 Mailbox full"
}
EOF

cat > /usr/local/directadmin/custombuild/custom/dovecot/conf/20-protocols.conf <<EOF
protocol imap {
mail_plugins = quota imap_quota
}
protocol pop3 {
mail_plugins = quota
}
EOF

da build dovecot_conf
systemctl restart dovecot



Query:
Could these configurations effectively prevent accounts with exceeded quotas from causing anomalies like excessive traffic and high memory consumption in Dovecot? I welcome your insights on whether these changes address the root cause.
 
Back
Top