Currently vpopmail doesn't include trashed messages in quota usage.
These are messages that were marked as deleted (IMAP flag \Deleted) but
are still not expunged. These are denoted by the T flag in Maildir:
It seems two of the popular mail servers out there have opposing
behavior: courier doesn't count trashed messages while dovecot does
In my setup I have some users, who seem to forgot to expunge (also known
as "Compact" in thunderbird) their mailboxes and trahsed messages keep
piling up and filling filesystems. That's why I prefer including trashed
messages in quota usage and forcing users to take measures this way.
I guess it'd be best to add a configuration option (either ./configure
compile time or runtime to some config file), but for my specific case I
patched maildirquota.c with the attached patch.
--- maildirquota.h.orig 2015-02-03 14:34:30.000000000 +0200
+++ maildirquota.h 2015-02-03 14:19:38.000000000 +0200
@@ -16,6 +16,12 @@
#define MAILDIRSIZE_OVERLEN 5120
#define MAILDIRSIZE_OLD_SECS 15*60
+ * Count messages marked as deleted, but still not expunged:
+ * http://cr.yp.to/proto/maildir.html
+#define QUOTA_COUNT_TRASHED 1
/* I've removed pretty much the whole file execept for
some public functions so as to not conflict with courier.
I"ve made the courier functions static.
--- maildirquota.c.orig 2015-02-03 13:15:37.000000000 +0200
+++ maildirquota.c 2015-02-03 14:35:47.000000000 +0200
@@ -990,9 +990,7 @@
const char *n=de->d_name;
if (*n == '.') continue;
- /* PATCH - do not count msgs marked as deleted */
+#if QUOTA_COUNT_TRASHED == 0
for ( ; *n; n++)
if (n != ':' || n != '2' ||
@@ -1006,6 +1004,7 @@
if (*n == 'T') continue;