I have either found a bug, or have a config issue – or just don’t understand things !!
First, does VirtualMin GPL support user disk quota processing/checking when handling an incoming mail message via procmailrc ?
My workaround is to edit both lookup-domain.pl and lookup-domain-daemon.pl to force qmode to be HOME all the time — as presently the logic to set qmode ends up with it being blank/null. We only recently switched to postfix from sendmail as well as to/from using Maildir VS /var/spool/mail (also called /var/mail) so any of those settings could be in play.
The code for setting qmode in lookup-domain.pl is
$qmode = &mail_under_home() && &has_home_quotas() ? “home” :
&has_mail_quotas() ? “mail” : undef;
and one or more of those routines (mail_under_home, has_home_quotas and has_mail_quotas) will obviously give different answers depending on sendmail/postfix as well as the Maildir selection/setting.
My general take on this is – when /var/mail and the Maildir area under /homes/ are on the same filesystem, the user’s disk quota covers both, so I am not sure why qmode, at least in my environment, would ever be blank. And as the routines mail_under_home has_home_quotas has_mail_quotas are most likely used in other places too, I hesitate on editing them so they give different results.
And instead of sending message after message, a test I came up with which I hope is valid is:
cat big-file.dat | /etc/webmin/virtual-server/lookup-domain.pl verne@mingocountywv.com
Disk quota for verne@mingocountywv.com of 283115520 blocks has been reached.
141175749723247
where the verne account is already over quota (and 141175749723247 is the internal VirtualMin Domain ID). The above test was done AFTER I made my custom edit to force qmode=HOME all the time, as the original code appears to not properly check for being over quota.
That is, if I understand /etc/procmailrc, I expect to get a 73 return code, which in turn results in /var/log/procmailrc.log logging:
procmail: Program failure (73) of “/etc/webmin/virtual-server/lookup-domain.pl”
My custom edit seems to be the only way to get a 73 exit code when over quota.
OR – I need to step back and think this through as perhaps its a non-issue as the test msg never gets delivered when the user is over quota.
And I hope I am not treading into Pro features here
thoughts anyone?
Verne