By default dovecot if mailbox quota is exceeded drops a 552 error which would mean for exim to decline the message without further retry to deliver it. In /var/log/exim/mainlog on Directadmin powered server you could see:
2015-09-13 00:43:00 1ZaplM-0004uQ-2Y <= server@poralix.net U=root P=local S=6330851 T="test" from <server@poralix.net> for test@test.com 2015-09-13 00:43:00 1ZaplM-0004uQ-2Y ** test@test.com F=<server@poralix.net> R=virtual_user T=dovecot_lmtp_udp: LMTP error after end of data: 552 5.2.2 <test@test.com> Quota exceeded (mailbox for user is full) 2015-09-13 00:43:00 1ZaplM-0004uQ-2Y Completed
The reply code 552 stands for "Requested mail action aborted: exceeded storage allocation.". So to make exim to put a declined message into queue instead of immediate decline we need to set quota_full_tempfail = yes in dovecot.
If you run directadmin with custombuild 2 here are the instructions:
mkdir -p /usr/local/directadmin/custombuild/custom/dovecot/conf/ cp /usr/local/directadmin/custombuild/configure/dovecot/conf/lmtp.conf /usr/local/directadmin/custombuild/custom/dovecot/conf/
Open the file /usr/local/directadmin/custombuild/custom/dovecot/conf/lmtp.conf for editing and find section:
protocol lmtp {
and before the } (closing curly bracket) add a new line with:
quota_full_tempfail = yes
So that you would see something similar to the following:
protocol lmtp { !include lmtp_mail_plugins.conf log_path = /var/log/dovecot-lmtp-errors.log info_log_path = /var/log/dovecot-lmtp.log postmaster_address = postmaster@HOSTNAME quota_full_tempfail = yes }
Save and exit. Run this:
/usr/local/directadmin/custombuild ./build update ./build set dovecot_conf yes ./build dovecot_conf
Restart dovecot
With this we made dovecot to return "452 Requested action not taken: insufficient system storage" if quota is exceeded, and exim will put an email in such a situation in a queue, and now we should change retry section in exim.conf
Open /etc/exim.conf and find lines:
begin retry * quota * * F,2h,15m; G,16h,1h,1.5; F,4d,8h # End of Exim 4 configuration
and remove
* quota
save, exit and restart exim.
Now if you try to send an email to a full mailbox, you will see in exim's logs something like this:
check the exim queue:2015-09-13 00:49:24 1ZaprY-0005vF-ES <= server@poralix.net U=root P=local S=6330851 T="test" from <server@poralix.net> for test@test.com 2015-09-13 00:49:24 1ZaprY-0005vF-ES == test@test.com R=virtual_user T=dovecot_lmtp_udp defer (-46): LMTP error after end of data: 452 4.2.2 <test@test.com> Quota exceeded (mailbox for user is full)
[root@server ~]# exim -bp 42m 6.0M 1ZaprY-0005vF-ES <server@poralix.net> test@test.com [root@server ~]#
P.S. As for now CustomBuild 2 does not give any instrument to customize retry section. Thus if you keep your exim.conf updated with custombuild you will loose all customization. So that's up to you to protect the file from being overwritten.