> -----Messaggio originale-----
> Da: Ángel [mailto:[email protected]]
> Inviato: giovedì 10 maggio 2018 23:46
> A: [email protected]
> Oggetto: Re: [Courier-imap] R: Store maibox quota usage on MySQL
> database
> 
> Some time ago I made this simple program for extracting the maildir quota. It
> is a simple wrapper for using the quotafile functions that courier uses
> internally. As such, it is *much* faster than performing a du.
> 
[Scappatura Rocco] 

Hello!

Thank you for your anwers.. I will take in account for further refinements of 
my application.

> 
> Best regards
> 
[Scappatura Rocco] 

Regards,

RS

> 
> showmaildirquota.c
> /*
> License: GPL-3
> cd libs/numlib && ./configure
> cd ../rfc822 && ./configure
> cd ../maildir && ./configure
> sed -i '/quotawarnmsg.h/d' maildirquota.c gcc -Wall -
> DQUOTAWARNMSG='"quotawarn"' -DHAVE_CONFIG_H -I.. -I . -o
> showmaildirquota showmaildirquota.c maildirquota.c maildiropen.c
> maildircreate.c maildirparsequota.c ../rfc822/rfc822_mkdate.c
> ../numlib/strofft.c ../numlib/strsizet.c ../numlib/strtimet.c
> ../numlib/strhdevt.c ../numlib/strhinot.c  ../numlib/strpidt.c */ #include
> <stdlib.h> #include "maildirquota.h"
> 
> void folder_showquota(const char *folder) {
>         const char      *quotamsg;
>         struct maildirsize quotainfo;
> 
>         quotamsg=getenv("QUOTAUSAGE") != NULL ? getenv("QUOTAUSAGE")
> : "%2$s is at %1$d%% of the quota.\n";
> 
>         if (maildir_openquotafile(&quotainfo, folder))
>                 return;
> 
>         if (quotainfo.quota.nmessages != 0 ||
>             quotainfo.quota.nbytes != 0)
>                 printf(quotamsg, maildir_readquota(&quotainfo), folder);
> 
>         maildir_closequotafile(&quotainfo);
> }
> 
> int main(int argc, char** argv) {
>       int i;
>       if (argc < 2) {
>               fprintf(stderr, "Usage: %s <maildir1> <maildir2…>\n",
> argv[0]);
>       }
>       for (i=1; i < argc; i++) {
>               folder_showquota(argv[i]);
>       }
>       return 0;
> }
> 
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most engaging
> tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Courier-imap mailing list
> [email protected]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to