[Dovecot] RFE: please include quota waning patch
hi, it'd be very useful to include the quota warning patch in official release. without it the quota support is not really useful since mail simple dropped when quota is over. and most enduser never know what happend, they just recognize mails are not coming:-( thanks.
-- Levente "Si vis pacem para bellum!"
On 23.7.2007, at 18.41, Farkas Levente wrote:
it'd be very useful to include the quota warning patch in official release. without it the quota support is not really useful since mail simple dropped when quota is over. and most enduser never know what happend, they just recognize mails are not coming:-(
It's already in v1.1 tree, and v1.0 won't be having any new features.
If it's not featureful enough, use v1.1. :)
Greetings -
On 25 Jul 2007, at 15:18, Timo Sirainen wrote:
On 23.7.2007, at 18.41, Farkas Levente wrote:
it'd be very useful to include the quota warning patch in official release. without it the quota support is not really useful since mail simple dropped when quota is over. and most enduser never know what happend, they just recognize mails are not coming:-(
It's already in v1.1 tree, and v1.0 won't be having any new
features. If it's not featureful enough, use v1.1. :)
Will v1.1 include support for reporting quotas from NFS-mounted
mailstores please?
We are using filestore mounted over NFS from a NetApp filer with
Maildir and filestore-based quotas. It would be nice if Dovecot was
able to report current quota usage and the maximum allowed.
(I've made a patch which I'm using for this on v1.0.2 at present, but
am hoping it'll be officially supported in v1.1)
Cheers, Mike B-)
-- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740
- Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
El Lunes, 30 de Julio de 2007 10:57, Mike Brudenell escribió:
(I've made a patch which I'm using for this on v1.0.2 at present, but am hoping it'll be officially supported in v1.1)
Could you share it please? As previously reported, the "official" patch is not working right now.
Aaaaaaaaaaagur.
Joseba Torre. CIDIR Bizkaia.
Greetings -
On 30 Jul 2007, at 10:05, Joseba Torre wrote:
Could you share it please? As previously reported, the "official"
patch is not working right now.Aaaaaaaaaaagur.
I'm attaching the patch files and a tar archive that comprise the
changes I use to support reading quotas from NFS-mounted filestore.
The patches are against the Dovecot 1.0.2 source code.
The files within the rpc-quota.tar.gz archive in an old posting to a
NetApp filers list; they form a sample means of querying the rquotad
on the filer.
It assumes you have the command "rpcgen" on your system to process
the supplied rquota.x file and produce the associated include files.
So it's not quite just applying the patches, but is very simple; just
save the attached files somewhere and follow the steps below to apply
them...
mountpoint.c
This is a patch Timo put out on the list a week or so back
following my
problems skipping over filestores with the "ignore" options set.
I've used
this on our non-production server and have found it fine. You may
need it
if you are using the automounter, otherwise the NFS quota code may
end up
operating on the automount template point rather than the real
mounted
directory.
cd src/lib
gpatch <mountpoint.c
The remaining three files are all for the quota plugin directory, so
start off by going there:
cd src/plugins/quota
rpc-quota.tar.gz
This is a GZipped tar archive containing a directory to be
unpacked here. The
directory contains the rquota.x and Makefile from the sample code
I found. It
also includes my own rpc-quota.h and rpc-quota-code.c files: these
get
included in quota-fs.c by one of the patches below.
gzcat rpc-quota.tar.gz | tar xvf -
Now move down into the rpc-quota directory you've just unpacked
and generate
the other include files you need using rpcgen:
cd rpc-quota
gmake
cd ..
quota-fs.c
This is a patch that first includes the rpc-quota/rpc-quota.h
file, which
includes some header files and define the fetchnfsquotas() we'll
be using.
It also changes the code that attempts to get the quota from a
locally mounted
filesystem. If this wasn't possible (root->mount->fd == -1)
instead of
returning, call the code included from rpc-quota/rpc-quota-code.c
to check for
a ":" in the path and, if found, use an RPC to get the quota from
the NFS
server.
gpatch <quota-fs.c
quota.c
Strictly speaking you don't need this patch, although I would
suggest it.
When preparing the quotaroot name this change checks if the name
would be
the empty string and, if it is, replaces it with the username
obtained by
calling getpwuid(getuid()). Without this patch Apple's "Mail"
program
recognises the server supports quotas (from the capability
string), but
does not show their values or draw the bar-chart. Basically it
will only
do so if the quotaroot name is non-empty. [The IMAP specification
allows
for empty -- "" -- quotaroot names, so Apple's Mail client is
technically
in violation.]
gpatch <quota.c
You'll get output looking something like this:
% gmake
rpcgen -o rquota.h -h rquota.x
cc -O -g -DSUNOS5 -c -o quotatest.o quotatest.c
rpcgen -o rquota_xdr.c -c rquota.x
cc -O -g -DSUNOS5 -c -o rquota_xdr.o rquota_xdr.c
rpcgen -o rquota_clnt.c -l rquota.x
cc -O -g -DSUNOS5 -c -o rquota_clnt.o rquota_clnt.c
cc -o quotatest quotatest.o rquota_xdr.o rquota_clnt.o -
lsocket -lnsl
Don't worry unduly about the -DSUNOS5 macro being defined: that is
for the
quotatest test program, and doesn't seem to be for the files
generated by
rpcgen (I think!).
That should be everything: just recompile, install and hope!
You can test it by connecting to your IMAP server and giving a
QUOTAROOT command:
telnet imap.yourdomain.tld 143
a01 login yourusername yourpassword
a02 getquotaroot inbox
...output appears here...
a03 logout
You should get output that looks something like this:
a02 getquotaroot inbox
* QUOTAROOT "inbox" "pmb1"
* QUOTA "pmb1" (STORAGE 71260 102400)
a02 OK Getquotaroot completed.
Then give it a go for real.
If you find it doesn't work don't give up hope yet. Instead rummage
through your /usr/include directory tree looking for your own
system's rquota.x file; then try it instead of the one I've included.
Finally, remember that the files in the rpc-quota directory aren't
included in Dovecot's own Makefiles. So if you change any of them
you'll need to update the timestamp of the quota-fs.c plugin before
make will notice the change and recompile it:
touch src/plugins/quota/quota-fs.c
Cheers, Mike B-)
-- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740
- Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
Greetings -
On 31 Jul 2007, at 17:18, Mike Brudenell wrote:
I'm attaching the patch files and a tar archive that comprise the
changes I use to support reading quotas from NFS-mounted
filestore. The patches are against the Dovecot 1.0.2 source code.
Just to let you know that the patches/code I posted yesterday to
support reading quotas from NFS-mounted mailstore using RPC still
apply and work OK against Dovecot 1.0.3
However the patch for mountpoint.c is NOT needed with (and indeed
should not be applied to) v1.0.3 as this includes the fix, although
implemented in a slightly different way. [Well done, Timo, for
finding the hasmntopt() library function; I didn't know of that one
myself.]
Cheers, Mike B-)
-- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740
- Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
participants (4)
-
Farkas Levente
-
Joseba Torre
-
Mike Brudenell
-
Timo Sirainen