Browse Source

relocated spool, added sieve

Christoph Schug 23 years ago
parent
commit
9d6f9ceb34
3 changed files with 75 additions and 15 deletions
  1. 41 0
      imapd/cyrus.conf
  2. 1 1
      imapd/imapd.conf
  3. 33 14
      imapd/imapd.spec

+ 41 - 0
imapd/cyrus.conf

@@ -0,0 +1,41 @@
+##
+##  @l_prefix@/etc/cyrus-imapd/cyrus.conf - Cyrus IMAP server configuration
+##
+
+START {
+    #   do not delete this entry!
+    recover  cmd="@l_prefix@/bin/ctl_cyrusdb  -r"
+
+#   #   this is only necessary if using idled for IMAP IDLE
+#   idled    cmd="idled"
+}
+
+SERVICES {
+    imap     cmd="imapd"    listen="localhost:imap"  prefork=0
+    imaps    cmd="imapd -s" listen="localhost:imaps" prefork=0
+    pop3     cmd="pop3d"    listen="localhost:pop3"  prefork=0
+    pop3s    cmd="pop3d -s" listen="localhost:pop3s" prefork=0
+
+    #   at least one LMTP is required for delivery
+    #   KEEP the unix socket name IN SYNC with imapd.conf
+    lmtp     cmd="lmtpd" listen="localhost:lmtp"                   prefork=0
+    lmtpunix cmd="lmtpd" listen="@l_prefix@/var/imapd/socket/lmtp" prefork=0
+
+#   #   useful if you need to give users remote access to sieve
+#   sieve    cmd="timsieved" listen="localhost:sieve" prefork=0
+
+#   #   this one is needed for the notification services
+#   notify   cmd="notifyd" listen="@l_prefix@/var/imapd/socket/notify" prefork=1 proto="udp"
+}
+
+EVENTS {
+    #   this is required
+    checkpoint cmd="@l_prefix@/bin/ctl_cyrusdb -c"   period=30
+
+    #   this is only necessary if using duplicate delivery suppression
+    delprune   cmd="@l_prefix@/bin/ctl_deliver -E 3" period=1440
+
+    #   this is only necessary if caching TLS sessions
+    tlsprune   cmd="@l_prefix@/bin/tls_prune"        period=1440
+}
+

+ 1 - 1
imapd/imapd.conf

@@ -5,7 +5,7 @@
 
 #   Warning: Do not use a trailing slash in paths!
 configdirectory:        @l_prefix@/var/imapd
-partition-default:      @l_prefix@/var/spool/imap
+partition-default:      @l_prefix@/var/imapd/spool
 admins:                 @l_musr@
 defaultacl:             @l_musr@ lrswipcda
 sasl_pwcheck_method:    saslauthd

+ 33 - 14
imapd/imapd.spec

@@ -37,8 +37,9 @@ Release:      20030228
 
 #   list of sources
 Source0:      ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-%{version}.tar.gz
-Source1:      imapd.conf
-Source2:      rc.imapd
+Source1:      rc.imapd
+Source2:      cyrus.conf
+Source3:      imapd.conf
 Patch0:       imapd.patch
 
 #   build information
@@ -64,13 +65,38 @@ Provides:     IMAP
     %{l_shtool} subst \
         -e 's;db-4.1;db;g' \
         configure
+
+    #   ensure linking of Berkeley DB
     %{l_shtool} subst \
         -e 's;^\( *.LIBS..*\)\(\"\],.*\)$;\1 -ldb\2;' \
         perl/imap/Makefile.PL
+
+    #   ensure invocation of correct perl in cyradm
     %{l_shtool} subst \
         -e 's;^\(.) exec\) \(perl .*\)$;\1 %{l_prefix}/bin/\2;' \
         perl/imap/cyradm.sh
 
+    #   adjust hard-coded location of sieve
+    %{l_shtool} subst \
+        -e 's;"/usr/sieve";"%{l_prefix}/var/imapd/sieve";g' \
+        imap/lmtpd.c \
+        imap/mbdump.c \
+        imap/user.c \
+        man/imapd.conf.5 \
+        timsieved/actions.c
+
+    #   adjust default config to install environment for use in mkimap install helper script
+    %{l_shtool} install -c -m 644 \
+        -e "s;@l_prefix@;$RPM_BUILD_ROOT%{l_prefix};g" \
+        -e "s;@l_musr@;%{l_musr};g" \
+        %{SOURCE imapd.conf} \
+        imapd.conf-mkimap
+    %{l_shtool} subst \
+        -e 's;^exec perl ;exec %{l_prefix}/bin/perl ;' \
+        -e "s;/etc/imapd.conf;$RPM_BUILD_DIR/cyrus-imapd-%{version}/imapd.conf-mkimap;" \
+        -e "s;^\(\$sievedir = \"\).*$;\1$RPM_BUILD_ROOT%{l_prefix}/var/imapd/sieve\"\;;" \
+        tools/mkimap
+
 %build
     cflags="-I%{l_prefix}/include"
     ldflags="-L%{l_prefix}/lib"
@@ -89,7 +115,6 @@ Provides:     IMAP
         --with-statedir=%{l_prefix}/var/imapd \
         --with-auth=unix \
         --without-perl \
-        --disable-sieve \
         --with-cyrus-prefix=%{l_prefix} \
         --with-cyrus-user=%{l_musr} \
         --with-cyrus-group=%{l_mgrp}
@@ -109,7 +134,7 @@ Provides:     IMAP
       %{l_prefix}/bin/perl-openpkg install )
 
 %install
-    #rm -rf $RPM_BUILD_ROOT
+    rm -rf $RPM_BUILD_ROOT
 
     %{l_make} %{l_mflags} install \
         prefix=$RPM_BUILD_ROOT%{l_prefix} \
@@ -117,17 +142,14 @@ Provides:     IMAP
         cyrus_prefix=$RPM_BUILD_ROOT%{l_prefix}
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/imapd \
-        $RPM_BUILD_ROOT%{l_prefix}/var/imapd \
-        $RPM_BUILD_ROOT%{l_prefix}/var/spool
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/spool
 
     #   offer a sane configuration
-    cp master/conf/small.conf master/conf/cyrus.conf
-    %{l_shtool} subst -e "s;/var/imap/socket;%{l_prefix}/var/imapd/socket;g" \
-        master/conf/cyrus.conf
     %{l_shtool} install -c -m 644 \
         -e 's;@l_prefix@;%{l_prefix};g' \
         -e 's;@l_musr@;%{l_musr};g' \
-        %{SOURCE imapd.conf} master/conf/cyrus.conf \
+        %{SOURCE cyrus.conf} \
+        %{SOURCE imapd.conf} \
         $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/
 
     #   install the run command file
@@ -137,10 +159,7 @@ Provides:     IMAP
         %{SOURCE rc.imapd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
 
     #   use mkimap to create many directories for us
-    cp $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/imapd.conf imapd.conf.hack
-    %{l_shtool} subst -e "s;%{l_prefix};$RPM_BUILD_ROOT%{l_prefix};" \
-        imapd.conf.hack
-    tools/mkimap imapd.conf.hack
+    tools/mkimap imapd.conf-mkimap
 
     #   determine files
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \