Hi,

I just try to get cyrus imapd 2.0.14 working on my SuSE 7.2 box,
creating a modified version of the (2.0.12) RPM file from ftp.suse.com,
and considering some old version of an RPM from ftp.redhat.com.

1) I want to suggest the first two patches as "formal" improvements for
the next cyrus-imapd release.

 - as far as I understand, the tcl version of cyradm is considered
outdated. That's why I suggest to move cyradm.1 from man/ to cyradm/,
from where it can be manually installed if wanted. Currently the
cyradm.1 manpage is first installed and afterwards overwritten during
installation of the perl version.

 - SuSE uses a different mandir. This is currently not very well
supported. In the redhat RPM file I found a 2.0.5-mandir patch, on which
my mandir-patch is based. (see first attachment)

 - within SuSEs rpm file I found a patch to imap/quota.c which adds the
't' option for a quota report. As it might be useful (currently I have
no own experiences), I updated this patch for 2.0.14 (see second
attachment).


2) I found some more patches within SuSEs (attachments 3 + 4) and
Redhats (attachment 5) RPM file, but I can't comment on them, cause I
didn't fully understand what they fix :-) Maybe somebody can explain,
whether one should use them ...


 3) My last attachment is a shell script, which adds some services to
/etc/services. This can be integrated into an RPM file, at least until
the officially distributed version of /etc/services contains all
services used by cyrus. I'm sure there are more elegant ways to
implement such a script e.g. in perl, but this one works for me :-)


This was for the simple part. I just managed to compile/install
cyrus-imapd-2.0.14.rpm on my SuSE 7.2 box.

Now I will have to face the hard task: trying to configure it for our
demands as a small standalone mail server together with postfix,  and
maybe later also websieve,  HORDE/IMP  and whatever other useful tools I
can get :-)

Olaf.
--- cyrus-imapd-2.0.5/man/Makefile.in   Sat Jun 17 18:49:10 2000
+++ cyrus-imapd-2.0.5/man/Makefile.in   Sat Jun 17 18:49:48 2000
@@ -60,8 +60,9 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 cyrus_prefix = @cyrus_prefix@
+mandir=@mandir@
 
-MAN1 = $(srcdir)/cyradm.1 $(srcdir)/imtest.1 $(srcdir)/installsieve.1
+MAN1 = $(srcdir)/imtest.1 $(srcdir)/installsieve.1
 MAN3 = $(srcdir)/imclient.3
 MAN5 = $(srcdir)/imapd.conf.5 $(srcdir)/krb.equiv.5 $(srcdir)/cyrus.conf.5
 MAN8 = $(srcdir)/arbitron.8 $(srcdir)/collectnews.8 $(srcdir)/deliver.8 \
@@ -77,19 +78,19 @@
 install:
        for file in $(MAN1); \
        do \
-               $(INSTALL) -m 644 $$file $(DESTDIR)$(prefix)/man/man1 || exit 1; \
+               $(INSTALL) -m 644 $$file $(DESTDIR)$(mandir)/man1 || exit 1; \
        done
        for file in $(MAN3); \
        do \
-               $(INSTALL) -m 644 $$file $(DESTDIR)$(prefix)/man/man3 || exit 1; \
+               $(INSTALL) -m 644 $$file $(DESTDIR)$(mandir)/man3 || exit 1; \
        done
        for file in $(MAN5); \
        do \
-               $(INSTALL) -m 644 $$file $(DESTDIR)$(prefix)/man/man5 || exit 1; \
+               $(INSTALL) -m 644 $$file $(DESTDIR)$(mandir)/man5 || exit 1; \
        done
        for file in $(MAN8); \
        do \
-               $(INSTALL) -m 644 $$file $(DESTDIR)$(prefix)/man/man8 || exit 1; \
+               $(INSTALL) -m 644 $$file $(DESTDIR)$(mandir)/man8 || exit 1; \
        done
 
 .c.o:
--- cyrus-imapd-2.0.5/Makefile.in       Sat Jun 17 18:50:20 2000
+++ cyrus-imapd-2.0.5/Makefile.in       Sat Jun 17 18:50:46 2000
@@ -56,6 +56,7 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 cyrus_prefix = @cyrus_prefix@
+mandir = @mandir@
 
 all:: checkdepend
        @for d in  $(SUBDIRS); \
@@ -68,10 +69,10 @@
        $(srcdir)/install-sh -d ${DESTDIR}$(exec_prefix)/bin
        $(srcdir)/install-sh -d ${DESTDIR}$(exec_prefix)/lib
        $(srcdir)/install-sh -d ${DESTDIR}$(prefix)/include/cyrus
