The qmail-maildir++ patch, which is fetched and enabled in case the
MAILDIRQUOTA option has been enabled miscalculates the file size in
qmail-local.c because the first two lines of the mail file (Return-Path and
Delivered-To) are not taken into account. As a result, the filesize
part of the S=<filesize> component of the Maildir++ compatible filename
is always too low. This hasn't been noticed for many years, since the
impact on quota calculation was negligible (typically less than 100
bytes per e-mail). I stumbled over this, because mail/dovecot2 2.1.7 is
actually comparing the value of S= with the result of stat and ends the
connection to correct the problem. This is also affecting any other
program using Maildir++, so this definitely needs to be fixed. The
specification of the Maildir++ format clearly states that the S=xxx
should match the size of the file (see also
The following line in the patch is the root of the problem:
s += fmt_ulong(s,st.st_size); *s++ = 0;
which should be:
s += fmt_ulong(s,st.st_size+rpline.len+dtline.len); *s++ = 0;
Port maintainer (garga@FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix)
Fix: The original patch has been done in 2005 by Bill Shupp, as far as I can
tell he's not really interested in it, so contacting him seems
pointless. Also, the patch that the port has been using until now was
modified (Bill's message was removed) and fetched from
http://www.alexdupre.com, which again provides no further information.
Since it seems painful to change this upstream, I removed the patch
from distfiles and placed the corrected patch into the files directory
of port skeleton. I changed Makefile to use this patch and bumped the
How-To-Repeat: Install mail/qmail using the MAILDIRQUOTA option. Create a
.qmail-<alias> file and make it deliver to a maildir. Compare the size
of the resulting file with the value of S= in the filename.
Over to maintainer (via the GNATS Auto Assign Tool)
Any chance to look into this? It's clearly not super critical, but
quite of a nuisance for people relying on this feature.