From 5d47a7101a2394c7f7bb288585464fa293a2ad33 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Feb 2013 02:48:34 +0100 Subject: [PATCH] maildir++ for qmail-local and qmail-pop3d Patch to make qmail-local and qmail-pop3d compatible with the maildir++ quota system that is used by vpopmail and courier-imap qmail-maildir++ --- maildirparsequota.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 maildirparsequota.c (limited to 'maildirparsequota.c') diff --git a/maildirparsequota.c b/maildirparsequota.c new file mode 100644 index 0000000..35e7d99 --- /dev/null +++ b/maildirparsequota.c @@ -0,0 +1,44 @@ +/* +** Copyright 1998 - 1999 Double Precision, Inc. +** See COPYING for distribution information. +*/ + +#if HAVE_CONFIG_H +#include "config.h" +#endif +#include "maildirquota.h" +#include +#include + +static const char rcsid[]="$Id: maildirparsequota.c,v 1.2 1999/12/06 13:21:05 mrsam Exp $"; + +int maildir_parsequota(const char *n, unsigned long *s) +{ +const char *o; +int yes; + + if ((o=strrchr(n, '/')) == 0) o=n; + + for (; *o; o++) + if (*o == ':') break; + yes=0; + for ( ; o >= n; --o) + { + if (*o == '/') break; + + if (*o == ',' && o[1] == 'S' && o[2] == '=') + { + yes=1; + o += 3; + break; + } + } + if (yes) + { + *s=0; + while (*o >= '0' && *o <= '9') + *s= *s*10 + (*o++ - '0'); + return (0); + } + return (-1); +} -- cgit v1.2.3