-       $(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man1
-       $(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man3
-       $(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man5
-       $(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man8
+       $(srcdir)/install-sh -d ${DESTDIR}$(mandir)/man1
+       $(srcdir)/install-sh -d ${DESTDIR}$(mandir)/man3
+       $(srcdir)/install-sh -d ${DESTDIR}$(mandir)/man5
+       $(srcdir)/install-sh -d ${DESTDIR}$(mandir)/man8
        @for d in  $(SUBDIRS); \
        do \
                (cd $$d; echo "### Making" install "in" `pwd`;  \
--- cyrus-imapd-2.0.14.orig/imap/quota.c        Mon Mar  5 23:27:25 2001
+++ cyrus-imapd-2.0.14.patched/imap/quota.c     Tue Jul  3 12:14:01 2001
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  */
-/* $Id: quota.c,v 1.38 2001/03/05 22:27:25 leg Exp $ */
+/* $Id: quota.c,v 1.39 2001/07/03 12:13:41 leg Exp $ */
 
 
 #include <config.h>
@@ -122,11 +122,12 @@
     int opt;
     int fflag = 0;
     int r, code = 0;
+    int tflag = 0;
     char *alt_config = NULL;
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
 
-    while ((opt = getopt(argc, argv, "C:f")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:ft")) != EOF) {
        switch (opt) {
        case 'C': /* alt config file */
            alt_config = optarg;
@@ -136,6 +137,10 @@
            fflag = 1;
            break;
 
+       case 't':
+           tflag = 1;
+           break;
+
        default:
            usage();
        }
@@ -151,13 +156,16 @@
        mboxlist_done();
     }
 
-    if (!r) reportquota();
+    if (!r && !tflag) reportquota();
 
     if (r) {
        com_err("quota", r, (r == IMAP_IOERROR) ? error_message(errno) : NULL);
        code = convert_code(r);
     }
 
+    if (tflag) /* overwrite code with requested flag */
+       code = testquota();
+
     exit(code);
 
     return 0;
@@ -165,7 +173,13 @@
 
 void usage(void)
 {
-    fprintf(stderr, "usage: quota [-C <alt_config>] [-f] [prefix]...\n");
+    fprintf(stderr, 
+           "usage: quota [-C <alt_config>] [-t] [-f] [prefix]...\n"\
+           "\n"\
+           "       -C <alt_config> : use alternate config file\n"\
+           "       -t              : print quota usage report\n"\
+           "       -f              : fix quota inconsistencies\n"\
+           "       [prefix]...     : optional mailbox prefix\n");
     exit(EC_USAGE);
 }    
 
@@ -488,4 +502,31 @@
 {
     fprintf(stderr, "quota: %s\n", s);
     exit(code);
+}
+
+/*
+ * print's a line of current quota usage of the user specified on
+ * the commandline
+ */
+int
+testquota()
+{
+    int i;
+    int q_warn;
+    int q_limit, q_used;
+    double q_percent_used;
+
+    q_warn = config_getint("quotawarn", 90);
+
+    for (i = 0; i < quota_num; i++) {
+        q_limit        = quota[i].quota.limit*QUOTA_UNITS;
+        q_used         = quota[i].quota.used;
+        q_percent_used = ((double) quota[i].quota.used * 100.0)
+                         / (double) (quota[i].quota.limit * QUOTA_UNITS);
+
+        printf("limit=%d used=%d percent_used=%.2f warnat=%d\n",
+                q_limit, q_used, q_percent_used, q_warn);
+    }
+
+    return 0;
 }
--- cyrus-imapd-2.0.12.orig/aclocal.m4  Wed May 30 19:07:23 2001
+++ cyrus-imapd-2.0.12.patched/aclocal.m4       Tue Jul  3 12:51:26 2001
@@ -48,7 +48,7 @@
     SAVE_LDFLAGS="${LDFLAGS}"
     LDFLAGS="-R /usr/lib"
     AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
-       LDFLAGS="-Wl,-rpath,/usr/lib"
+#      LDFLAGS="-Wl,-rpath,/usr/lib"
     AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
     [andrew_runpath_switch="none"])
     ])
--- cyrus-imapd-2.0.12.orig/imap/lmtpengine.c   Wed Apr 11 20:42:23 2001
+++ cyrus-imapd-2.0.12.patched/imap/lmtpengine.c        Tue Jul  3 12:29:40 2001
@@ -815,7 +815,7 @@
        clean_retpath(rpath);
        /* Append our hostname if there's no domain in address */
        hostname = NULL;
-       if (!strchr(rpath, '@')) {
+       if ((rpath[0] != '\0') && (!strchr(rpath, '@'))) {
            hostname = config_servername;
        }
 
--- cyrus-imapd-2.0.9/perl/sieve/lib/Makefile.in.cflags Sat Jan 20 19:31:45 2001
+++ cyrus-imapd-2.0.9/perl/sieve/lib/Makefile.in        Sat Jan 20 19:31:53 2001
@@ -54,7 +54,7 @@
 IMAP_LIBS = @IMAP_LIBS@
 DEPLIBS = ../../../lib/libcyrus.a @DEPLIBS@
 
-CFLAGS = -g
+CFLAGS = -g @CFLAGS@
 LDFLAGS = -g @LDFLAGS@
 
 SHELL = /bin/sh

cyrus-imapd_add-services.sh

Reply via email to