From 9d65fa65acd1f24bdaeb7d6a1c14d049ecab46dc Mon Sep 17 00:00:00 2001
From: Michal Hlavinka
Date: Tue, 8 Jun 2010 11:01:40 +0000
Subject: [PATCH] - spec cleanup - simplified packaging (merge -perl in -utils)
- remove obsoleted and/or unmaintained additional sources/patches - remove
long time not used files from the cvs/srpm - update additional
sources/patches from their upstream step 1
---
README.HOWTO-recover-mailboxes.db | 31 -
README.skiplist_recovery | 21 -
allow_auth_plain_proxying.patch | 28 -
batchreconstruct | 32 -
bsd2cyrus | 81 --
cpmsg | 26 -
cyrus-deliver-wrapper.c | 34 -
cyrus-imapd-2.1.16-getrlimit.patch | 23 -
cyrus-imapd-2.2.12-no_transfig.patch | 13 -
... cyrus-imapd-2.3.16-autocreate-0.10-0.diff | 1216 +++++++++--------
...=> cyrus-imapd-2.3.16-autosieve-0.6.0.diff | 20 +-
cyrus-imapd-2.3.7-krb4.patch | 23 -
cyrus-imapd-2.3.7-notify_sms.patch | 308 -----
...apd-2.3.9-rmquota+deletemailbox-0.2-1.diff | 514 -------
cyrus-imapd-README.RPM | 2 +-
cyrus-imapd-README.groupcache | 30 -
cyrus-imapd-acceptinvalidfrom.patch | 34 -
cyrus-imapd-procmail+cyrus.mc | 28 -
cyrus-imapd-sendmail-8.12.9-cyrusv2.m4 | 29 -
cyrus-imapd.cvt_cyrusdb_all | 197 ++-
cyrus-imapd.rpm_set_permissions | 30 -
cyrus-imapd.spec | 101 +-
cyrus-imapd.upd_groupcache | 66 -
cyrus-procmailrc | 129 --
cyrus-user-procmailrc.template | 58 -
cyrus_ldap_quota.pl | 127 --
folderxfer | 46 -
imapcreate.pl | 159 ---
inboxfer | 36 -
skiplist.py | 172 ---
30 files changed, 783 insertions(+), 2831 deletions(-)
delete mode 100644 README.HOWTO-recover-mailboxes.db
delete mode 100644 README.skiplist_recovery
delete mode 100644 allow_auth_plain_proxying.patch
delete mode 100644 batchreconstruct
delete mode 100644 bsd2cyrus
delete mode 100644 cpmsg
delete mode 100644 cyrus-deliver-wrapper.c
delete mode 100644 cyrus-imapd-2.1.16-getrlimit.patch
delete mode 100644 cyrus-imapd-2.2.12-no_transfig.patch
rename cyrus-imapd-2.3.12p2-autocreate-0.10-0.diff => cyrus-imapd-2.3.16-autocreate-0.10-0.diff (92%)
rename cyrus-imapd-2.3.12p2-autosieve-0.6.0.diff => cyrus-imapd-2.3.16-autosieve-0.6.0.diff (88%)
delete mode 100644 cyrus-imapd-2.3.7-krb4.patch
delete mode 100644 cyrus-imapd-2.3.7-notify_sms.patch
delete mode 100644 cyrus-imapd-2.3.9-rmquota+deletemailbox-0.2-1.diff
delete mode 100644 cyrus-imapd-README.groupcache
delete mode 100644 cyrus-imapd-acceptinvalidfrom.patch
delete mode 100644 cyrus-imapd-procmail+cyrus.mc
delete mode 100644 cyrus-imapd-sendmail-8.12.9-cyrusv2.m4
delete mode 100644 cyrus-imapd.rpm_set_permissions
delete mode 100644 cyrus-imapd.upd_groupcache
delete mode 100644 cyrus-procmailrc
delete mode 100644 cyrus-user-procmailrc.template
delete mode 100644 cyrus_ldap_quota.pl
delete mode 100644 folderxfer
delete mode 100644 imapcreate.pl
delete mode 100644 inboxfer
delete mode 100644 skiplist.py
diff --git a/README.HOWTO-recover-mailboxes.db b/README.HOWTO-recover-mailboxes.db
deleted file mode 100644
index b1ab5cc..0000000
--- a/README.HOWTO-recover-mailboxes.db
+++ /dev/null
@@ -1,31 +0,0 @@
-With this rpm, you should usually find backups of your mailboxes.db
-in /var/lib/imap/backup/. If you don't have them, for any reason,
-you can recreate it like this.
-
-Note: The scripts doesn't care with different hashing schemes of
-the mailspool. Adjust as needed!
-And please, check the permissions mailboxes.db after creating it.
-
-#!/bin/sh
-#
-
-# stop cyrus-imapd
-service cyrus-imapd stop
-
-# backup existing mailboxes.db
-mv /var/lib/imap/mailboxes.db /var/lib/imap/mailboxes.db.$$
-find /var/spool/imap/?/user -maxdepth 1 -mindepth 1 | \
- while read i; do
- echo $(basename $i)
- echo "user.$i<\t>default<\t>$i<\t>lrswipcda<\t>cyrus<\t>lrswipcda" >> /tmp/newmboxlist.txt
- done
-
-# we have everyone's base directory in /tmp/newmboxlist.txt, now we
-# import the new list
-/usr/lib/cyrus-imapd/ctl_mboxlist -u ) {
- chop;
- system("$cmd user.$_");
-}
-close MB;
-
diff --git a/bsd2cyrus b/bsd2cyrus
deleted file mode 100644
index 35f91a1..0000000
--- a/bsd2cyrus
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/perl
- eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
- if $running_under_some_shell;
-#
-# Usage: bsd2cyrus inputfile
-#
-# Purpose: Maps a user's Berkeley-format mail folder names into the
-# Cyrus namespace
-#
-# Input: List of usernames, one per line
-#
-# Output: Lines of the format
-# username:Cyrus-mailbox-name:BSD-mailbox-name
-#
-#$Id: bsd2cyrus,v 1.1 2004/02/04 12:59:42 karsten Exp $
-
-require "find.pl";
-
-# User's subdirectory where personal mail folders are stored
-# (typically $HOME/mail)
-$maildir = "mail";
-
-$inputfile = "$ARGV[0]";
-if (! $inputfile) { die "Usage: $0 inputfile\n"; }
-
-open (DATA, $inputfile) || die "can't open $inputfile";
-while () {
- chop;
- ($user,$pw,$uid,$gid,$quota,$cmnt,$gcos,$home) = getpwnam $_;
- next if $home eq "";
- &find("$home/$maildir");
-}
-close DATA;
-
-foreach (@folders) {
-
- ($user,$folder) = split(/:/,$_,2);
- if (! rfc822($folder) ) { next; }
- @tokens = split(/\//, $folder);
- $mailbox = $tokens[$#tokens];
-
- # Sanity checks - earlier tests should have caught these.
-
- next if ($mailbox =~ /\.gz$/); # Skip gzipped files
- next if ($mailbox =~ /\.Z$/); # Skip compressed files
- next if ($mailbox =~ /^\./); # Skip hidden files
-
- # Replace "bad" characters with an underscore followed by
- # the ASCII representation of the "bad" character.
-
- $mailbox = rm_badchars($mailbox);
- print "$user:user.$user.$mailbox:$folder\n";
-}
-
-sub wanted {
- (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
- -f _;
- if ($_ ne '.') { push @folders, "$user:$dir/$_"; }
-}
-
-sub rfc822 {
-
- my ($file) = @_;
- my ($rc) = 1;
- if (-d $file || -z $file || -B $file || -x $file) {
- $rc = 0;
- }
- return $rc;
-}
-
-sub rm_badchars {
-
- my ($mailbox) = @_;
- $mailbox =~ s/ /_040/g;
- $mailbox =~ s/\!/_041/g;
- $mailbox =~ s/\"/_042/g;
- $mailbox =~ s/\#/_043/g;
-
- return $mailbox;
-}
-
diff --git a/cpmsg b/cpmsg
deleted file mode 100644
index 56dfe8b..0000000
--- a/cpmsg
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/perl
-#
-# Usage: cat mailbox.txt | formail -s cpmsg
-#
-# where 'cpmsg' is the name of this script
-#
-# Purpose: Called by formail once for each mail message in a Berkeley-
-# format mailbox
-#
-#$Id: cpmsg,v 1.1 2005/04/15 20:24:15 jdennis Exp $
-
-$maildir = "$ARGV[0]";
-if (!$maildir) { die "Usage: $0 $maildir"; }
-
-# Formail increments this number for each message. The
-# leading "0"'s must be removed (e.g. 001 becomes 1)
-
-$filenum = ($ENV{FILENO} - 0) + 1;
-
-open (OUTFILE,">$maildir/$filenum.");
-while () {
- chop;
- print OUTFILE "$_\015\012"; # Add CRLF to each line!
-}
-close OUTFILE;
-
diff --git a/cyrus-deliver-wrapper.c b/cyrus-deliver-wrapper.c
deleted file mode 100644
index c69dc50..0000000
--- a/cyrus-deliver-wrapper.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Wrapper for cyrus 'deliver' to allow anyone to run it -
- * I hope this is secure! Should be setgid mail.
- */
-
-#include
-#include
-#include
-#include
-#include
-
-#ifndef LIBEXECDIR
-#define LIBEXECDIR "/usr/lib/cyrus-imapd"
-#endif
-
-int main(int argc, char *argv[])
-{
- char *const envp[] = { NULL };
- struct passwd *ent = getpwuid(getuid());
- const char *uname = (ent && ent->pw_name && ent->pw_name[0])
- ? ent->pw_name : "anonymous";
-
- if (argc != 2) {
- fprintf(stderr, "Usage: %s mailbox\n", argv[0]);
- return EX_USAGE;
- }
-
- execle(LIBEXECDIR"/deliver", "deliver", "-e",
- "-a", uname, "-m", argv[1],
- NULL, envp);
-
- perror("exec "LIBEXECDIR"/deliver");
- return EX_OSERR;
-}
diff --git a/cyrus-imapd-2.1.16-getrlimit.patch b/cyrus-imapd-2.1.16-getrlimit.patch
deleted file mode 100644
index 08b7c3c..0000000
--- a/cyrus-imapd-2.1.16-getrlimit.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- cyrus-imapd-2.1.16/master/master.c.getrlimit 2003-12-28 17:32:46.000000000 +0100
-+++ cyrus-imapd-2.1.16/master/master.c 2003-12-28 17:43:56.000000000 +0100
-@@ -1208,12 +1208,10 @@
- rl.rlim_cur = x;
- rl.rlim_max = x;
- if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
-- syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
-
- #ifdef HAVE_GETRLIMIT
-
- if (!getrlimit(RLIMIT_NUMFDS, &rl)) {
-- syslog(LOG_ERR, "retrying with %ld (current max)", rl.rlim_max);
- rl.rlim_cur = rl.rlim_max;
- if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
- syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
-@@ -1228,6 +1226,7 @@
- rl.rlim_max);
- }
- #else
-+ syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
- }
- #endif /* HAVE_GETRLIMIT */
- }
diff --git a/cyrus-imapd-2.2.12-no_transfig.patch b/cyrus-imapd-2.2.12-no_transfig.patch
deleted file mode 100644
index dd78906..0000000
--- a/cyrus-imapd-2.2.12-no_transfig.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -Naur cyrus-imapd-2.2.12.orig/doc/Makefile.dist cyrus-imapd-2.2.12/doc/Makefile.dist
---- cyrus-imapd-2.2.12.orig/doc/Makefile.dist Wed Oct 22 20:50:04 2003
-+++ cyrus-imapd-2.2.12/doc/Makefile.dist Wed Nov 9 13:23:58 2005
-@@ -13,7 +13,7 @@
-
- rm -f groff-html-*.png pod2htm*
-
-- fig2dev -L png murder.fig murder.png
-- fig2dev -L png netnews.fig netnews.png
-+# fig2dev -L png murder.fig murder.png
-+# fig2dev -L png netnews.fig netnews.png
-
- (cd text; make)
diff --git a/cyrus-imapd-2.3.12p2-autocreate-0.10-0.diff b/cyrus-imapd-2.3.16-autocreate-0.10-0.diff
similarity index 92%
rename from cyrus-imapd-2.3.12p2-autocreate-0.10-0.diff
rename to cyrus-imapd-2.3.16-autocreate-0.10-0.diff
index 8aa1f0b..d28f424 100644
--- a/cyrus-imapd-2.3.12p2-autocreate-0.10-0.diff
+++ b/cyrus-imapd-2.3.16-autocreate-0.10-0.diff
@@ -1,6 +1,498 @@
-diff -up /dev/null cyrus-imapd-2.3.15/imap/autosieve.c
---- /dev/null 2009-09-11 15:21:01.808252010 +0200
-+++ cyrus-imapd-2.3.15/imap/autosieve.c 2009-09-18 11:11:39.778115814 +0200
+diff -Naur cyrus-imapd-2.3.16/README.autocreate cyrus-imapd-2.3.16-autocreate.uncompiled/README.autocreate
+--- cyrus-imapd-2.3.16/README.autocreate 1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/README.autocreate 2009-12-22 19:56:22.000000000 +0200
+@@ -0,0 +1,211 @@
++Cyrus IMAP autocreate Inbox patch
++----------------------------------
++
++NOTE : This patch has been created at the University of Athens. For more info, as well
++as more patches on Cyrus IMAPD server, please visit http://email.uoa.gr/
++
++The design of Cyrus IMAP server does not predict the automatic creation of users'
++INBOX folders. The creation of a user's INBOX is considered to be an external task,
++that has to be completed as part of the user email account creation procedure.
++Hence, to create a new email account the site administrator has to:
++
++ a) Include the new account in the user database for the authentication procedure
++ (e.g. sasldb, shadow, mysql, ldap).
++ b) Create the corresponding INBOX folder.
++
++Alternatively, the user, if succesfully authenticated, may create his own INBOX folder,
++as long as the configuration of the site allows it (see "autocreatequota" in imapd.conf).
++Unlike what not careful readers may think, enabling the "autocreatequota" option, doesn't
++lead to the automatic INBOX folder creation by Cyrus IMAP server.
++In fact, "autocreate" means that the IMAP clients are allowed to automatically create
++the user INBOX.
++
++This patch adds the functionality of automatic creation of the users' INBOX folders into
++the Cyrus IMAP server. It is implemented as two features, namely the "create on login"
++and "create on post".
++
++
++
++Create on login
++===============
++This feauture provides automatic creation of a user's INBOX folder when all of the
++following requirements are met:
++
++i) The user has succesfully passed the authentication procedure.
++
++ii) The user's authorisation ID (typically the same as the user's
++authentication ID) doesn't belong to the imap_admins or admins
++accounts (see imapd.conf).
++
++iii) The "autocreatequota" option in the imap configuration file
++has been set to a non zero value.
++
++iv) The corresponding to the user's authorisation ID INBOX folder
++does not exist.
++
++The user's first login is the most typical case when all four requirements are met.
++Note that if the authenticated ID is allowed to proxy to another account for which
++all of the above requirements are met, the corresponding INBOX folder for that account
++will be created.
++
++
++
++Create on post
++==============
++This feauture provides automatic creation of a user's INBOX folder when all of the
++following requirements are met.
++
++i) An email message addressed to the user has been received.
++
++ii) The recipient is not any of the imap_admins or admins accounts.
++Note that passing emails to admins or imap_admins accounts from
++the MTA to LMTP should be avoided in any case.
++
++iii) The recipient's INBOX does not exist.
++
++iv) The "autocreatequota" option in the imap configuration file
++has been set to a non zero value.
++
++v) The "createonpost" option in the imap configuration file
++has been switched on.
++
++
++Besides the automatic creation of INBOX folder, additional functionalities are
++provided:
++
++ (A) Automatic creation of INBOX subfolders controlled by "autocreateinboxfolders"
++configuration option. eg
++
++autocreateinboxfolders: sent|drafts|spam|templates
++
++ (B) Automatic subscription of INBOX subfolders controlled by "autosubscribeinboxfolders"
++configuration option. eg
++
++autosubscribeinboxfolders: sent|spam
++
++Obviously, only subscription to subfolders included in the "autocreateinboxfolder"
++list is meaningful.
++
++ (C) Automatic subscription to shared folders (bulletin boards). The user gets
++automatically subscribed to the shared folders declared in the "autosubscribesharedfolders"
++configuration option in imapd.conf.
++eg autosubscribesharedfolders: public_folder | public_folder.subfolder
++
++In order the above action to succeed, the shared folder has to pre-exist the INBOX creation
++and the user must have the appropriate permissions in order to be able to subscribe to the
++shared folder.
++
++* A new config option has been added. 'autosubscribe_all_sharedfolders' is a yes/no
++option. When set to yes, the user is automatically subscribed to all shared folders one
++has permission to subscribe to. Please, note that when this option is set to yes, then
++'autosubscribesharedfolders' option is overriden.
++
++ (D) Automatic creation of a predefined default sieve script.
++
++This is very useful when a default sieve script is used for every user. Usually, a
++default anti-spam script may me be written in a file and copied to each user
++sieve scripts upon the INBOX creation. The imapd.conf options that have been added
++are 'autocreate_sieve_script', 'autocreate_sieve_compiledscript' and
++'generate_compiled_sieve_script'.
++
++autocreate_sieve_script configuration option refers to the full path of the file
++that contains the sieve script. The default value is null and if no file is defined,
++then no default script is created upon INBOX creation. (The feature is disabled)
++eg autocreate_sieve_script: /etc/default_sieve_script
++
++autocreate_sieve_compiledscript configuration option refers to the full path of the
++file that contains the bytecode compiled sieve script. If this filename is defined
++in imapd.conf and the file exists, then it is automatically copied in the user's sieve
++directory. If it is not defined, then a bytecode sieve script gets on the fly compiled
++by the daemon.
++eg autocreate_sieve_compiledscript: /etc/default_sieve_script.bc
++
++generate_compiled_sieve_script is a boolean option that triggers the compilation of the
++source sieve script to bytecode sieve script. The file that the bytecode script will
++be saved is pointed by autocreate_sieve_compiledscript.
++
++Ways of compiling a sieve script :
++1. Compile a sieve script using the standard sievec utility, distributed by CMU
++2. Compile a sieve script using the compile_sieve utility, released by UoA. This
++ tool is almost identical to the sievec utility, with the difference that it
++ reads the input and output file from autocreate_sieve_script and
++ autocreate_sieve_compiledscript options in imapd.conf
++3. Let cyrus create a compiled sieve script using a source script. Cyrus can be
++ instructed to save the compiled script any time a compiled script does not exist.
++
++NOTES :
++1. In order this functionality to work, the following requirements must have been met:
++ - 'sieveusehomedir' option must be 'no' in the configuration (default).
++ - 'sievedir' option must have a valid value.
++2. Currently, this patch checks the validity of the source script while generating a
++ bytecode compiled script, but not the validity of the bytecode sieve script file.
++ The administrator should make sure that the provided files contain a valid sieve
++ script as well as the compiled script is updated every time the source script changes.
++
++
++ (E) The administrator may control for which users and/or groups may the INBOXes
++automatically be created. The autocreate_users option restricts the groups
++for which the patch will create the mailboxes.
++
++The default value of autocreate_users is anyone. So, if not set at all, the patch will
++work for all users. However, one may set:
++
++autocreate_users: user1 user2 group:group1 group:group2
++
++In that case, the INBOX will be created only for user1, user2 and the users that belong
++to group1 and group2.
++
++More refined control per service is provided by the options imap_autocreate_users,
++pop3_autocreate_users and lmtp_autocreate_users. These options override the
++autocreate_users option and offer per service control.
++
++Example:
++One may want to restrict the create on post functionality only for a specific group
++of users. To achieve this, the following lines must be added in the imapd.conf file:
++
++createonpost: yes
++lmtp_autocreate_users: group:groupname
++
++
++
++Issues to be considered
++=======================
++
++I) In order to use the create on post feauture one should be absolutely sure that:
++a) The MTA checks the validity of the email recipient before sending the email to
++LMTP. This is an RFC821 requirement. This usually expands to "the mta should be
++able to use the account database as user mailbox database".
++b) Only authorised accounts/services can talk to LMTP.
++
++II) Especially in the case of imap logins, the current patch implementation checks
++for the INBOX folder existence upon login, causing an extra mailbox lookup in most
++of the cases.
++A better approach would be to chase the "IMAP_MAILBOX_NONEXISTENT" error code and
++check if the error is associated with an INBOX folder. However, this would mess up
++Cyrus code. The way it was implemented may not have been the most performance
++optimised, but it produces a much cleaner and simple patch.
++
++
++
++Virtual Domains Support
++=======================
++
++Virtual domains are supported by all versions of the patch for cyrus-imapd-2.2.1-BETA and
++later. However, it is not possible to declare different INBOX subfolders to be created or
++shared folders to be subscribed to for every domain.
++
++
++
++Things to be done
++=================
++
++1. Support MUPDATE
++
++It is within the developers' intentions to support the mupdate protocol, but serious
++design issues on future cyrus releases have to resolved first.
++
++2. Select different attributes (quota, partition, sieve filter, etc) depending on the group
++a user belongs to.
++
++For more information and updates please visit http://email.uoa.gr/projects/cyrus/autocreate
++
+diff -Naur cyrus-imapd-2.3.16/imap/Makefile.in cyrus-imapd-2.3.16-autocreate.uncompiled/imap/Makefile.in
+--- cyrus-imapd-2.3.16/imap/Makefile.in 2009-03-30 19:04:56.000000000 +0300
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/Makefile.in 2009-12-23 00:49:25.000000000 +0200
+@@ -101,7 +101,7 @@
+ convert_code.o duplicate.o saslclient.o saslserver.o signals.o \
+ annotate.o search_engines.o squat.o squat_internal.o mbdump.o \
+ imapparse.o telemetry.o user.o notify.o idle.o quota_db.o \
+- sync_log.o $(SEEN) mboxkey.o backend.o tls.o message_guid.o \
++ sync_log.o autosieve.o $(SEEN) mboxkey.o backend.o tls.o message_guid.o \
+ statuscache_db.o
+
+ IMAPDOBJS=pushstats.o imapd.o proxy.o imap_proxy.o index.o version.o
+@@ -118,7 +118,7 @@
+ fud smmapd reconstruct quota mbpath ipurge cyr_dbtool cyr_synclog \
+ cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
+ ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
+- unexpunge cyr_df @IMAP_PROGS@
++ unexpunge compile_sieve cyr_df @IMAP_PROGS@
+
+ BUILTSOURCES = imap_err.c imap_err.h pushstats.c pushstats.h \
+ lmtpstats.c lmtpstats.h xversion.h mupdate_err.c mupdate_err.h \
+@@ -183,9 +183,9 @@
+ mupdate_err.h: mupdate_err.c
+
+ ### Services
+-idled: idled.o mutex_fake.o libimap.a $(DEPLIBS)
++idled: idled.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o idled \
+- idled.o mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
++ idled.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+ lmtpd: lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) mutex_fake.o \
+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+@@ -199,166 +199,171 @@
+ $(SERVICE) lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) \
+ mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+-imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
++imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o imapd \
+ $(SERVICE) $(IMAPDOBJS) mutex_fake.o \
+- libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+-imapd.pure: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
++imapd.pure: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o imapd.pure \
+ $(SERVICE) $(IMAPDOBJS) mutex_fake.o libimap.a \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+-imapd.quant: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
++imapd.quant: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(QUANTIFY) $(QUANTOPT) $(CC) $(LDFLAGS) -o imapd.quant \
+ $(SERVICE) $(IMAPDOBJS) mutex_fake.o libimap.a \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+ mupdate: mupdate.o mupdate-slave.o mupdate-client.o mutex_pthread.o tls.o \
+- libimap.a $(DEPLIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o mupdate \
+ $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
+ mutex_pthread.o tls.o libimap.a \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
+
+ mupdate.pure: mupdate.o mupdate-slave.o mupdate-client.o mutex_pthread.o \
+- libimap.a $(DEPLIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o mupdate.pure \
+ $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
+- mutex_pthread.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
++ mutex_pthread.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
+
+ pop3d: pop3d.o proxy.o backend.o tls.o mutex_fake.o libimap.a \
+- $(DEPLIBS) $(SERVICE)
++ $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o pop3d pop3d.o proxy.o backend.o tls.o $(SERVICE) \
+- mutex_fake.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+ nntpd: nntpd.o proxy.o backend.o index.o smtpclient.o spool.o tls.o \
+- mutex_fake.o nntp_err.o libimap.a $(DEPLIBS) $(SERVICE)
++ mutex_fake.o nntp_err.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o nntpd nntpd.o proxy.o backend.o index.o spool.o \
+ smtpclient.o tls.o $(SERVICE) mutex_fake.o nntp_err.o \
+- libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+-fud: fud.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
++fud: fud.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o fud $(SERVICE) fud.o mutex_fake.o libimap.a \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+-smmapd: smmapd.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
++smmapd: smmapd.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o smmapd $(SERVICE) smmapd.o mutex_fake.o libimap.a \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+ sync_server: sync_server.o sync_support.o sync_commit.o \
+- imapparse.o tls.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
++ imapparse.o tls.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+ $(CC) $(LDFLAGS) -o \
+ sync_server sync_server.o sync_support.o sync_commit.o \
+ imapparse.o tls.o $(SERVICE) libimap.a mutex_fake.o \
+- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+
+ ### Command Line Utilities
+-arbitron: arbitron.o $(CLIOBJS) libimap.a $(DEPLIBS)
++arbitron: arbitron.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o arbitron arbitron.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cyr_dbtool: cyr_dbtool.o mutex_fake.o libimap.a $(DEPLIBS)
++cyr_dbtool: cyr_dbtool.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o cyr_dbtool cyr_dbtool.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cyr_synclog: cyr_synclog.o mutex_fake.o libimap.a $(DEPLIBS)
++cyr_synclog: cyr_synclog.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o cyr_synclog cyr_synclog.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(DEPLIBS)
++cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o cvt_cyrusdb cvt_cyrusdb.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(DEPLIBS)
++chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o chk_cyrus chk_cyrus.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-deliver: deliver.o $(LMTPOBJS) proxy.o mutex_fake.o libimap.a $(DEPLIBS)
++deliver: deliver.o $(LMTPOBJS) proxy.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o deliver deliver.o $(LMTPOBJS) proxy.o \
+- mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
++ mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- $@ ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ $@ ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o $@ ctl_mboxlist.o mupdate-client.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o $@ cyr_expire.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS)
++fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- $@ fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ $@ fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(DEPLIBS)
++squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o squatter squatter.o index.o squat_build.o \
+- $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-mbpath: mbpath.o $(CLIOBJS) libimap.a $(DEPLIBS)
++mbpath: mbpath.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o mbpath mbpath.o $(CLIOBJS) libimap.a \
+- $(DEPLIBS) $(LIBS)
++ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-ipurge: ipurge.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ipurge: ipurge.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o ipurge ipurge.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cyr_virusscan: cyr_virusscan.o index.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyr_virusscan: cyr_virusscan.o index.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o cyr_virusscan cyr_virusscan.o index.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS) -lclamav
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) -lclamav
+
+-cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o cyrdump cyrdump.o index.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-cyr_df: cyr_df.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyr_df: cyr_df.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- cyr_df cyr_df.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ cyr_df cyr_df.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS)
++mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- mbexamine mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ mbexamine mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS)
++reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- reconstruct reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ reconstruct reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-quota: quota.o $(CLIOBJS) libimap.a $(DEPLIBS)
++quota: quota.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o quota quota.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS)
++tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+- $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++ $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-unexpunge: unexpunge.o $(CLIOBJS) libimap.a $(DEPLIBS)
++unexpunge: unexpunge.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o $@ unexpunge.o $(CLIOBJS) \
+- libimap.a $(DEPLIBS) $(LIBS)
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-make_md5: make_md5.o libimap.a mutex_fake.o $(DEPLIBS)
+- $(CC) $(LDFLAGS) -o make_md5 make_md5.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
++make_md5: make_md5.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
++ $(CC) $(LDFLAGS) -o make_md5 make_md5.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+-make_sha1: make_sha1.o libimap.a mutex_fake.o $(DEPLIBS)
+- $(CC) $(LDFLAGS) -o make_sha1 make_sha1.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
++make_sha1: make_sha1.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
++ $(CC) $(LDFLAGS) -o make_sha1 make_sha1.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+ sync_client: sync_client.o sync_support.o \
+- backend.o tls.o imapparse.o libimap.a mutex_fake.o $(DEPLIBS)
++ backend.o tls.o imapparse.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+ sync_client sync_client.o sync_support.o \
+- backend.o tls.o imapparse.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
++ backend.o tls.o imapparse.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+
+ sync_reset: sync_reset.o sync_support.o sync_commit.o \
+- libimap.a mutex_fake.o $(DEPLIBS)
++ libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
+ $(CC) $(LDFLAGS) -o \
+ sync_reset sync_reset.o sync_support.o sync_commit.o \
+- libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
++ libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
++
++compile_sieve: compile_sieve.o libimap.a $(DEPLIBS) $(SIEVE_LIBS)
++ $(CC) $(LDFLAGS) -o compile_sieve compile_sieve.o $(CLIOBJS) \
++ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
++
+
+ ### Other Misc Targets
+
+diff -Naur cyrus-imapd-2.3.16/imap/autosieve.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/autosieve.c
+--- cyrus-imapd-2.3.16/imap/autosieve.c 1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/autosieve.c 2009-12-22 19:56:22.000000000 +0200
@@ -0,0 +1,590 @@
+#include
+#include
@@ -592,9 +1084,9 @@ diff -up /dev/null cyrus-imapd-2.3.15/imap/autosieve.c
+ * Pavlos. Author of cyrusmaster. So consider this patch as his birthday present
+ */
+
-diff -up /dev/null cyrus-imapd-2.3.15/imap/compile_sieve.c
---- /dev/null 2009-09-11 15:21:01.808252010 +0200
-+++ cyrus-imapd-2.3.15/imap/compile_sieve.c 2009-09-18 11:11:39.779115788 +0200
+diff -Naur cyrus-imapd-2.3.16/imap/compile_sieve.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/compile_sieve.c
+--- cyrus-imapd-2.3.16/imap/compile_sieve.c 1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/compile_sieve.c 2009-12-22 19:56:22.000000000 +0200
@@ -0,0 +1,365 @@
+/* This tool compiles the sieve script from a command
+line so that it can be used wby the autoadd patch */
@@ -961,10 +1453,10 @@ diff -up /dev/null cyrus-imapd-2.3.15/imap/compile_sieve.c
+
+
+
-diff -up cyrus-imapd-2.3.15/imap/imapd.c.autocreate cyrus-imapd-2.3.15/imap/imapd.c
---- cyrus-imapd-2.3.15/imap/imapd.c.autocreate 2009-07-29 17:51:21.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/imapd.c 2009-09-18 11:11:39.783115781 +0200
-@@ -211,6 +211,7 @@ static const int max_monthdays[] = {
+diff -Naur cyrus-imapd-2.3.16/imap/imapd.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/imapd.c
+--- cyrus-imapd-2.3.16/imap/imapd.c 2009-12-16 04:51:39.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/imapd.c 2009-12-22 19:56:22.000000000 +0200
+@@ -214,6 +214,7 @@
void motd_file(int fd);
void shut_down(int code);
void fatal(const char *s, int code);
@@ -972,7 +1464,7 @@ diff -up cyrus-imapd-2.3.15/imap/imapd.c.autocreate cyrus-imapd-2.3.15/imap/imap
void cmdloop(void);
void cmd_login(char *tag, char *user);
-@@ -2003,6 +2004,43 @@ void cmdloop()
+@@ -2011,6 +2012,43 @@
}
/*
@@ -1016,7 +1508,7 @@ diff -up cyrus-imapd-2.3.15/imap/imapd.c.autocreate cyrus-imapd-2.3.15/imap/imap
* Perform a LOGIN command
*/
void cmd_login(char *tag, char *user)
-@@ -2179,6 +2217,9 @@ void cmd_login(char *tag, char *user)
+@@ -2187,6 +2225,9 @@
strcspn(imapd_userid, "@") : 0);
freebuf(&passwdbuf);
@@ -1026,7 +1518,7 @@ diff -up cyrus-imapd-2.3.15/imap/imapd.c.autocreate cyrus-imapd-2.3.15/imap/imap
return;
}
-@@ -2336,6 +2377,8 @@ cmd_authenticate(char *tag, char *authty
+@@ -2344,6 +2385,8 @@
config_virtdomains ?
strcspn(imapd_userid, "@") : 0);
@@ -1035,10 +1527,10 @@ diff -up cyrus-imapd-2.3.15/imap/imapd.c.autocreate cyrus-imapd-2.3.15/imap/imap
return;
}
-diff -up cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate cyrus-imapd-2.3.15/imap/lmtpd.c
---- cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate 2009-04-23 19:10:06.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/lmtpd.c 2009-09-18 11:11:39.780115773 +0200
-@@ -117,6 +117,8 @@ void shut_down(int code);
+diff -Naur cyrus-imapd-2.3.16/imap/lmtpd.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/lmtpd.c
+--- cyrus-imapd-2.3.16/imap/lmtpd.c 2009-12-16 04:51:41.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/lmtpd.c 2009-12-22 19:56:22.000000000 +0200
+@@ -117,6 +117,8 @@
static FILE *spoolfile(message_data_t *msgdata);
static void removespool(message_data_t *msgdata);
@@ -1047,7 +1539,7 @@ diff -up cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate cyrus-imapd-2.3.15/imap/lmtp
/* current namespace */
static struct namespace lmtpd_namespace;
-@@ -977,6 +979,86 @@ void shut_down(int code)
+@@ -979,6 +981,86 @@
exit(code);
}
@@ -1134,7 +1626,7 @@ diff -up cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate cyrus-imapd-2.3.15/imap/lmtp
static int verify_user(const char *user, const char *domain, char *mailbox,
quota_t quotacheck, struct auth_state *authstate)
{
-@@ -1020,6 +1102,15 @@ static int verify_user(const char *user,
+@@ -1022,6 +1104,15 @@
*/
r = mlookup(namebuf, &server, &acl, NULL);
@@ -1150,7 +1642,7 @@ diff -up cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate cyrus-imapd-2.3.15/imap/lmtp
if (r == IMAP_MAILBOX_NONEXISTENT && !user &&
config_getswitch(IMAPOPT_LMTP_FUZZY_MAILBOX_MATCH) &&
/* see if we have a mailbox whose name is close */
-@@ -1046,6 +1137,7 @@ static int verify_user(const char *user,
+@@ -1048,6 +1139,7 @@
aclcheck, (quotacheck < 0)
|| config_getswitch(IMAPOPT_LMTP_STRICT_QUOTA) ?
quotacheck : 0);
@@ -1158,285 +1650,9 @@ diff -up cyrus-imapd-2.3.15/imap/lmtpd.c.autocreate cyrus-imapd-2.3.15/imap/lmtp
}
}
-diff -up cyrus-imapd-2.3.15/imap/Makefile.in.autocreate cyrus-imapd-2.3.15/imap/Makefile.in
---- cyrus-imapd-2.3.15/imap/Makefile.in.autocreate 2009-03-30 18:04:56.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/Makefile.in 2009-09-18 11:44:04.105116069 +0200
-@@ -101,7 +101,7 @@ LOBJS= append.o mailbox.o mboxlist.o mup
- convert_code.o duplicate.o saslclient.o saslserver.o signals.o \
- annotate.o search_engines.o squat.o squat_internal.o mbdump.o \
- imapparse.o telemetry.o user.o notify.o idle.o quota_db.o \
-- sync_log.o $(SEEN) mboxkey.o backend.o tls.o message_guid.o \
-+ sync_log.o autosieve.o $(SEEN) mboxkey.o backend.o tls.o message_guid.o \
- statuscache_db.o
-
- IMAPDOBJS=pushstats.o imapd.o proxy.o imap_proxy.o index.o version.o
-@@ -118,7 +118,7 @@ PROGS = imapd lmtpd pop3d \
- fud smmapd reconstruct quota mbpath ipurge cyr_dbtool cyr_synclog \
- cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
- ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
-- unexpunge cyr_df @IMAP_PROGS@
-+ unexpunge cyr_df compile_sieve @IMAP_PROGS@
-
- BUILTSOURCES = imap_err.c imap_err.h pushstats.c pushstats.h \
- lmtpstats.c lmtpstats.h xversion.h mupdate_err.c mupdate_err.h \
-@@ -183,9 +183,9 @@ mupdate_err.c: mupdate_err.et
- mupdate_err.h: mupdate_err.c
-
- ### Services
--idled: idled.o mutex_fake.o libimap.a $(DEPLIBS)
-+idled: idled.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o idled \
-- idled.o mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
-+ idled.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
- lmtpd: lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) mutex_fake.o \
- libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
-@@ -199,167 +199,170 @@ lmtpd.pure: lmtpd.o proxy.o $(LMTPOBJS)
- $(SERVICE) lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) \
- mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
--imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
-+imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o imapd \
- $(SERVICE) $(IMAPDOBJS) mutex_fake.o \
-- libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
--imapd.pure: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
-+imapd.pure: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o imapd.pure \
- $(SERVICE) $(IMAPDOBJS) mutex_fake.o libimap.a \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
--imapd.quant: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
-+imapd.quant: $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(QUANTIFY) $(QUANTOPT) $(CC) $(LDFLAGS) -o imapd.quant \
- $(SERVICE) $(IMAPDOBJS) mutex_fake.o libimap.a \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
- mupdate: mupdate.o mupdate-slave.o mupdate-client.o mutex_pthread.o tls.o \
-- libimap.a $(DEPLIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o mupdate \
- $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
- mutex_pthread.o tls.o libimap.a \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
-
- mupdate.pure: mupdate.o mupdate-slave.o mupdate-client.o mutex_pthread.o \
-- libimap.a $(DEPLIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o mupdate.pure \
- $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
-- mutex_pthread.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
-+ mutex_pthread.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
-
- pop3d: pop3d.o proxy.o backend.o tls.o mutex_fake.o libimap.a \
-- $(DEPLIBS) $(SERVICE)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o pop3d pop3d.o proxy.o backend.o tls.o $(SERVICE) \
-- mutex_fake.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
- nntpd: nntpd.o proxy.o backend.o index.o smtpclient.o spool.o tls.o \
-- mutex_fake.o nntp_err.o libimap.a $(DEPLIBS) $(SERVICE)
-+ mutex_fake.o nntp_err.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o nntpd nntpd.o proxy.o backend.o index.o spool.o \
- smtpclient.o tls.o $(SERVICE) mutex_fake.o nntp_err.o \
-- libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
--fud: fud.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
-+fud: fud.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o fud $(SERVICE) fud.o mutex_fake.o libimap.a \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
--smmapd: smmapd.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
-+smmapd: smmapd.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o smmapd $(SERVICE) smmapd.o mutex_fake.o libimap.a \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
- sync_server: sync_server.o sync_support.o sync_commit.o \
-- imapparse.o tls.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
-+ imapparse.o tls.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
- $(CC) $(LDFLAGS) -o \
- sync_server sync_server.o sync_support.o sync_commit.o \
- imapparse.o tls.o $(SERVICE) libimap.a mutex_fake.o \
-- $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
-
- ### Command Line Utilities
--arbitron: arbitron.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+arbitron: arbitron.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o arbitron arbitron.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cyr_dbtool: cyr_dbtool.o mutex_fake.o libimap.a $(DEPLIBS)
-+cyr_dbtool: cyr_dbtool.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o cyr_dbtool cyr_dbtool.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cyr_synclog: cyr_synclog.o mutex_fake.o libimap.a $(DEPLIBS)
-+cyr_synclog: cyr_synclog.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o cyr_synclog cyr_synclog.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(DEPLIBS)
-+cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o cvt_cyrusdb cvt_cyrusdb.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(DEPLIBS)
-+chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o chk_cyrus chk_cyrus.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--deliver: deliver.o $(LMTPOBJS) proxy.o mutex_fake.o libimap.a $(DEPLIBS)
-+deliver: deliver.o $(LMTPOBJS) proxy.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o deliver deliver.o $(LMTPOBJS) proxy.o \
-- mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
-+ mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- $@ ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ $@ ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o $@ ctl_mboxlist.o mupdate-client.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o $@ cyr_expire.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- $@ fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ $@ fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o squatter squatter.o index.o squat_build.o \
-- $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--mbpath: mbpath.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+mbpath: mbpath.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o mbpath mbpath.o $(CLIOBJS) libimap.a \
-- $(DEPLIBS) $(LIBS)
-+ $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--ipurge: ipurge.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+ipurge: ipurge.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o ipurge ipurge.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cyr_virusscan: cyr_virusscan.o index.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+cyr_virusscan: cyr_virusscan.o index.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o cyr_virusscan cyr_virusscan.o index.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS) -lclamav
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) -lclamav
-
--cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o cyrdump cyrdump.o index.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--cyr_df: cyr_df.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+cyr_df: cyr_df.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- cyr_df cyr_df.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ cyr_df cyr_df.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- mbexamine mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ mbexamine mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- reconstruct reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ reconstruct reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--quota: quota.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+quota: quota.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o quota quota.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
-- $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
-+ $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--unexpunge: unexpunge.o $(CLIOBJS) libimap.a $(DEPLIBS)
-+unexpunge: unexpunge.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o $@ unexpunge.o $(CLIOBJS) \
-- libimap.a $(DEPLIBS) $(LIBS)
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--make_md5: make_md5.o libimap.a mutex_fake.o $(DEPLIBS)
-- $(CC) $(LDFLAGS) -o make_md5 make_md5.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
-+make_md5: make_md5.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
-+ $(CC) $(LDFLAGS) -o make_md5 make_md5.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
--make_sha1: make_sha1.o libimap.a mutex_fake.o $(DEPLIBS)
-- $(CC) $(LDFLAGS) -o make_sha1 make_sha1.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
-+make_sha1: make_sha1.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
-+ $(CC) $(LDFLAGS) -o make_sha1 make_sha1.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
- sync_client: sync_client.o sync_support.o \
-- backend.o tls.o imapparse.o libimap.a mutex_fake.o $(DEPLIBS)
-+ backend.o tls.o imapparse.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
- sync_client sync_client.o sync_support.o \
-- backend.o tls.o imapparse.o libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
-+ backend.o tls.o imapparse.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
- sync_reset: sync_reset.o sync_support.o sync_commit.o \
-- libimap.a mutex_fake.o $(DEPLIBS)
-+ libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS)
- $(CC) $(LDFLAGS) -o \
- sync_reset sync_reset.o sync_support.o sync_commit.o \
-- libimap.a mutex_fake.o $(DEPLIBS) $(LIBS)
-+ libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
-
-+compile_sieve: compile_sieve.o libimap.a $(DEPLIBS) $(SIEVE_LIBS)
-+ $(CC) $(LDFLAGS) -o compile_sieve compile_sieve.o $(CLIOBJS) \
-+ libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
- ### Other Misc Targets
-
- clean:
-diff -up cyrus-imapd-2.3.15/imap/mboxlist.c.autocreate cyrus-imapd-2.3.15/imap/mboxlist.c
---- cyrus-imapd-2.3.15/imap/mboxlist.c.autocreate 2009-07-28 04:46:23.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/mboxlist.c 2009-09-18 11:11:39.777115766 +0200
+diff -Naur cyrus-imapd-2.3.16/imap/mboxlist.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/mboxlist.c
+--- cyrus-imapd-2.3.16/imap/mboxlist.c 2009-11-17 05:34:30.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/mboxlist.c 2009-12-22 19:56:22.000000000 +0200
@@ -83,6 +83,12 @@
#include "quota.h"
#include "sync_log.h"
@@ -1450,7 +1666,7 @@ diff -up cyrus-imapd-2.3.15/imap/mboxlist.c.autocreate cyrus-imapd-2.3.15/imap/m
#define DB config_mboxlist_db
#define SUBDB config_subscription_db
-@@ -100,11 +106,29 @@ static int mboxlist_rmquota(const char *
+@@ -100,11 +106,29 @@
static int mboxlist_changequota(const char *name, int matchlen, int maycreate,
void *rock);
@@ -1480,7 +1696,7 @@ diff -up cyrus-imapd-2.3.15/imap/mboxlist.c.autocreate cyrus-imapd-2.3.15/imap/m
#define FNAME_SUBSSUFFIX ".sub"
/*
-@@ -3446,3 +3470,349 @@ int mboxlist_delayed_delete_isenabled(vo
+@@ -3464,3 +3488,349 @@
return(count);
}
@@ -1830,22 +2046,23 @@ diff -up cyrus-imapd-2.3.15/imap/mboxlist.c.autocreate cyrus-imapd-2.3.15/imap/m
+ return r;
+}
+
-diff -up cyrus-imapd-2.3.15/imap/mboxlist.h.autocreate cyrus-imapd-2.3.15/imap/mboxlist.h
---- cyrus-imapd-2.3.15/imap/mboxlist.h.autocreate 2009-05-05 03:20:03.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/mboxlist.h 2009-09-18 11:11:39.778115814 +0200
-@@ -221,4 +221,8 @@ int mboxlist_commit(struct txn *tid);
+diff -Naur cyrus-imapd-2.3.16/imap/mboxlist.h cyrus-imapd-2.3.16-autocreate.uncompiled/imap/mboxlist.h
+--- cyrus-imapd-2.3.16/imap/mboxlist.h 2009-11-17 05:34:17.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/mboxlist.h 2009-12-22 19:57:35.000000000 +0200
+@@ -221,4 +221,9 @@
int mboxlist_count_inferiors(char *mailboxname, int isadmin, char *userid,
struct auth_state *authstate);
+int mboxlist_autocreateinbox(struct namespace *namespace,char *userid,
-+ struct auth_state *auth_state, char *mailboxname,
-+ int autocreatequota);
++ struct auth_state *auth_state, char *mailboxname,
++ int autocreatequota);
++
+
#endif
-diff -up cyrus-imapd-2.3.15/imap/pop3d.c.autocreate cyrus-imapd-2.3.15/imap/pop3d.c
---- cyrus-imapd-2.3.15/imap/pop3d.c.autocreate 2009-04-23 19:10:07.000000000 +0200
-+++ cyrus-imapd-2.3.15/imap/pop3d.c 2009-09-18 11:11:39.784115791 +0200
-@@ -173,6 +173,8 @@ static void bitpipe(void);
+diff -Naur cyrus-imapd-2.3.16/imap/pop3d.c cyrus-imapd-2.3.16-autocreate.uncompiled/imap/pop3d.c
+--- cyrus-imapd-2.3.16/imap/pop3d.c 2009-12-17 17:32:32.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/imap/pop3d.c 2009-12-22 19:56:22.000000000 +0200
+@@ -177,6 +177,8 @@
static char popd_apop_chal[45 + MAXHOSTNAMELEN + 1]; /* */
static void cmd_apop(char *response);
@@ -1854,7 +2071,7 @@ diff -up cyrus-imapd-2.3.15/imap/pop3d.c.autocreate cyrus-imapd-2.3.15/imap/pop3
static void cmd_auth(char *arg);
static void cmd_capa(void);
static void cmd_pass(char *pass);
-@@ -1246,6 +1248,7 @@ void cmd_user(char *user)
+@@ -1294,6 +1296,7 @@
popd_userid = xstrdup(userbuf);
prot_printf(popd_out, "+OK Name is a valid mailbox\r\n");
}
@@ -1862,7 +2079,7 @@ diff -up cyrus-imapd-2.3.15/imap/pop3d.c.autocreate cyrus-imapd-2.3.15/imap/pop3
}
void cmd_pass(char *pass)
-@@ -1549,6 +1552,43 @@ void cmd_auth(char *arg)
+@@ -1597,6 +1600,43 @@
}
/*
@@ -1906,7 +2123,7 @@ diff -up cyrus-imapd-2.3.15/imap/pop3d.c.autocreate cyrus-imapd-2.3.15/imap/pop3
* Complete the login process by opening and locking the user's inbox
*/
int openinbox(void)
-@@ -1577,6 +1617,12 @@ int openinbox(void)
+@@ -1626,6 +1666,12 @@
if (!r) r = mboxlist_detail(inboxname, &type, NULL, NULL,
&server, &acl, NULL);
@@ -1919,224 +2136,10 @@ diff -up cyrus-imapd-2.3.15/imap/pop3d.c.autocreate cyrus-imapd-2.3.15/imap/pop3
if (!r && (config_popuseacl = config_getswitch(IMAPOPT_POPUSEACL)) &&
(!acl ||
!((myrights = cyrus_acl_myrights(popd_authstate, acl)) & ACL_READ))) {
---- cyrus-imapd-2.3.13/README.autocreate.autocreate 2009-01-13 11:14:09.000000000 +0100
-+++ cyrus-imapd-2.3.13/README.autocreate 2009-01-13 11:14:09.000000000 +0100
-@@ -0,0 +1,211 @@
-+Cyrus IMAP autocreate Inbox patch
-+----------------------------------
-+
-+NOTE : This patch has been created at the University of Athens. For more info, as well
-+as more patches on Cyrus IMAPD server, please visit http://email.uoa.gr/
-+
-+The design of Cyrus IMAP server does not predict the automatic creation of users'
-+INBOX folders. The creation of a user's INBOX is considered to be an external task,
-+that has to be completed as part of the user email account creation procedure.
-+Hence, to create a new email account the site administrator has to:
-+
-+ a) Include the new account in the user database for the authentication procedure
-+ (e.g. sasldb, shadow, mysql, ldap).
-+ b) Create the corresponding INBOX folder.
-+
-+Alternatively, the user, if succesfully authenticated, may create his own INBOX folder,
-+as long as the configuration of the site allows it (see "autocreatequota" in imapd.conf).
-+Unlike what not careful readers may think, enabling the "autocreatequota" option, doesn't
-+lead to the automatic INBOX folder creation by Cyrus IMAP server.
-+In fact, "autocreate" means that the IMAP clients are allowed to automatically create
-+the user INBOX.
-+
-+This patch adds the functionality of automatic creation of the users' INBOX folders into
-+the Cyrus IMAP server. It is implemented as two features, namely the "create on login"
-+and "create on post".
-+
-+
-+
-+Create on login
-+===============
-+This feauture provides automatic creation of a user's INBOX folder when all of the
-+following requirements are met:
-+
-+i) The user has succesfully passed the authentication procedure.
-+
-+ii) The user's authorisation ID (typically the same as the user's
-+authentication ID) doesn't belong to the imap_admins or admins
-+accounts (see imapd.conf).
-+
-+iii) The "autocreatequota" option in the imap configuration file
-+has been set to a non zero value.
-+
-+iv) The corresponding to the user's authorisation ID INBOX folder
-+does not exist.
-+
-+The user's first login is the most typical case when all four requirements are met.
-+Note that if the authenticated ID is allowed to proxy to another account for which
-+all of the above requirements are met, the corresponding INBOX folder for that account
-+will be created.
-+
-+
-+
-+Create on post
-+==============
-+This feauture provides automatic creation of a user's INBOX folder when all of the
-+following requirements are met.
-+
-+i) An email message addressed to the user has been received.
-+
-+ii) The recipient is not any of the imap_admins or admins accounts.
-+Note that passing emails to admins or imap_admins accounts from
-+the MTA to LMTP should be avoided in any case.
-+
-+iii) The recipient's INBOX does not exist.
-+
-+iv) The "autocreatequota" option in the imap configuration file
-+has been set to a non zero value.
-+
-+v) The "createonpost" option in the imap configuration file
-+has been switched on.
-+
-+
-+Besides the automatic creation of INBOX folder, additional functionalities are
-+provided:
-+
-+ (A) Automatic creation of INBOX subfolders controlled by "autocreateinboxfolders"
-+configuration option. eg
-+
-+autocreateinboxfolders: sent|drafts|spam|templates
-+
-+ (B) Automatic subscription of INBOX subfolders controlled by "autosubscribeinboxfolders"
-+configuration option. eg
-+
-+autosubscribeinboxfolders: sent|spam
-+
-+Obviously, only subscription to subfolders included in the "autocreateinboxfolder"
-+list is meaningful.
-+
-+ (C) Automatic subscription to shared folders (bulletin boards). The user gets
-+automatically subscribed to the shared folders declared in the "autosubscribesharedfolders"
-+configuration option in imapd.conf.
-+eg autosubscribesharedfolders: public_folder | public_folder.subfolder
-+
-+In order the above action to succeed, the shared folder has to pre-exist the INBOX creation
-+and the user must have the appropriate permissions in order to be able to subscribe to the
-+shared folder.
-+
-+* A new config option has been added. 'autosubscribe_all_sharedfolders' is a yes/no
-+option. When set to yes, the user is automatically subscribed to all shared folders one
-+has permission to subscribe to. Please, note that when this option is set to yes, then
-+'autosubscribesharedfolders' option is overriden.
-+
-+ (D) Automatic creation of a predefined default sieve script.
-+
-+This is very useful when a default sieve script is used for every user. Usually, a
-+default anti-spam script may me be written in a file and copied to each user
-+sieve scripts upon the INBOX creation. The imapd.conf options that have been added
-+are 'autocreate_sieve_script', 'autocreate_sieve_compiledscript' and
-+'generate_compiled_sieve_script'.
-+
-+autocreate_sieve_script configuration option refers to the full path of the file
-+that contains the sieve script. The default value is null and if no file is defined,
-+then no default script is created upon INBOX creation. (The feature is disabled)
-+eg autocreate_sieve_script: /etc/default_sieve_script
-+
-+autocreate_sieve_compiledscript configuration option refers to the full path of the
-+file that contains the bytecode compiled sieve script. If this filename is defined
-+in imapd.conf and the file exists, then it is automatically copied in the user's sieve
-+directory. If it is not defined, then a bytecode sieve script gets on the fly compiled
-+by the daemon.
-+eg autocreate_sieve_compiledscript: /etc/default_sieve_script.bc
-+
-+generate_compiled_sieve_script is a boolean option that triggers the compilation of the
-+source sieve script to bytecode sieve script. The file that the bytecode script will
-+be saved is pointed by autocreate_sieve_compiledscript.
-+
-+Ways of compiling a sieve script :
-+1. Compile a sieve script using the standard sievec utility, distributed by CMU
-+2. Compile a sieve script using the compile_sieve utility, released by UoA. This
-+ tool is almost identical to the sievec utility, with the difference that it
-+ reads the input and output file from autocreate_sieve_script and
-+ autocreate_sieve_compiledscript options in imapd.conf
-+3. Let cyrus create a compiled sieve script using a source script. Cyrus can be
-+ instructed to save the compiled script any time a compiled script does not exist.
-+
-+NOTES :
-+1. In order this functionality to work, the following requirements must have been met:
-+ - 'sieveusehomedir' option must be 'no' in the configuration (default).
-+ - 'sievedir' option must have a valid value.
-+2. Currently, this patch checks the validity of the source script while generating a
-+ bytecode compiled script, but not the validity of the bytecode sieve script file.
-+ The administrator should make sure that the provided files contain a valid sieve
-+ script as well as the compiled script is updated every time the source script changes.
-+
-+
-+ (E) The administrator may control for which users and/or groups may the INBOXes
-+automatically be created. The autocreate_users option restricts the groups
-+for which the patch will create the mailboxes.
-+
-+The default value of autocreate_users is anyone. So, if not set at all, the patch will
-+work for all users. However, one may set:
-+
-+autocreate_users: user1 user2 group:group1 group:group2
-+
-+In that case, the INBOX will be created only for user1, user2 and the users that belong
-+to group1 and group2.
-+
-+More refined control per service is provided by the options imap_autocreate_users,
-+pop3_autocreate_users and lmtp_autocreate_users. These options override the
-+autocreate_users option and offer per service control.
-+
-+Example:
-+One may want to restrict the create on post functionality only for a specific group
-+of users. To achieve this, the following lines must be added in the imapd.conf file:
-+
-+createonpost: yes
-+lmtp_autocreate_users: group:groupname
-+
-+
-+
-+Issues to be considered
-+=======================
-+
-+I) In order to use the create on post feauture one should be absolutely sure that:
-+a) The MTA checks the validity of the email recipient before sending the email to
-+LMTP. This is an RFC821 requirement. This usually expands to "the mta should be
-+able to use the account database as user mailbox database".
-+b) Only authorised accounts/services can talk to LMTP.
-+
-+II) Especially in the case of imap logins, the current patch implementation checks
-+for the INBOX folder existence upon login, causing an extra mailbox lookup in most
-+of the cases.
-+A better approach would be to chase the "IMAP_MAILBOX_NONEXISTENT" error code and
-+check if the error is associated with an INBOX folder. However, this would mess up
-+Cyrus code. The way it was implemented may not have been the most performance
-+optimised, but it produces a much cleaner and simple patch.
-+
-+
-+
-+Virtual Domains Support
-+=======================
-+
-+Virtual domains are supported by all versions of the patch for cyrus-imapd-2.2.1-BETA and
-+later. However, it is not possible to declare different INBOX subfolders to be created or
-+shared folders to be subscribed to for every domain.
-+
-+
-+
-+Things to be done
-+=================
-+
-+1. Support MUPDATE
-+
-+It is within the developers' intentions to support the mupdate protocol, but serious
-+design issues on future cyrus releases have to resolved first.
-+
-+2. Select different attributes (quota, partition, sieve filter, etc) depending on the group
-+a user belongs to.
-+
-+For more information and updates please visit http://email.uoa.gr/projects/cyrus/autocreate
-+
-diff -up cyrus-imapd-2.3.15/lib/auth.c.autocreate cyrus-imapd-2.3.15/lib/auth.c
---- cyrus-imapd-2.3.15/lib/auth.c.autocreate 2008-03-24 18:43:08.000000000 +0100
-+++ cyrus-imapd-2.3.15/lib/auth.c 2009-09-18 11:11:39.785115812 +0200
-@@ -118,3 +118,11 @@ struct auth_state *auth_state;
+diff -Naur cyrus-imapd-2.3.16/lib/auth.c cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth.c
+--- cyrus-imapd-2.3.16/lib/auth.c 2008-03-24 19:43:08.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth.c 2009-12-22 19:56:22.000000000 +0200
+@@ -118,3 +118,11 @@
auth->freestate(auth_state);
}
@@ -2148,10 +2151,10 @@ diff -up cyrus-imapd-2.3.15/lib/auth.c.autocreate cyrus-imapd-2.3.15/lib/auth.c
+ return auth->auth_canonuser(auth_state);
+}
+
-diff -up cyrus-imapd-2.3.15/lib/auth.h.autocreate cyrus-imapd-2.3.15/lib/auth.h
---- cyrus-imapd-2.3.15/lib/auth.h.autocreate 2008-03-24 18:43:08.000000000 +0100
-+++ cyrus-imapd-2.3.15/lib/auth.h 2009-09-18 11:11:39.786115963 +0200
-@@ -55,6 +55,7 @@ struct auth_mech {
+diff -Naur cyrus-imapd-2.3.16/lib/auth.h cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth.h
+--- cyrus-imapd-2.3.16/lib/auth.h 2008-03-24 19:43:08.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth.h 2009-12-22 19:56:22.000000000 +0200
+@@ -55,6 +55,7 @@
const char *identifier);
struct auth_state *(*newstate)(const char *identifier);
void (*freestate)(struct auth_state *auth_state);
@@ -2159,54 +2162,17 @@ diff -up cyrus-imapd-2.3.15/lib/auth.h.autocreate cyrus-imapd-2.3.15/lib/auth.h
};
extern struct auth_mech *auth_mechs[];
-@@ -77,5 +78,6 @@ int auth_memberof(struct auth_state *aut
+@@ -77,5 +78,6 @@
const char *identifier);
struct auth_state *auth_newstate(const char *identifier);
void auth_freestate(struct auth_state *auth_state);
+char *auth_canonuser(struct auth_state *auth_state);
#endif /* INCLUDED_AUTH_H */
-diff -up cyrus-imapd-2.3.15/lib/auth_krb5.c.autocreate cyrus-imapd-2.3.15/lib/auth_krb5.c
---- cyrus-imapd-2.3.15/lib/auth_krb5.c.autocreate 2008-03-24 18:43:08.000000000 +0100
-+++ cyrus-imapd-2.3.15/lib/auth_krb5.c 2009-09-18 11:11:39.786115963 +0200
-@@ -199,6 +199,14 @@ static void myfreestate(struct auth_stat
- free(auth_state);
- }
-
-+static char *mycanonuser(struct auth_state *auth_state)
-+{
-+ if (auth_state)
-+ return auth_state->userid;
-+
-+ return NULL;
-+}
-+
- #else /* HAVE_GSSAPI_H */
-
- static int mymemberof(
-@@ -230,6 +238,12 @@ static void myfreestate(
- fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
- }
-
-+static char *mycanonuser(
-+ struct auth_state *auth_state __attribute__((unused)))
-+{
-+ fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
-+}
-+
- #endif
-
- struct auth_mech auth_krb5 =
-@@ -240,4 +254,5 @@ struct auth_mech auth_krb5 =
- &mymemberof,
- &mynewstate,
- &myfreestate,
-+ &mycanonuser,
- };
-diff -up cyrus-imapd-2.3.15/lib/auth_krb.c.autocreate cyrus-imapd-2.3.15/lib/auth_krb.c
---- cyrus-imapd-2.3.15/lib/auth_krb.c.autocreate 2009-03-31 06:11:21.000000000 +0200
-+++ cyrus-imapd-2.3.15/lib/auth_krb.c 2009-09-18 11:11:39.785115812 +0200
-@@ -341,6 +341,15 @@ struct auth_state *auth_state;
+diff -Naur cyrus-imapd-2.3.16/lib/auth_krb.c cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_krb.c
+--- cyrus-imapd-2.3.16/lib/auth_krb.c 2009-03-31 07:11:21.000000000 +0300
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_krb.c 2009-12-22 19:56:22.000000000 +0200
+@@ -341,6 +341,15 @@
free((char *)auth_state);
}
@@ -2222,7 +2188,7 @@ diff -up cyrus-imapd-2.3.15/lib/auth_krb.c.autocreate cyrus-imapd-2.3.15/lib/aut
#else /* HAVE_KRB */
static int mymemberof(
-@@ -372,6 +381,13 @@ static void myfreestate(
+@@ -372,6 +381,13 @@
fatal("Authentication mechanism (krb) not compiled in", EC_CONFIG);
}
@@ -2236,16 +2202,54 @@ diff -up cyrus-imapd-2.3.15/lib/auth_krb.c.autocreate cyrus-imapd-2.3.15/lib/aut
#endif
struct auth_mech auth_krb =
-@@ -382,4 +398,5 @@ struct auth_mech auth_krb =
+@@ -382,4 +398,5 @@
&mymemberof,
&mynewstate,
&myfreestate,
+ &mycanonuser,
};
-diff -up cyrus-imapd-2.3.15/lib/auth_pts.c.autocreate cyrus-imapd-2.3.15/lib/auth_pts.c
---- cyrus-imapd-2.3.15/lib/auth_pts.c.autocreate 2008-03-24 18:43:08.000000000 +0100
-+++ cyrus-imapd-2.3.15/lib/auth_pts.c 2009-09-18 11:11:39.785115812 +0200
-@@ -512,6 +512,14 @@ static void myfreestate(struct auth_stat
+diff -Naur cyrus-imapd-2.3.16/lib/auth_krb5.c cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_krb5.c
+--- cyrus-imapd-2.3.16/lib/auth_krb5.c 2008-03-24 19:43:08.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_krb5.c 2009-12-22 19:56:22.000000000 +0200
+@@ -199,6 +199,14 @@
+ free(auth_state);
+ }
+
++static char *mycanonuser(struct auth_state *auth_state)
++{
++ if (auth_state)
++ return auth_state->userid;
++
++ return NULL;
++}
++
+ #else /* HAVE_GSSAPI_H */
+
+ static int mymemberof(
+@@ -230,6 +238,13 @@
+ fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
+ }
+
++static char *mycanonuser(
++ struct auth_state *auth_state __attribute__((unused)))
++{
++ fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
++ return NULL;
++}
++
+ #endif
+
+ struct auth_mech auth_krb5 =
+@@ -240,4 +255,5 @@
+ &mymemberof,
+ &mynewstate,
+ &myfreestate,
++ &mycanonuser,
+ };
+diff -Naur cyrus-imapd-2.3.16/lib/auth_pts.c cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_pts.c
+--- cyrus-imapd-2.3.16/lib/auth_pts.c 2008-03-24 19:43:08.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_pts.c 2009-12-22 19:56:22.000000000 +0200
+@@ -512,6 +512,14 @@
free(auth_state);
}
@@ -2260,16 +2264,16 @@ diff -up cyrus-imapd-2.3.15/lib/auth_pts.c.autocreate cyrus-imapd-2.3.15/lib/aut
struct auth_mech auth_pts =
{
"pts", /* name */
-@@ -520,4 +528,5 @@ struct auth_mech auth_pts =
+@@ -520,4 +528,5 @@
&mymemberof,
&mynewstate,
&myfreestate,
+ &mycanonuser,
};
-diff -up cyrus-imapd-2.3.15/lib/auth_unix.c.autocreate cyrus-imapd-2.3.15/lib/auth_unix.c
---- cyrus-imapd-2.3.15/lib/auth_unix.c.autocreate 2009-03-31 06:11:22.000000000 +0200
-+++ cyrus-imapd-2.3.15/lib/auth_unix.c 2009-09-18 11:11:39.787115798 +0200
-@@ -315,6 +315,16 @@ struct auth_state *auth_state;
+diff -Naur cyrus-imapd-2.3.16/lib/auth_unix.c cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_unix.c
+--- cyrus-imapd-2.3.16/lib/auth_unix.c 2009-03-31 07:11:22.000000000 +0300
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/auth_unix.c 2009-12-22 19:56:22.000000000 +0200
+@@ -315,6 +315,16 @@
free((char *)auth_state);
}
@@ -2286,16 +2290,16 @@ diff -up cyrus-imapd-2.3.15/lib/auth_unix.c.autocreate cyrus-imapd-2.3.15/lib/au
struct auth_mech auth_unix =
{
-@@ -324,4 +334,5 @@ struct auth_mech auth_unix =
+@@ -324,4 +334,5 @@
&mymemberof,
&mynewstate,
&myfreestate,
+ &mycanonuser,
};
-diff -up cyrus-imapd-2.3.15/lib/imapoptions.autocreate cyrus-imapd-2.3.15/lib/imapoptions
---- cyrus-imapd-2.3.15/lib/imapoptions.autocreate 2009-06-29 19:21:06.000000000 +0200
-+++ cyrus-imapd-2.3.15/lib/imapoptions 2009-09-18 11:11:39.787115798 +0200
-@@ -198,6 +198,55 @@ are listed with ``''.
+diff -Naur cyrus-imapd-2.3.16/lib/imapoptions cyrus-imapd-2.3.16-autocreate.uncompiled/lib/imapoptions
+--- cyrus-imapd-2.3.16/lib/imapoptions 2009-12-21 13:25:22.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/lib/imapoptions 2009-12-22 19:56:22.000000000 +0200
+@@ -236,6 +236,55 @@
/* Number of seconds to wait before returning a timeout failure when
performing a client connection (e.g., in a murder environment) */
@@ -2351,10 +2355,10 @@ diff -up cyrus-imapd-2.3.15/lib/imapoptions.autocreate cyrus-imapd-2.3.15/lib/im
{ "configdirectory", NULL, STRING }
/* The pathname of the IMAP configuration directory. This field is
required. */
-diff -up cyrus-imapd-2.3.15/notifyd/Makefile.in.autocreate cyrus-imapd-2.3.15/notifyd/Makefile.in
---- cyrus-imapd-2.3.15/notifyd/Makefile.in.autocreate 2008-03-24 20:59:32.000000000 +0100
-+++ cyrus-imapd-2.3.15/notifyd/Makefile.in 2009-09-18 11:11:39.776115765 +0200
-@@ -71,10 +71,11 @@ NOTIFYD_LIBS = @NOTIFYD_LIBS@
+diff -Naur cyrus-imapd-2.3.16/notifyd/Makefile.in cyrus-imapd-2.3.16-autocreate.uncompiled/notifyd/Makefile.in
+--- cyrus-imapd-2.3.16/notifyd/Makefile.in 2008-03-24 21:59:32.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/notifyd/Makefile.in 2009-12-22 19:56:22.000000000 +0200
+@@ -71,10 +71,11 @@
SERVICE=../master/service.o
IMAP_LIBS = @IMAP_LIBS@ @LIB_RT@
@@ -2367,10 +2371,10 @@ diff -up cyrus-imapd-2.3.15/notifyd/Makefile.in.autocreate cyrus-imapd-2.3.15/no
PURIFY=/usr/local/bin/purify
PUREOPT=-best-effort
-diff -up cyrus-imapd-2.3.15/notifyd/notifyd.c.autocreate cyrus-imapd-2.3.15/notifyd/notifyd.c
---- cyrus-imapd-2.3.15/notifyd/notifyd.c.autocreate 2008-03-24 20:59:32.000000000 +0100
-+++ cyrus-imapd-2.3.15/notifyd/notifyd.c 2009-09-18 11:11:39.776115765 +0200
-@@ -96,7 +96,7 @@ char *fetch_arg(char *head, char* tail)
+diff -Naur cyrus-imapd-2.3.16/notifyd/notifyd.c cyrus-imapd-2.3.16-autocreate.uncompiled/notifyd/notifyd.c
+--- cyrus-imapd-2.3.16/notifyd/notifyd.c 2008-03-24 21:59:32.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/notifyd/notifyd.c 2009-12-22 19:56:22.000000000 +0200
+@@ -96,7 +96,7 @@
#define NOTIFY_MAXSIZE 8192
@@ -2379,10 +2383,10 @@ diff -up cyrus-imapd-2.3.15/notifyd/notifyd.c.autocreate cyrus-imapd-2.3.15/noti
{
struct sockaddr_un sun_data;
socklen_t sunlen = sizeof(sun_data);
-diff -up cyrus-imapd-2.3.15/ptclient/Makefile.in.autocreate cyrus-imapd-2.3.15/ptclient/Makefile.in
---- cyrus-imapd-2.3.15/ptclient/Makefile.in.autocreate 2008-03-24 19:34:22.000000000 +0100
-+++ cyrus-imapd-2.3.15/ptclient/Makefile.in 2009-09-18 11:11:39.784115791 +0200
-@@ -57,10 +57,11 @@ CPPFLAGS = -I.. -I$(srcdir)/../imap -I$(
+diff -Naur cyrus-imapd-2.3.16/ptclient/Makefile.in cyrus-imapd-2.3.16-autocreate.uncompiled/ptclient/Makefile.in
+--- cyrus-imapd-2.3.16/ptclient/Makefile.in 2008-03-24 20:34:22.000000000 +0200
++++ cyrus-imapd-2.3.16-autocreate.uncompiled/ptclient/Makefile.in 2009-12-22 19:56:22.000000000 +0200
+@@ -57,10 +57,11 @@
AFS_LDFLAGS = @AFS_LDFLAGS@ @COM_ERR_LDFLAGS@
AFS_LIBS = @AFS_LIBS@
IMAP_LIBS = @IMAP_LIBS@ @LIB_RT@
diff --git a/cyrus-imapd-2.3.12p2-autosieve-0.6.0.diff b/cyrus-imapd-2.3.16-autosieve-0.6.0.diff
similarity index 88%
rename from cyrus-imapd-2.3.12p2-autosieve-0.6.0.diff
rename to cyrus-imapd-2.3.16-autosieve-0.6.0.diff
index 0ccc2d1..b66fcce 100644
--- a/cyrus-imapd-2.3.12p2-autosieve-0.6.0.diff
+++ b/cyrus-imapd-2.3.16-autosieve-0.6.0.diff
@@ -1,6 +1,6 @@
-diff -Naur cyrus-imapd-2.3.12p2/README.autosievefolder cyrus-imapd-2.3.12p2-autosieve.uncompiled/README.autosievefolder
---- cyrus-imapd-2.3.12p2/README.autosievefolder 1970-01-01 02:00:00.000000000 +0200
-+++ cyrus-imapd-2.3.12p2-autosieve.uncompiled/README.autosievefolder 2008-05-06 15:16:21.000000000 +0300
+diff -Naur cyrus-imapd-2.3.16/README.autosievefolder cyrus-imapd-2.3.16-autosieve.uncompiled/README.autosievefolder
+--- cyrus-imapd-2.3.16/README.autosievefolder 1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.3.16-autosieve.uncompiled/README.autosievefolder 2009-12-23 01:08:09.000000000 +0200
@@ -0,0 +1,42 @@
+Cyrus IMAP autosievefolder patch
+----------------------------------
@@ -44,9 +44,9 @@ diff -Naur cyrus-imapd-2.3.12p2/README.autosievefolder cyrus-imapd-2.3.12p2-auto
+
+For more information and updates please visit http://email.uoa.gr/projects/cyrus/autosievefolder
+
-diff -Naur cyrus-imapd-2.3.12p2/imap/lmtp_sieve.c cyrus-imapd-2.3.12p2-autosieve.uncompiled/imap/lmtp_sieve.c
---- cyrus-imapd-2.3.12p2/imap/lmtp_sieve.c 2008-03-24 19:09:17.000000000 +0200
-+++ cyrus-imapd-2.3.12p2-autosieve.uncompiled/imap/lmtp_sieve.c 2008-05-06 15:16:21.000000000 +0300
+diff -Naur cyrus-imapd-2.3.16/imap/lmtp_sieve.c cyrus-imapd-2.3.16-autosieve.uncompiled/imap/lmtp_sieve.c
+--- cyrus-imapd-2.3.16/imap/lmtp_sieve.c 2009-03-31 07:11:18.000000000 +0300
++++ cyrus-imapd-2.3.16-autosieve.uncompiled/imap/lmtp_sieve.c 2009-12-23 01:08:09.000000000 +0200
@@ -88,6 +88,9 @@
struct auth_state *authstate;
} script_data_t;
@@ -160,10 +160,10 @@ diff -Naur cyrus-imapd-2.3.12p2/imap/lmtp_sieve.c cyrus-imapd-2.3.12p2-autosieve
+ return IMAP_MAILBOX_NONEXISTENT;
+}
+
-diff -Naur cyrus-imapd-2.3.12p2/lib/imapoptions cyrus-imapd-2.3.12p2-autosieve.uncompiled/lib/imapoptions
---- cyrus-imapd-2.3.12p2/lib/imapoptions 2008-04-11 23:07:00.000000000 +0300
-+++ cyrus-imapd-2.3.12p2-autosieve.uncompiled/lib/imapoptions 2008-05-06 15:16:21.000000000 +0300
-@@ -942,6 +942,15 @@
+diff -Naur cyrus-imapd-2.3.16/lib/imapoptions cyrus-imapd-2.3.16-autosieve.uncompiled/lib/imapoptions
+--- cyrus-imapd-2.3.16/lib/imapoptions 2009-12-21 13:25:22.000000000 +0200
++++ cyrus-imapd-2.3.16-autosieve.uncompiled/lib/imapoptions 2009-12-23 01:08:09.000000000 +0200
+@@ -1043,6 +1043,15 @@
/* If enabled, lmtpd will look for Sieve scripts in user's home
directories: ~user/.sieve. */
diff --git a/cyrus-imapd-2.3.7-krb4.patch b/cyrus-imapd-2.3.7-krb4.patch
deleted file mode 100644
index bdc1425..0000000
--- a/cyrus-imapd-2.3.7-krb4.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- cyrus-imapd-2.3.7/imap/version.c.krb4 2005-02-16 22:06:19.000000000 +0100
-+++ cyrus-imapd-2.3.7/imap/version.c 2007-01-22 15:36:27.000000000 +0100
-@@ -169,7 +169,7 @@
- "; lock = %s", lock_method_desc);
- snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
- "; nonblock = %s", nonblock_method_desc);
--#ifdef HAVE_KRB
-+#if 0
- snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
- " (%s)", krb4_version);
- #endif
-
---- cyrus-imapd-2.3.7/imap/pop3d.c.krb4 2007-01-22 15:41:14.000000000 +0100
-+++ cyrus-imapd-2.3.7/imap/pop3d.c 2007-01-22 15:41:15.000000000 +0100
-@@ -88,8 +88,6 @@
- #include "statuscache.h"
-
- #ifdef HAVE_KRB
--/* kerberos des is purported to conflict with OpenSSL DES */
--#define DES_DEFS
- #include
-
- /* MIT's kpop authentication kludge */
diff --git a/cyrus-imapd-2.3.7-notify_sms.patch b/cyrus-imapd-2.3.7-notify_sms.patch
deleted file mode 100644
index 08b7e5d..0000000
--- a/cyrus-imapd-2.3.7-notify_sms.patch
+++ /dev/null
@@ -1,308 +0,0 @@
-diff -up cyrus-imapd-2.3.15/doc/man/imapd.conf.5.html.notify_sms cyrus-imapd-2.3.15/doc/man/imapd.conf.5.html
---- cyrus-imapd-2.3.15/doc/man/imapd.conf.5.html.notify_sms 2009-09-09 15:19:50.000000000 +0200
-+++ cyrus-imapd-2.3.15/doc/man/imapd.conf.5.html 2009-09-18 11:49:42.207115959 +0200
-@@ -3469,6 +3469,24 @@ proxying CREATE.
-
- |
-
-+ sendsms: /usr/bin/sendsms |
-+
-+
-+
-+
-+ |
-+
-+ The pathname of the sendsms executable. Sieve invokes
-+sendsms for sending SMS notifications.
-+ |
-+
-+
-+
-+
-+ |
-+
- servername: <none> |
-
-
-diff -up cyrus-imapd-2.3.15/doc/man/notifyd.8.html.notify_sms cyrus-imapd-2.3.15/doc/man/notifyd.8.html
---- cyrus-imapd-2.3.15/doc/man/notifyd.8.html.notify_sms 2009-09-09 15:19:51.000000000 +0200
-+++ cyrus-imapd-2.3.15/doc/man/notifyd.8.html 2009-09-18 11:49:42.208116026 +0200
-@@ -181,6 +181,18 @@ a Sieve ’notify’ action as i
- |
-
-
-+ sms
-+ |
-+
-+
-+ Send the notification as SMS. This method can ONLY be used in
-+a Sieve ’notify’ action as it requires a
-+sms: URL to be specified as an :option.
-+ |
-+
-+ |
-+
-+
- zephyr
- |
-
-diff -up cyrus-imapd-2.3.15/lib/imapoptions.notify_sms cyrus-imapd-2.3.15/lib/imapoptions
---- cyrus-imapd-2.3.15/lib/imapoptions.notify_sms 2009-09-18 11:49:42.189116010 +0200
-+++ cyrus-imapd-2.3.15/lib/imapoptions 2009-09-18 11:50:38.230115954 +0200
-@@ -966,6 +966,10 @@ are listed with ``''.
- /* The pathname of the sendmail executable. Sieve invokes sendmail
- for sending rejections, redirects and vacation responses. */
-
-+{ "sendsms", "/usr/bin/sendsms", STRING }
-+/* The pathname of the sendsms executable. Sieve invokes sendsms
-+ for sending SMS notifications. */
-+
- { "serverlist", NULL, STRING }
- /* Whitespace separated list of backend server names. Used for
- finding server with the most available free space for proxying
-diff -up cyrus-imapd-2.3.15/man/imapd.conf.5.notify_sms cyrus-imapd-2.3.15/man/imapd.conf.5
---- cyrus-imapd-2.3.15/man/imapd.conf.5.notify_sms 2009-09-09 15:19:48.000000000 +0200
-+++ cyrus-imapd-2.3.15/man/imapd.conf.5 2009-09-18 11:51:26.441839866 +0200
-@@ -771,6 +771,9 @@ Allowed values: \fIflat\fR, \fIberkeley\
- .IP "\fBsendmail:\fR /usr/lib/sendmail" 5
- The pathname of the sendmail executable. Sieve invokes sendmail
- for sending rejections, redirects and vacation responses.
-+.IP "\fBsendsms:\fR /usr/bin/sendsms" 5
-+The pathname of the sendsms executable. Sieve invokes sendsms
-+for sending SMS notifications.
- .IP "\fBserverlist:\fR " 5
- Whitespace separated list of backend server names. Used for
- finding server with the most available free space for proxying
-diff -up cyrus-imapd-2.3.15/man/notifyd.8.notify_sms cyrus-imapd-2.3.15/man/notifyd.8
---- cyrus-imapd-2.3.15/man/notifyd.8.notify_sms 2008-04-04 14:47:00.000000000 +0200
-+++ cyrus-imapd-2.3.15/man/notifyd.8 2009-09-18 11:49:42.225115999 +0200
-@@ -111,6 +111,11 @@ Email the notification. This method can
- Sieve 'notify' action as it requires a \fImailto:\fR URL to be
- specified as an \fI:option\fR.
- .TP
-+.B sms
-+Send the notification as SMS. This method can ONLY be used in a
-+Sieve 'notify' action as it requires a \fIsms:\fR URL to be
-+specified as an \fI:option\fR.
-+.TP
- .B zephyr
- Send the notification as a zephyrgram. If used in a Sieve 'notify'
- action, additional recipients can be specified as \fI:options\fR.
-diff -up cyrus-imapd-2.3.15/notifyd/Makefile.in.notify_sms cyrus-imapd-2.3.15/notifyd/Makefile.in
---- cyrus-imapd-2.3.15/notifyd/Makefile.in.notify_sms 2009-09-18 11:49:42.172115947 +0200
-+++ cyrus-imapd-2.3.15/notifyd/Makefile.in 2009-09-18 11:49:42.225115999 +0200
-@@ -85,7 +85,7 @@ all: notifyd
- install:
- $(INSTALL) -m 755 notifyd $(DESTDIR)$(service_path)
-
--OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_zephyr.o
-+OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_sms.o notify_zephyr.o
-
- notifytest: notifytest.o
- $(CC) $(LDFLAGS) -o notifytest \
-diff -up cyrus-imapd-2.3.15/notifyd/notifyd.h.notify_sms cyrus-imapd-2.3.15/notifyd/notifyd.h
---- cyrus-imapd-2.3.15/notifyd/notifyd.h.notify_sms 2008-03-24 20:59:32.000000000 +0100
-+++ cyrus-imapd-2.3.15/notifyd/notifyd.h 2009-09-18 11:49:42.233116003 +0200
-@@ -47,6 +47,7 @@
- #include "notify_null.h"
- #include "notify_log.h"
- #include "notify_mailto.h"
-+#include "notify_sms.h"
- #include "notify_zephyr.h"
-
- /* Notify method dispatch table definition */
-@@ -63,6 +64,7 @@ notifymethod_t methods[] = {
- { "null", notify_null }, /* do nothing */
- { "log", notify_log }, /* use syslog (for testing) */
- { "mailto", notify_mailto }, /* send an email */
-+ { "sms", notify_sms }, /* send an sms */
- #ifdef HAVE_ZEPHYR
- { "zephyr", notify_zephyr }, /* send a zephyrgram */
- #endif
-diff -up /dev/null cyrus-imapd-2.3.15/notifyd/notify_sms.c
---- /dev/null 2009-09-11 15:21:01.808252010 +0200
-+++ cyrus-imapd-2.3.15/notifyd/notify_sms.c 2009-09-18 11:49:42.233116003 +0200
-@@ -0,0 +1,116 @@
-+/* notify_sms.c -- SMS notification method
-+ * Simon Matter
-+ */
-+/*
-+ * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The name "Carnegie Mellon University" must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission. For permission or any other legal
-+ * details, please contact
-+ * Office of Technology Transfer
-+ * Carnegie Mellon University
-+ * 5000 Forbes Avenue
-+ * Pittsburgh, PA 15213-3890
-+ * (412) 268-4387, fax: (412) 268-7395
-+ * tech-transfer@andrew.cmu.edu
-+ *
-+ * 4. Redistributions of any form whatsoever must retain the following
-+ * acknowledgment:
-+ * "This product includes software developed by Computing Services
-+ * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
-+ *
-+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
-+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ * notify_sms is based on code from notify_mailto by Ken Murchison.
-+ * Copyright (c) 2005-2006 Simon Matter, Invoca Systems.
-+ * Release 2006071300/2.3.7
-+*/
-+
-+#include
-+
-+#include "notify_sms.h"
-+
-+#include
-+#include
-+#include
-+#include
-+#include
-+
-+#include "global.h"
-+#include "libconfig.h"
-+#include "sieve_interface.h"
-+
-+static int global_outgoing_count = 0;
-+
-+char* notify_sms(const char *class __attribute__((unused)),
-+ const char *priority,
-+ const char *user,
-+ const char *mailbox __attribute__((unused)),
-+ int nopt, char **options,
-+ const char *message)
-+{
-+ FILE *sm;
-+ const char *smbuf[10];
-+ int sm_stat;
-+ pid_t sm_pid;
-+ int fds[2];
-+
-+ /* XXX check/parse options (sms URI) */
-+ if (nopt < 1)
-+ return strdup("NO sms URI not specified");
-+
-+ smbuf[0] = "sendsms";
-+ smbuf[1] = "-u";
-+ smbuf[2] = user;
-+ smbuf[3] = "-p";
-+ smbuf[4] = priority;
-+ smbuf[5] = "-o";
-+ smbuf[6] = options[0];
-+ smbuf[7] = NULL;
-+
-+ pipe(fds);
-+ if ((sm_pid = fork()) == 0) {
-+ /* i'm the child! run sendsms! */
-+ close(fds[1]);
-+ /* make the pipe be stdin */
-+ dup2(fds[0], 0);
-+ execv(config_getstring(IMAPOPT_SENDSMS), (char **) smbuf);
-+
-+ /* if we're here we suck */
-+ return strdup("NO sms couldn't exec");
-+ }
-+ /* i'm the parent */
-+ close(fds[0]);
-+ sm = fdopen(fds[1], "w");
-+
-+ if (!sm)
-+ return strdup("NO sms could not spawn sendsms process");
-+
-+ fprintf(sm, message);
-+
-+ fclose(sm);
-+ while (waitpid(sm_pid, &sm_stat, 0) < 0);
-+
-+ /* XXX check for sendsms exit code */
-+
-+ return strdup("OK sms notification successful");
-+}
-diff -up /dev/null cyrus-imapd-2.3.15/notifyd/notify_sms.h
---- /dev/null 2009-09-11 15:21:01.808252010 +0200
-+++ cyrus-imapd-2.3.15/notifyd/notify_sms.h 2009-09-18 11:49:42.233116003 +0200
-@@ -0,0 +1,61 @@
-+/* notify_sms.h -- SMS notification method
-+ * Simon Matter
-+ */
-+/*
-+ * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The name "Carnegie Mellon University" must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission. For permission or any other legal
-+ * details, please contact
-+ * Office of Technology Transfer
-+ * Carnegie Mellon University
-+ * 5000 Forbes Avenue
-+ * Pittsburgh, PA 15213-3890
-+ * (412) 268-4387, fax: (412) 268-7395
-+ * tech-transfer@andrew.cmu.edu
-+ *
-+ * 4. Redistributions of any form whatsoever must retain the following
-+ * acknowledgment:
-+ * "This product includes software developed by Computing Services
-+ * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
-+ *
-+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
-+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ * notify_sms is based on code from notify_mailto by Ken Murchison.
-+ * Copyright (c) 2005-2006 Simon Matter, Invoca Systems.
-+ * Release 2006071300/2.3.7
-+ *
-+ */
-+
-+#ifndef _NOTIFY_SMS_H_
-+#define _NOTIFY_SMS_H_
-+
-+#include
-+
-+char* notify_sms(const char *class __attribute__((unused)),
-+ const char *priority,
-+ const char *user,
-+ const char *mailbox __attribute__((unused)),
-+ int nopt, char **options,
-+ const char *message);
-+
-+#endif /* _NOTIFY_SMS_H_ */
diff --git a/cyrus-imapd-2.3.9-rmquota+deletemailbox-0.2-1.diff b/cyrus-imapd-2.3.9-rmquota+deletemailbox-0.2-1.diff
deleted file mode 100644
index b021659..0000000
--- a/cyrus-imapd-2.3.9-rmquota+deletemailbox-0.2-1.diff
+++ /dev/null
@@ -1,514 +0,0 @@
-diff -Naur cyrus-imapd-2.3.9/imap/ctl_cyrusdb.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/ctl_cyrusdb.c
---- cyrus-imapd-2.3.9/imap/ctl_cyrusdb.c 2007-03-30 21:40:20.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/ctl_cyrusdb.c 2007-08-21 16:49:06.000000000 +0300
-@@ -133,7 +133,7 @@
- /* if it is MBTYPE_RESERVED, unset it & call mboxlist_delete */
- if(!r && (mbtype & MBTYPE_RESERVE)) {
- if(!r) {
-- r = mboxlist_deletemailbox(name, 1, NULL, NULL, 0, 0, 1);
-+ r = mboxlist_deletemailbox(name, 1, NULL, NULL, 0, 0, 1, 1);
- if(r) {
- /* log the error */
- syslog(LOG_ERR,
-diff -Naur cyrus-imapd-2.3.9/imap/ctl_mboxlist.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/ctl_mboxlist.c
---- cyrus-imapd-2.3.9/imap/ctl_mboxlist.c 2007-07-18 21:56:11.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/ctl_mboxlist.c 2007-08-21 16:49:06.000000000 +0300
-@@ -484,7 +484,7 @@
-
- wipe_head = wipe_head->next;
-
-- ret = mboxlist_deletemailbox(me->mailbox, 1, "", NULL, 0, 1, 1);
-+ ret = mboxlist_deletemailbox(me->mailbox, 1, "", NULL, 0, 1, 1, 1);
- if(!ret) sync_log_mailbox(me->mailbox);
- if(ret) {
- fprintf(stderr, "couldn't delete defunct mailbox %s\n",
-diff -Naur cyrus-imapd-2.3.9/imap/imapd.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/imapd.c
---- cyrus-imapd-2.3.9/imap/imapd.c 2007-08-02 17:18:51.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/imapd.c 2007-08-21 16:49:28.000000000 +0300
-@@ -4994,7 +4994,7 @@
-
- r = mboxlist_deletemailbox(name, imapd_userisadmin,
- imapd_userid, imapd_authstate,
-- 0, 0, 0);
-+ 0, 0, 0, 1);
-
- if (!r) sync_log_mailbox(name);
-
-@@ -5018,6 +5018,12 @@
- char *p;
- int domainlen = 0;
- int sync_lockfd = (-1);
-+ int keepQuota = 1;
-+
-+ if(name && *name == '+') {
-+ keepQuota = 0;
-+ name++;
-+ }
-
- r = (*imapd_namespace.mboxname_tointernal)(&imapd_namespace, name,
- imapd_userid, mailboxname);
-@@ -5076,7 +5082,7 @@
-
- r = mboxlist_deletemailbox(mailboxname, imapd_userisadmin,
- imapd_userid, imapd_authstate, 1-force,
-- localonly, 0);
-+ localonly, 0, keepQuota);
- }
-
- /* was it a top-level user mailbox? */
-@@ -6434,6 +6440,7 @@
- {
- int newquota = -1;
- int badresource = 0;
-+ int rmquota = 0;
- int c;
- int force = 0;
- static struct buf arg;
-@@ -6450,7 +6457,8 @@
- if (c != ')' || arg.s[0] != '\0') {
- for (;;) {
- if (c != ' ') goto badlist;
-- if (strcasecmp(arg.s, "storage") != 0) badresource = 1;
-+ if (strcasecmp(arg.s, "remove") == 0) rmquota = 1;
-+ else if (strcasecmp(arg.s, "storage") != 0) badresource = 1;
- c = getword(imapd_in, &arg);
- if (c != ' ' && c != ')') goto badlist;
- if (arg.s[0] == '\0') goto badlist;
-@@ -6519,7 +6527,10 @@
-
- /* local mailbox */
- if (!r || (r == IMAP_MAILBOX_NONEXISTENT)) {
-- r = mboxlist_setquota(mailboxname, newquota, force);
-+ if(!rmquota)
-+ r = mboxlist_setquota(mailboxname, newquota, force);
-+ else
-+ r = mboxlist_unsetquota(mailboxname);
- }
-
- imapd_check(NULL, 0, 0);
-@@ -8237,7 +8248,7 @@
- /* note also that we need to remember to let proxyadmins do this */
- r = mboxlist_deletemailbox(mailboxname,
- imapd_userisadmin || imapd_userisproxyadmin,
-- imapd_userid, imapd_authstate, 0, 1, 0);
-+ imapd_userid, imapd_authstate, 0, 1, 0, 1);
- if(r) syslog(LOG_ERR,
- "Could not delete local mailbox during move of %s",
- mailboxname);
-diff -Naur cyrus-imapd-2.3.9/imap/mailbox.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mailbox.c
---- cyrus-imapd-2.3.9/imap/mailbox.c 2007-07-20 17:21:57.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mailbox.c 2007-08-21 16:49:06.000000000 +0300
-@@ -2745,27 +2745,7 @@
-
- seen_delete_mailbox(mailbox);
-
-- if (delete_quota_root && !rquota) {
-- quota_delete(&mailbox->quota, &tid);
-- free(mailbox->quota.root);
-- mailbox->quota.root = NULL;
-- } else if (!rquota) {
-- /* Free any quota being used by this mailbox */
-- if (mailbox->quota.used >= mailbox->quota_mailbox_used) {
-- mailbox->quota.used -= mailbox->quota_mailbox_used;
-- }
-- else {
-- mailbox->quota.used = 0;
-- }
-- r = quota_write(&mailbox->quota, &tid);
-- if (r) {
-- syslog(LOG_ERR,
-- "LOSTQUOTA: unable to record free of " UQUOTA_T_FMT " bytes in quota %s",
-- mailbox->quota_mailbox_used, mailbox->quota.root);
-- }
-- else
-- quota_commit(&tid);
-- }
-+ mailbox_updatequota(mailbox,NULL);
-
- /* Flush data (message file) directory */
- mailbox_delete_files(mailbox->path);
-@@ -3394,3 +3374,48 @@
- if (*p == '.') *p = '/';
- }
- }
-+
-+/* This function is used to update the quota. Can be used to replace
-+ * identical parts of the code, and can be quite handy some times
-+ * The tid is used in order to make possible to make the quota update
-+ * being a part of a bigger transaction to the quota db */
-+int mailbox_updatequota(struct mailbox *mailbox, struct txn **tid)
-+{
-+ int r = 0, havetid = 0;
-+ struct txn **ltid = NULL;
-+
-+ if(tid) {
-+ ltid = tid;
-+ havetid = 1;
-+ }
-+ /* Ensure that we are locked */
-+ if(!mailbox->header_lock_count) return IMAP_INTERNAL;
-+
-+
-+ if(mailbox->quota.root) {
-+ r = quota_read(&mailbox->quota, ltid, 1);
-+ if( r == 0 ) {
-+ if (mailbox->quota.used >= mailbox->quota_mailbox_used) {
-+ mailbox->quota.used -= mailbox->quota_mailbox_used;
-+ }
-+ else {
-+ mailbox->quota.used = 0;
-+ }
-+ r = quota_write(&mailbox->quota, ltid);
-+ if (r) {
-+ syslog(LOG_ERR,
-+ "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
-+ mailbox->quota_mailbox_used, mailbox->quota.root);
-+ }
-+ else if(!havetid)
-+ quota_commit(tid);
-+ }
-+ /* It is not a big mistake not to have quota .. just remove from the mailbox */
-+ else if ( r == IMAP_QUOTAROOT_NONEXISTENT) {
-+ free(mailbox->quota.root);
-+ r = 0;
-+ }
-+ }
-+ return r;
-+}
-+
-diff -Naur cyrus-imapd-2.3.9/imap/mailbox.h cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mailbox.h
---- cyrus-imapd-2.3.9/imap/mailbox.h 2006-11-30 19:11:19.000000000 +0200
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mailbox.h 2007-08-21 16:49:06.000000000 +0300
-@@ -364,6 +364,8 @@
- struct mailbox *mailboxp);
- extern int mailbox_delete(struct mailbox *mailbox, int delete_quota_root);
-
-+extern int mailbox_updatequota(struct mailbox *mailbox, struct txn **tid);
-+
- extern int mailbox_rename_copy(struct mailbox *oldmailbox,
- const char *newname, char *newpartition,
- bit32 *olduidvalidityp, bit32 *newuidvalidityp,
-diff -Naur cyrus-imapd-2.3.9/imap/mboxlist.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mboxlist.c
---- cyrus-imapd-2.3.9/imap/mboxlist.c 2007-08-15 20:20:55.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mboxlist.c 2007-08-21 16:49:06.000000000 +0300
-@@ -95,6 +95,12 @@
- static int mboxlist_opensubs();
- static void mboxlist_closesubs();
-
-+static int child_cb(char *name,
-+ int matchlen __attribute__((unused)),
-+ int maycreate __attribute__((unused)),
-+ void *rock);
-+
-+
- static int mboxlist_rmquota(const char *name, int matchlen, int maycreate,
- void *rock);
- static int mboxlist_changequota(const char *name, int matchlen, int maycreate,
-@@ -102,6 +108,7 @@
-
- struct change_rock {
- struct quota *quota;
-+ struct quota *oldquota;
- struct txn **tid;
- };
-
-@@ -889,9 +896,9 @@
- */
- int mboxlist_deletemailbox(const char *name, int isadmin, char *userid,
- struct auth_state *auth_state, int checkacl,
-- int local_only, int force)
-+ int local_only, int force, int keepQuota)
- {
-- int r;
-+ int r, has_children = 0;
- char *acl;
- long access;
- struct mailbox mailbox;
-@@ -902,6 +909,7 @@
- int mbtype;
- const char *p;
- mupdate_handle *mupdate_h = NULL;
-+ char *quotaroot = NULL;
-
- if(!isadmin && force) return IMAP_PERMISSION_DENIED;
-
-@@ -1014,15 +1022,47 @@
-
- if ((r && !force) || isremote) goto done;
-
-- if (!r || force) r = mailbox_delete(&mailbox, deletequotaroot);
-+ if (!r || force) {
-+ /* first we have to keep the previous quota root in order to delete it */
-+ if(mailbox.quota.root)
-+ quotaroot = xstrdup(mailbox.quota.root);
-+ r = mailbox_delete(&mailbox, deletequotaroot);
-+ }
-+
-
- /*
- * See if we have to remove mailbox's quota root
- */
-- if (!r && mailbox.quota.root != NULL) {
-- /* xxx look for any other mailboxes in this quotaroot */
-+ if (!r && quotaroot != NULL) {
-+ /* xxx look for any other mailboxes in this quotaroot */
-+ /* If we have not asked to remove the quota (default behaviour), we check
-+ * whether there are any subfolders beneeth the quota root. If there aren't
-+ * any subfolders the reasonable thing is to delete the quota */
-+ if(keepQuota) {
-+ char pattern[MAX_MAILBOX_PATH+1];
-+ strlcpy(pattern, quotaroot, sizeof(pattern));
-+ if (config_virtdomains && name[strlen(name)-1] == '!') {
-+ strlcat(pattern, "*", sizeof(pattern));
-+ }
-+ else {
-+ strlcat(pattern, ".*", sizeof(pattern));
-+ }
-+ /* find if there are subfolders. Then we want to
-+ * keep the existing quota */
-+ mboxlist_findall(NULL, pattern, isadmin, userid,
-+ auth_state, child_cb, (void *) &has_children);
-+
-+ if(!has_children)
-+ if(!mboxlist_mylookup(quotaroot, NULL, NULL, NULL, NULL, NULL, 0, 1))
-+ has_children = 1;
-+ }
-+ /* If we want to remove the quota explicitely or the quota root folder has no subfolders
-+ * we execute the rmquota patch */
-+ if(!keepQuota || !has_children )
-+ mboxlist_unsetquota(quotaroot);
-+ free(quotaroot);
- }
--
-+
- done:
- if(r && tid && !force) {
- /* Abort the transaction if it is still in progress */
-@@ -2483,6 +2523,7 @@
- if (r) return r;
-
- crock.quota = "a;
-+ crock.oldquota = NULL;
- crock.tid = &tid;
- /* top level mailbox */
- if(have_mailbox)
-@@ -2501,15 +2542,19 @@
- */
- int mboxlist_unsetquota(const char *root)
- {
-+ char newquota[MAX_MAILBOX_PATH+1];
- char pattern[MAX_MAILBOX_PATH+1];
- struct quota quota;
-- int r=0;
-+ struct change_rock crock;
-+ int r=0, k=0;
-
- if (!root[0] || root[0] == '.' || strchr(root, '/')
- || strchr(root, '*') || strchr(root, '%') || strchr(root, '?')) {
- return IMAP_MAILBOX_BADNAME;
- }
-
-+ crock.tid=NULL;
-+
- quota.root = (char *) root;
- r = quota_read("a, NULL, 0);
- if (r == IMAP_QUOTAROOT_NONEXISTENT) {
-@@ -2534,9 +2579,47 @@
- /* submailboxes - we're using internal names here */
- mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_rmquota, (void *)root);
-
-- r = quota_delete("a, NULL);
-+ r = quota_delete("a, crock.tid);
-+
-+ /* If we cannot delete the quota then abort the operation */
-+ if(!r) {
-+ /* quota_findroot performs several checks that we can
-+ * assume that are already done, and don't have to perform
-+ * them again. One of them is that it returns 1 only if
-+ * quotaroot exists.
-+ */
-+ if(quota_findroot(newquota, sizeof(newquota), root)) {
-+ struct quota rootquota;
-+ rootquota.root = newquota;
-+ k = quota_read(&rootquota, crock.tid, 0);
-+ if (!k) {
-+ crock.quota = &rootquota;
-+ crock.oldquota = "a;
-+ /* top level mailbox */
-+ k = mboxlist_changequota(root, 0, 0, &crock);
-+ }
-+ /* submailboxes - we're using internal names here */
-+ if (!k)
-+ k = mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_changequota, &crock);
-+ if(!k)
-+ k = quota_write(&rootquota, crock.tid);
-+
-+ }
-+ else {
-+ /* top level mailbox */
-+ mboxlist_rmquota(root, 0, 0, (void *)root);
-+ /* submailboxes - we're using internal names here */
-+ mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_rmquota, (void *)root);
-+ }
-+ }
-+
-+ if(!r && !k)
-+ quota_commit(crock.tid);
-+ else
-+ quota_abort(crock.tid);
-
- return r;
-+
- }
-
- /*
-@@ -2632,6 +2715,7 @@
- struct mailbox mailbox;
- struct change_rock *crock = (struct change_rock *) rock;
- struct quota *mboxlist_newquota = crock->quota;
-+ struct quota *mboxlist_oldquota = crock->oldquota;
- struct txn **tid = crock->tid;
-
- assert(rock != NULL);
-@@ -2649,27 +2733,24 @@
- if (r) goto error;
-
- if (mailbox.quota.root) {
-- if (strlen(mailbox.quota.root) >= strlen(mboxlist_newquota->root)) {
-- /* Part of a child quota root */
-- mailbox_close(&mailbox);
-- return 0;
-- }
--
-- r = quota_read(&mailbox.quota, tid, 1);
-- if (r) goto error;
-- if (mailbox.quota.used >= mailbox.quota_mailbox_used) {
-- mailbox.quota.used -= mailbox.quota_mailbox_used;
-- }
-- else {
-- mailbox.quota.used = 0;
-- }
-- r = quota_write(&mailbox.quota, tid);
-- if (r) {
-- syslog(LOG_ERR,
-- "LOSTQUOTA: unable to record free of " UQUOTA_T_FMT " bytes in quota %s",
-- mailbox.quota_mailbox_used, mailbox.quota.root);
-- }
-- free(mailbox.quota.root);
-+ if(mboxlist_oldquota) {
-+ if (strlen(mailbox.quota.root) > strlen(mboxlist_oldquota->root)) {
-+ /* Part of a child quota root */
-+ mailbox_close(&mailbox);
-+ return 0;
-+ }
-+ }
-+ else {
-+ if (strlen(mailbox.quota.root) >= strlen(mboxlist_newquota->root)) {
-+ /* Part of a child quota root */
-+ mailbox_close(&mailbox);
-+ return 0;
-+ }
-+ }
-+
-+ r = mailbox_updatequota(&mailbox,tid);
-+ if (r)
-+ goto error;
- }
-
- mailbox.quota.root = xstrdup(mboxlist_newquota->root);
-@@ -2682,6 +2763,11 @@
-
- error:
- mailbox_close(&mailbox);
-+ syslog(LOG_ERR, "LOSTQUOTA: unable to change quota root for %s to %s: %s. \
-+ Command aborted. Run reconstruct to make sure mailboxes \
-+ are in consistent state",
-+ name, mboxlist_newquota->root, error_message(r));
-+ return 1;
- error_noclose:
- syslog(LOG_ERR, "LOSTQUOTA: unable to change quota root for %s to %s: %s",
- name, mboxlist_newquota->root, error_message(r));
-diff -Naur cyrus-imapd-2.3.9/imap/mboxlist.h cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mboxlist.h
---- cyrus-imapd-2.3.9/imap/mboxlist.h 2006-11-30 19:11:19.000000000 +0200
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/mboxlist.h 2007-08-21 16:49:06.000000000 +0300
-@@ -126,7 +126,7 @@
- * the planet */
- int mboxlist_deletemailbox(const char *name, int isadmin, char *userid,
- struct auth_state *auth_state, int checkacl,
-- int local_only, int force);
-+ int local_only, int force, int keepQuota);
-
- /* Rename/move a mailbox (hierarchical) */
- int mboxlist_renamemailbox(char *oldname, char *newname, char *partition,
-diff -Naur cyrus-imapd-2.3.9/imap/nntpd.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/nntpd.c
---- cyrus-imapd-2.3.9/imap/nntpd.c 2007-03-30 21:51:01.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/nntpd.c 2007-08-21 16:49:06.000000000 +0300
-@@ -3358,7 +3358,7 @@
- /* XXX should we delete right away, or wait until empty? */
-
- r = mboxlist_deletemailbox(mailboxname, 0,
-- newsmaster, newsmaster_authstate, 1, 0, 0);
-+ newsmaster, newsmaster_authstate, 1, 0, 0, 1);
-
- if (!r) sync_log_mailbox(mailboxname);
-
-diff -Naur cyrus-imapd-2.3.9/imap/sync_reset.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/sync_reset.c
---- cyrus-imapd-2.3.9/imap/sync_reset.c 2007-03-30 21:40:21.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/sync_reset.c 2007-08-21 16:49:06.000000000 +0300
-@@ -258,7 +258,7 @@
- if (r) goto fail;
-
- for (item = list->head ; item ; item = item->next) {
-- r=mboxlist_deletemailbox(item->name, 1, NULL, sync_authstate, 1, 0, 0);
-+ r=mboxlist_deletemailbox(item->name, 1, NULL, sync_authstate, 1, 0, 0, 1);
-
- if (r) goto fail;
- }
-@@ -274,7 +274,7 @@
- if (r) goto fail;
-
- for (item = list->head ; item ; item = item->next) {
-- r=mboxlist_deletemailbox(item->name, 1, NULL, sync_authstate, 1, 0, 0);
-+ r=mboxlist_deletemailbox(item->name, 1, NULL, sync_authstate, 1, 0, 0, 1);
-
- if (r) goto fail;
- }
-@@ -282,7 +282,7 @@
-
- /* Nuke inbox (recursive nuke possible?) */
- snprintf(buf, sizeof(buf)-1, "user.%s", user);
-- r = mboxlist_deletemailbox(buf, 1, "cyrus", sync_authstate, 1, 0, 0);
-+ r = mboxlist_deletemailbox(buf, 1, "cyrus", sync_authstate, 1, 0, 0, 1);
- if (r && (r != IMAP_MAILBOX_NONEXISTENT)) goto fail;
-
- if ((r=user_deletedata(user, sync_userid, sync_authstate, 1)))
-diff -Naur cyrus-imapd-2.3.9/imap/sync_server.c cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/sync_server.c
---- cyrus-imapd-2.3.9/imap/sync_server.c 2007-08-01 22:19:03.000000000 +0300
-+++ cyrus-imapd-2.3.9-rmquota+deletemailbox.uncompiled/imap/sync_server.c 2007-08-21 16:49:06.000000000 +0300
-@@ -1590,7 +1590,7 @@
-
- for (item = list->head ; item ; item = item->next) {
- r=mboxlist_deletemailbox(item->name, sync_userisadmin, sync_userid,
-- sync_authstate, 0, 0, 1);
-+ sync_authstate, 0, 0, 1, 1);
-
- if (r) goto fail;
- }
-@@ -1600,7 +1600,7 @@
- (sync_namespacep->mboxname_tointernal)(sync_namespacep, "INBOX",
- user, buf);
- r = mboxlist_deletemailbox(buf, sync_userisadmin, sync_userid,
-- sync_authstate, 0, 0, 1);
-+ sync_authstate, 0, 0, 1, 1);
- if (r && (r != IMAP_MAILBOX_NONEXISTENT)) goto fail;
-
- if ((r=user_deletedata(user, sync_userid, sync_authstate, 1)))
-@@ -2546,7 +2546,7 @@
-
- /* Delete with admin priveleges */
- r = mboxlist_deletemailbox(name, sync_userisadmin, sync_userid,
-- sync_authstate, 0, 0, 1);
-+ sync_authstate, 0, 0, 1, 1);
-
- if (r)
- prot_printf(sync_out, "NO Failed to delete %s: %s\r\n",
diff --git a/cyrus-imapd-README.RPM b/cyrus-imapd-README.RPM
index 9786aac..1ed8fa0 100644
--- a/cyrus-imapd-README.RPM
+++ b/cyrus-imapd-README.RPM
@@ -12,7 +12,7 @@ The following steps should lead you to a running Cyrus IMAP server:
your box. Upgrading any Invoca rpm based installation should be fine.
3) Make sure you understand that this RPM installs in FHS compliant
directories, like /var/lib/imap and /var/spool/imap
-4) Make sure cyrus-sasl 2.x is installed.
+4) Make sure cyrus-sasl is installed.
5) Make sure saslauthd is running. If not, edit /etc/sysconfig/saslauthd as
needed and do 'chkconfig saslauthd on ; service saslauthd start'
6) Install the cyrus-imapd RPMs.
diff --git a/cyrus-imapd-README.groupcache b/cyrus-imapd-README.groupcache
deleted file mode 100644
index 6688541..0000000
--- a/cyrus-imapd-README.groupcache
+++ /dev/null
@@ -1,30 +0,0 @@
-If you have a lot of groups or very large groups, cyrus-imapd login can become
-quite slow due to the way cyrus-imapd handles groups. This may become worse
-when using nss_ldap or other slow nss backends to resolve groups.
-Caching using nscd can increase speed dramatically but unfortunately not for
-all functions cyrus-imapd uses. nscd helps speeding up getgrnam() calls but not
-getgrent() calls, which are used by cyrus-imapd to get a complete list of all
-groups available.
-The groupfile patch implements a quick fix to the problem by using a separate
-group.cache file to speed up those operations using getgrent() calls.
-Calls to getgrnam() are not touched which means that the group.cache
-file must be kept in sync with the group source you are using with nss
-configured in /etc/nsswitch.conf. If group.cache doesn't exist,
-the patch has no effect and cyrus-imapd handles groups through getgrent().
-
-Quick HOWTO:
-- configure group lookup in /etc/nsswitch.conf if not already done
-- configure name service cache in /etc/nscd.conf (not mandatory)
-- start nscd with "service nscd start" (not mandatory)
-- configure a service which periodically updates the group.cache file using the
- upd_groupcache script. Either set up a cronjob or use a event in the cyrus
- configuration.
-
-Sample /etc/cyrus.conf event to update the group cache every 10 minutes:
-EVENTS {
- # some events removed here ***
- ...........................***
-
- # this is only necessary if using group cache feature
- groupcache cmd="upd_groupcache" period=10
-}
diff --git a/cyrus-imapd-acceptinvalidfrom.patch b/cyrus-imapd-acceptinvalidfrom.patch
deleted file mode 100644
index b44ab59..0000000
--- a/cyrus-imapd-acceptinvalidfrom.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- cyrus-imapd-2.2.6/imap/message.c.acceptinvalidfrom 2004-10-30 15:03:02.220642392 -0700
-+++ cyrus-imapd-2.2.6/imap/message.c 2004-10-30 15:06:01.838336352 -0700
-@@ -229,6 +229,8 @@
- int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
- int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
- int inheader = 1, blankline = 1;
-+ char is_from;
-+ static const char * from_header = "From ";
-
- while (size) {
- n = prot_read(from, buf, size > 4096 ? 4096 : size);
-@@ -294,8 +296,20 @@
- /* Check for valid header name */
- if (sawnl && buf[0] != ' ' && buf[0] != '\t') {
- if (buf[0] == ':') return IMAP_MESSAGE_BADHEADER;
-- for (p = (unsigned char *)buf; *p != ':'; p++) {
-- if (*p <= ' ') return IMAP_MESSAGE_BADHEADER;
-+ p = (unsigned char *) buf;
-+ if (*p == '>')
-+ p++;
-+ if (*p == from_header[0])
-+ is_from = 0;
-+ else
-+ is_from = -1;
-+ for (; *p != ':' && is_from < 5; p++) {
-+ if (is_from > 0 && *p != from_header[is_from])
-+ is_from = -1;
-+ if (is_from >= 0)
-+ is_from++;
-+ else
-+ if (*p <= ' ') return IMAP_MESSAGE_BADHEADER;
- }
- }
-
diff --git a/cyrus-imapd-procmail+cyrus.mc b/cyrus-imapd-procmail+cyrus.mc
deleted file mode 100644
index 2555d9f..0000000
--- a/cyrus-imapd-procmail+cyrus.mc
+++ /dev/null
@@ -1,28 +0,0 @@
-divert(-1)
-include(`../m4/cf.m4')
-define(`confDEF_USER_ID',``8:12'')
-OSTYPE(`linux')
-undefine(`UUCP_RELAY')
-undefine(`BITNET_RELAY')
-FEATURE(redirect)
-FEATURE(always_add_domain)
-FEATURE(use_cw_file)
-FEATURE(local_procmail)
-define(`CYRUS_MAILER_FLAGS',`Aw5:/|@o')
-define(`confLOCAL_MAILER',`cyrus')
-dnl # Note: CYUSER isn't needed, but must put $u in mailer args otherwise
-dnl # it uses SMTP for delivery!
-define(`CYRUS_MAILER_ARGS', `procmail -p /etc/procmailrc.cyrus CYUSER=$u')
-define(`CYRUS_MAILER_PATH', `/usr/bin/procmail')
-MAILER(cyrus)
-MAILER(procmail)
-MAILER(smtp)
-HACK(check_mail3,`hash -a@JUNK /etc/mail/deny')
-HACK(use_ip,`/etc/mail/ip_allow')
-HACK(use_names,`/etc/mail/name_allow')
-HACK(use_relayto,`/etc/mail/relay_allow')
-HACK(check_rcpt4)
-HACK(check_relay3)
-dnl Not yet tested...
-dnl LOCAL_RULE_0
-dnl Rbb + $+ < @ $=w . > $#cyrusbb $: $1
diff --git a/cyrus-imapd-sendmail-8.12.9-cyrusv2.m4 b/cyrus-imapd-sendmail-8.12.9-cyrusv2.m4
deleted file mode 100644
index 7c79f82..0000000
--- a/cyrus-imapd-sendmail-8.12.9-cyrusv2.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-PUSHDIVERT(-1)
-#
-# Copyright (c) 2002 Sendmail, Inc. and its suppliers.
-# All rights reserved.
-#
-# By using this file, you agree to the terms and conditions set
-# forth in the LICENSE file which can be found at the top level of
-# the sendmail distribution.
-#
-# Contributed by Kenneth Murchison.
-#
-
-_DEFIFNOT(`_DEF_CYRUSV2_MAILER_FLAGS', `lsDFMnqXz')
-_DEFIFNOT(`CYRUSV2_MAILER_FLAGS', `A@/:|m')
-ifdef(`CYRUSV2_MAILER_ARGS',, `define(`CYRUSV2_MAILER_ARGS', `FILE /var/imap/socket/lmtp')')
-define(`_CYRUSV2_QGRP', `ifelse(defn(`CYRUSV2_MAILER_QGRP'),`',`', ` Q=CYRUSV2_MAILER_QGRP,')')dnl
-
-POPDIVERT
-
-#########################################
-### Cyrus V2 Mailer specification ###
-#########################################
-
-VERSIONID(`$Id: cyrus-imapd-sendmail-8.12.9-cyrusv2.m4,v 1.1 2004/02/04 12:59:42 karsten Exp $')
-
-Mcyrusv2, P=[IPC], F=_MODMF_(CONCAT(_DEF_CYRUSV2_MAILER_FLAGS, CYRUSV2_MAILER_FLAGS), `CYRUSV2'),
- S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL, E=\r\n,
- _OPTINS(`CYRUSV2_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`CYRUSV2_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`CYRUSV2_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,_CYRUSV2_QGRP
- A=CYRUSV2_MAILER_ARGS
diff --git a/cyrus-imapd.cvt_cyrusdb_all b/cyrus-imapd.cvt_cyrusdb_all
index 1a66e10..5a5227d 100644
--- a/cyrus-imapd.cvt_cyrusdb_all
+++ b/cyrus-imapd.cvt_cyrusdb_all
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -97,16 +97,62 @@
#
# v1.2.1, Jan 13 2006 Simon Matter
# - code cleanup
+#
+# v1.2.2, Nov 29 2007 Simon Matter
+# - add ability to handle "@include" options in imapd.conf, patch
+# provided by Tim Bannister
+#
+# v1.2.3, Feb 07 2008 Simon Matter
+# - add ability to handle tabs in imapd.conf, patch provided
+# by Franz Knipp
+# - disable default values for some config options like sievedir
+#
+# v1.2.4, Apr 23 2008 Simon Matter
+# - add support for statuscache.db
+#
+# v1.3.0, Sep 29 2008 Simon Matter
+# - add multi-instance support
+#
+# v1.3.1, Oct 09 2008 Simon Matter
+# - improve variable handling
+#
+# v1.3.2, May 26 2009 Simon Matter
+# - add some sanity checks to multi-instance support
+#
+# v1.3.3, May 27 2009 Simon Matter
+# - make some cosmetic changes
+#
+# v1.3.4, Dec 22 2009 Simon Matter
+# - add support for user_deny.db
-VERSION=1.2.1
+VERSION=1.3.4
-if [ -n "$(/sbin/pidof cyrus-master)" ]; then
- echo "ERROR: cyrus-master is running, unable to convert mailboxes!"
- exit 1
+PIDFILE=/var/run/cyrus-master${INSTANCE}.pid
+
+# instance config
+CYRUSCONF=/etc/cyrus${INSTANCE}.conf
+IMAPDCONF=/etc/imapd${INSTANCE}.conf
+
+# make sure what we have is a valid instance
+# and that config files are present
+if [ -n "$INSTANCE" ]; then
+ [ -L /etc/rc.d/init.d/${BASENAME} ] || exit 0
+fi
+[ -f $CYRUSCONF ] || exit 0
+[ -f $IMAPDCONF ] || exit 0
+
+if [ -f $PIDFILE ]; then
+ read CYRUS_PID < $PIDFILE
+ if [ -n "$CYRUS_PID" ]; then
+ if ps -p $CYRUS_PID > /dev/null 2>&1; then
+ echo "ERROR: cyrus-master is running, unable to convert mailboxes!"
+ exit 1
+ fi
+ fi
fi
-if [ ! -f /etc/imapd.conf ]; then
- echo "ERROR: configuration file not found."
+if [ ! -f $IMAPDCONF ]; then
+ echo "ERROR: configuration file '${IMAPDCONF}' not found, exiting!"
exit 1
fi
@@ -119,7 +165,7 @@ fi
# force cyrus user for security reasons
if [ ! $(whoami) = "cyrus" ]; then
- exec $RUNUSER - cyrus -c "cd $PWD < /dev/null ; $0 $*"
+ exec $RUNUSER - cyrus -c "cd $PWD < /dev/null ; INSTANCE=$INSTANCE $0 $*"
fi
# special function for migration
@@ -131,14 +177,33 @@ umask 166
# show version info in log files
echo "cvt_cyrusdb_all version: $VERSION"
-# get_config [config default]
+# expand_config
+# handle "@include" sections from imapd style config file
+expand_config() {
+ while read line; do
+ if printf "%s\n" "${line}" | grep -q '^@include:'; then
+ expand_config "$( printf "%s\n" "${line}" | cut -d : -f 2- | sed -e 's/^[\t ]*//' )"
+ else
+ printf "%s\n" "${line}"
+ fi
+ done < $1
+}
+
+# get_config []
# extracts config option from config file
get_config() {
- if config=$(grep "^$1" /etc/imapd.conf); then
- echo $config | cut -d: -f2 | sed -e 's/^ *//' -e 's/-nosync//' -e 's/ *$//'
+ searchstr=$1
+ if config="$(expand_config $IMAPDCONF | egrep "^${searchstr}:")"; then
+ CFGVAL="$(printf "%s\n" "$config" | cut -d : -f 2- | sed -e 's/^[\t ]*//')"
else
- echo $2
+ if [ -z "$2" ]; then
+ echo "ERROR: config option '$1' not found in ${IMAPDCONF}, exiting!" 1>&2
+ return 1
+ fi
+ CFGVAL="$2"
fi
+ echo "get_config ${1}: $CFGVAL" 1>&2
+ echo "$CFGVAL"
}
# where to find files and directories
@@ -149,8 +214,8 @@ cyrus_magic=${data_dir}/magic
cvt_cyrusdb=${lib_dir}/cvt_cyrusdb
sievec=${lib_dir}/sievec
masssievec=${lib_dir}/masssievec
-imap_prefix=$(get_config configdirectory /var/lib/imap)
-sieve_dir=$(get_config sievedir /var/lib/imap/sieve)
+imap_prefix=$(get_config configdirectory) || exit 1
+sieve_dir=$(get_config sievedir) || exit 1
db_cfg=${data_dir}/db.cfg
db_current=${imap_prefix}/rpm/db.cfg.current
db_cache=${imap_prefix}/rpm/db.cfg.cache
@@ -159,33 +224,37 @@ db_cache=${imap_prefix}/rpm/db.cfg.cache
. $db_cfg
# get configured db backend config
-duplicate_db=$(get_config duplicate_db $duplicate_db)
-mboxlist_db=$(get_config mboxlist_db $mboxlist_db)
-seenstate_db=$(get_config seenstate_db $seenstate_db)
-subscription_db=$(get_config subscription_db $subscription_db)
-tlscache_db=$(get_config tlscache_db $tlscache_db)
-annotation_db=$(get_config annotation_db $annotation_db)
-mboxkey_db=$(get_config mboxkey_db $mboxkey_db)
-ptscache_db=$(get_config ptscache_db $ptscache_db)
-quota_db=$(get_config quota_db $quota_db)
+duplicate_db=$(get_config duplicate_db $duplicate_db) || exit 1
+mboxlist_db=$(get_config mboxlist_db $mboxlist_db) || exit 1
+seenstate_db=$(get_config seenstate_db $seenstate_db) || exit 1
+subscription_db=$(get_config subscription_db $subscription_db) || exit 1
+tlscache_db=$(get_config tlscache_db $tlscache_db) || exit 1
+annotation_db=$(get_config annotation_db $annotation_db) || exit 1
+mboxkey_db=$(get_config mboxkey_db $mboxkey_db) || exit 1
+ptscache_db=$(get_config ptscache_db $ptscache_db) || exit 1
+quota_db=$(get_config quota_db $quota_db) || exit 1
+statuscache_db=$(get_config statuscache_db $statuscache_db) || exit 1
+userdeny_db=$(get_config userdeny_db $userdeny_db) || exit 1
# remember current db backend config
{
-echo "duplicate_db=$duplicate_db"
-echo "mboxlist_db=$mboxlist_db"
-echo "seenstate_db=$seenstate_db"
-echo "subscription_db=$subscription_db"
-echo "tlscache_db=$tlscache_db"
-echo "annotation_db=$annotation_db"
-echo "mboxkey_db=$mboxkey_db"
-echo "ptscache_db=$ptscache_db"
-echo "quota_db=$quota_db"
-echo "sieve_version=$sieve_version"
+echo "duplicate_db=${duplicate_db}"
+echo "mboxlist_db=${mboxlist_db}"
+echo "seenstate_db=${seenstate_db}"
+echo "subscription_db=${subscription_db}"
+echo "tlscache_db=${tlscache_db}"
+echo "annotation_db=${annotation_db}"
+echo "mboxkey_db=${mboxkey_db}"
+echo "ptscache_db=${ptscache_db}"
+echo "quota_db=${quota_db}"
+echo "statuscache_db=${statuscache_db}"
+echo "userdeny_db=${userdeny_db}"
+echo "sieve_version=${sieve_version}"
} | sort > $db_current
-# file_type [file]
+# file_type
file_type() {
- this_type=$(file -b -m "$cyrus_magic:$system_magic" "$1" 2> /dev/null)
+ this_type=$(file -b -m "${cyrus_magic}:${system_magic}" "$1" 2> /dev/null)
if echo "$this_type" | grep -qi skip > /dev/null 2>&1; then
echo skiplist
elif echo "$this_type" | grep -qi text > /dev/null 2>&1; then
@@ -195,7 +264,7 @@ file_type() {
fi
}
-# cvt_file [file] [db]
+# cvt_file
cvt_file() {
target="$1"
new_db="$2"
@@ -208,21 +277,21 @@ cvt_file() {
if [ "$old_db" = "skiplist" ]; then
cp -a "$target" "${target}.skiplist"
else
- $cvt_cyrusdb "$target" "$old_db" "${target}.skiplist" skiplist
+ $cvt_cyrusdb -C $IMAPDCONF "$target" "$old_db" "${target}.skiplist" skiplist
fi
RETVAL=$?
- ERRVAL=$[ $ERRVAL + $RETVAL ]
+ ERRVAL=$(( $ERRVAL + $RETVAL ))
if [ $RETVAL -eq 0 ]; then
rm -f "$target"
if [ -s "${target}.skiplist" ]; then
if [ "$new_db" = "skiplist" ]; then
cp -a "${target}.skiplist" "$target"
else
- $cvt_cyrusdb "${target}.skiplist" skiplist "$target" "$new_db"
+ $cvt_cyrusdb -C $IMAPDCONF "${target}.skiplist" skiplist "$target" "$new_db"
fi
fi
RETVAL=$?
- ERRVAL=$[ $ERRVAL + $RETVAL ]
+ ERRVAL=$(( $ERRVAL + $RETVAL ))
if [ $RETVAL -eq 0 ]; then
rm -f "${target}.skiplist"
else
@@ -235,18 +304,18 @@ cvt_file() {
fi
}
-# cvt_to_utf8 [file]
+# cvt_to_utf8
cvt_to_utf8() {
target="$1"
if [ -s "$target" ]; then
- if ! $sievec "$target" "${target}.sievec"; then
+ if ! $sievec -C $IMAPDCONF "$target" "${target}.sievec"; then
iconv --from-code=ISO-8859-1 --to-code=UTF-8 --output="${target}.UTF-8" "$target"
if [ -s "${target}.UTF-8" ]; then
# preserve timestamp
- touch --reference="$target" "${target}.UTF-8"
+ touch --reference="${target}" "${target}.UTF-8"
mv -f "${target}.UTF-8" "$target"
else
- ERRVAL=$[ $ERRVAL + 1 ]
+ ERRVAL=$(( $ERRVAL + 1 ))
fi
fi
rm -f "${target}.sievec"
@@ -257,7 +326,7 @@ ERRVAL=0
# make sure our Berkeley databases are in a sane state
# wait for db_checkpoint to end successfully or kill it after a timeout
-db_checkpoint -v -1 -h $imap_prefix/db &
+db_checkpoint -v -1 -h ${imap_prefix}/db &
DB_CHECK_PID=$!
CNT=0
while [ $CNT -lt 60 ]; do
@@ -275,43 +344,47 @@ if kill -0 $DB_CHECK_PID > /dev/null 2>&1; then
fi
# do a normal recovery
-db_recover -v -h $imap_prefix/db
+db_recover -v -h ${imap_prefix}/db
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
# try a catastrophic recovery instead of normal recovery
- db_recover -v -c -h $imap_prefix/db
+ db_recover -v -c -h ${imap_prefix}/db
RETVAL=$?
- ERRVAL=$[ $ERRVAL + $RETVAL ]
+ ERRVAL=$(( $ERRVAL + $RETVAL ))
if [ $RETVAL -ne 0 ]; then
echo "ERROR: catastrophic recovery of Berkeley databases failed"
fi
fi
if [ "$EXPORT" = "export" ]; then
- # convert all db files to skiplist for migration
+ # convert all db files to portable format for migration
# TODO: quota_db, we don't touch it for now
- cvt_file $imap_prefix/deliver.db "skiplist"
- cvt_file $imap_prefix/mailboxes.db "skiplist"
- cvt_file $imap_prefix/tls_sessions.db "skiplist"
- cvt_file $imap_prefix/annotations.db "skiplist"
- cvt_file $imap_prefix/ptclient/ptscache.db "skiplist"
- rm -vf $imap_prefix/db/log.*
- rm -vf $imap_prefix/db/__db.*
+ cvt_file ${imap_prefix}/deliver.db "skiplist"
+ cvt_file ${imap_prefix}/mailboxes.db "skiplist"
+ cvt_file ${imap_prefix}/tls_sessions.db "skiplist"
+ cvt_file ${imap_prefix}/annotations.db "skiplist"
+ cvt_file ${imap_prefix}/ptclient/ptscache.db "skiplist"
+ cvt_file ${imap_prefix}/statuscache.db "skiplist"
+ cvt_file ${imap_prefix}/user_deny.db "flat"
+ rm -vf ${imap_prefix}/db/log.*
+ rm -vf ${imap_prefix}/db/__db.*
else
# always convert db files which have been converted to skiplist
# TODO: quota_db, we don't touch it for now
- cvt_file $imap_prefix/deliver.db "$duplicate_db"
- cvt_file $imap_prefix/mailboxes.db "$mboxlist_db"
- cvt_file $imap_prefix/tls_sessions.db "$tlscache_db"
- cvt_file $imap_prefix/annotations.db "$annotation_db"
- cvt_file $imap_prefix/ptclient/ptscache.db "$ptscache_db"
+ cvt_file ${imap_prefix}/deliver.db "$duplicate_db"
+ cvt_file ${imap_prefix}/mailboxes.db "$mboxlist_db"
+ cvt_file ${imap_prefix}/tls_sessions.db "$tlscache_db"
+ cvt_file ${imap_prefix}/annotations.db "$annotation_db"
+ cvt_file ${imap_prefix}/ptclient/ptscache.db "$ptscache_db"
+ cvt_file ${imap_prefix}/statuscache.db "$statuscache_db"
+ cvt_file ${imap_prefix}/user_deny.db "$userdeny_db"
# do we have to convert all databases?
if ! cmp -s $db_current $db_cache; then
# we treat sieve scripts the same way like db files
find ${sieve_dir}/ -name "*.script" -type f | while read db_file trash; do
cvt_to_utf8 "$db_file"
done
- $masssievec $sievec
+ $masssievec $sievec $IMAPDCONF
# convert all db files left
find ${imap_prefix}/user/ -name "*.seen" -type f | while read db_file trash; do
cvt_file "$db_file" "$seenstate_db"
diff --git a/cyrus-imapd.rpm_set_permissions b/cyrus-imapd.rpm_set_permissions
deleted file mode 100644
index b5de70e..0000000
--- a/cyrus-imapd.rpm_set_permissions
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-IMAPCONF=/etc/imapd.conf
-
-CONFDIR=$(grep -se "^configdirectory:" $IMAPCONF | cut -d":" -f2)
-if [ "x$CONFDIR" = "x" ]; then
- echo "$0 error: configdirectory not found in /etc/imapd.conf, exiting!"
- exit 1
-fi
-
-find $CONFDIR -type d ! -name "lost+found" -exec chmod 700 {} \; -exec chown cyrus:mail {} \;
-grep -sE "^(meta|)partition-.*:" $IMAPCONF | cut -d":" -f2 | while read SPOOLDIR; do
- if [ "x$SPOOLDIR" = "x" ]; then
- echo "$0 warning: invalid (meta)partition configuration in /etc/imapd.conf found!"
- else
- find $SPOOLDIR -type d ! -name "lost+found" -exec chmod 700 {} \; -exec chown cyrus:mail {} \;
- fi
-done
-
-find $CONFDIR -type f ! -name "lost+found" -exec chmod 600 {} \; -exec chown cyrus:mail {} \;
-grep -sE "^(meta|)partition-.*:" $IMAPCONF | cut -d":" -f2 | while read SPOOLDIR; do
- if [ "x$SPOOLDIR" = "x" ]; then
- echo "$0 warning: invalid (meta)partition configuration in /etc/imapd.conf found!"
- else
- find $SPOOLDIR -type f ! -name "lost+found" -exec chmod 600 {} \; -exec chown cyrus:mail {} \;
- fi
-done
-
-# lmtp socket must be accessible by group mail
-chmod 750 $CONFDIR
-chmod 750 ${CONFDIR}/socket
diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec
index 4635714..7a351c5 100644
--- a/cyrus-imapd.spec
+++ b/cyrus-imapd.spec
@@ -1,11 +1,10 @@
-#TODO: merge all sub-packages (except -devel) into cyrus-imapd, they are all required
-
Name: cyrus-imapd
Version: 2.3.16
-Release: 4%{?dist}
+Release: 5%{?dist}
%define ssl_pem_file %{_sysconfdir}/pki/%{name}/%{name}.pem
+#uid/gid reserved, see setup:/usr/share/doc/setup*/uidgid
%define uid 76
%define gid 76
@@ -18,43 +17,26 @@ License: BSD
Group: System Environment/Daemons
URL: http://cyrusimap.web.cmu.edu/
Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus/%{name}-%{version}.tar.gz
-Source3: cyrus-deliver-wrapper.c
-Source4: cyrus-user-procmailrc.template
Source5: cyrus-imapd.logrotate
Source6: cyrus-imapd.imap-2.3.x-conf
Source7: cyrus-imapd.pam-config
Source8: http://email.uoa.gr/projects/cyrus/autocreate/README.autocreate-cyrus-2.3
Source9: http://email.uoa.gr/projects/cyrus/autosievefolder/README.autosievefolder
-Source10: http://oss.netfarm.it/download/skiplist.py
Source11: cyrus-imapd.init
Source12: cyrus-imapd.sysconfig
Source13: cyrus-imapd.cvt_cyrusdb_all
Source14: cyrus-imapd.magic
-Source15: http://clement.hermann.free.fr/scripts/Cyrus/imapcreate.pl
-Source16: http://eu.dl.sourceforge.net/cyrus-utils/cyrus_ldap_quota.pl
-Source17: ftp://kalamazoolinux.org/pub/projects/awilliam/cyrus/batchreconstruct
-Source18: ftp://kalamazoolinux.org/pub/projects/awilliam/cyrus/bsd2cyrus
-Source19: ftp://kalamazoolinux.org/pub/projects/awilliam/cyrus/cpmsg
-Source20: ftp://kalamazoolinux.org/pub/projects/awilliam/cyrus/folderxfer
-Source21: ftp://kalamazoolinux.org/pub/projects/awilliam/cyrus/inboxfer
-Source22: http://email.uoa.gr/download/cyrus/cyrus_sharedbackup/cyrus_sharedbackup-0.1.tar.gz
-Source24: README.HOWTO-recover-mailboxes.db
Source25: cyrus-imapd.cron-daily
-Source26: cyrus-procmailrc
-Source27: cyrus-imapd-procmail+cyrus.mc
-Source28: cyrus-imapd.rpm_set_permissions
-Source29: cyrus-imapd-sendmail-8.12.9-cyrusv2.m4
-Source33: README.skiplist_recovery
-Patch0: cyrus-imapd-2.2.12-no_transfig.patch
-Patch1: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.12/cyrus-imapd-2.3.12p2-autocreate-0.10-0.diff
-Patch2: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.12/cyrus-imapd-2.3.12p2-autosieve-0.6.0.diff
-Patch4: http://servercc.oakton.edu/~jwade/cyrus/cyrus-imapd-2.1.3/cyrus-imapd-2.1.3-flock.patch
-Patch6: cyrus-imapd-2.1.16-getrlimit.patch
-Patch10: cyrus-imapd-acceptinvalidfrom.patch
-Patch12: cyrus-imapd-2.3.7-notify_sms.patch
+
+Patch1: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.16/cyrus-imapd-2.3.16-autocreate-0.10-0.diff
+
+Patch2: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.16/cyrus-imapd-2.3.16-autosieve-0.6.0.diff
+
+Patch4: http://www.oakton.edu/~jwade/cyrus/cyrus-imapd-2.1.3/cyrus-imapd-2.1.3-flock.patch
+
Patch14: cyrus-imapd-2.3.1-authid_normalize.patch
+
Patch15: cyrus-imapd-2.3.1-make_md5_defaults.patch
-Patch18: cyrus-imapd-2.3.7-krb4.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=461875
Patch19: cyrus-imapd-2.3.12p2-current-db.patch
@@ -74,6 +56,7 @@ BuildRequires: flex, bison, groff, automake
BuildRequires: openldap-devel
BuildRequires: krb5-devel
BuildRequires: net-snmp-devel
+BuildRequires: transfig
Requires(post): e2fsprogs, chkconfig, initscripts, perl, grep, coreutils, findutils
Requires(preun): chkconfig, initscripts, coreutils
@@ -119,21 +102,13 @@ Summary: Cyrus IMAP server development files
The %{name}-devel package contains header files and libraries
necessary for developing applications which use the imclient library.
-%package perl
-Group: System Environment/Libraries
-Summary: Cyrus IMAP server utility Perl modules
-
-%description perl
-The %{name}-perl contains Perl modules necessary to use the
-Cyrus IMAP server administration utilities.
-
%package utils
Group: Applications/System
Summary: Cyrus IMAP server administration utilities
Requires(pre): shadow-utils
Requires(post): grep, coreutils, make, openssl
Requires(postun): shadow-utils
-Requires: %{name}-perl = %{version}-%{release}
+Obsoletes: %{name}-perl < 2.3.16-5
%description utils
The %{name}-utils package contains administrative tools for the
@@ -142,27 +117,15 @@ one running the server.
%prep
%setup -q
-%patch0 -p1 -b .no_transfig
%patch1 -p1 -b .autocreate
%patch2 -p1 -b .autosieve
%patch4 -p1 -b .flock
-%patch6 -p1 -b .getrlimit
-%patch10 -p1 -b .acceptinvalidfrom
-%patch12 -p1 -b .notify_sms
%patch14 -p1 -b .authid_normalize
%patch15 -p1 -b .make_md5_defaults
-%patch18 -p1 -b .krb4
%patch19 -p1 -b .db4.7
%patch20 -p1 -b .nodenny
%patch21 -p1 -b .qos
-# add additional sources
-mkdir doc/{m4,contrib}
-%{__install} -m 644 %{SOURCE10} %{SOURCE15} %{SOURCE16} %{SOURCE17} \
- %{SOURCE18} %{SOURCE19} %{SOURCE20} %{SOURCE21} doc/contrib/
-%{__install} -m 644 %{SOURCE24} %{SOURCE33} %{SOURCE8} %{SOURCE9} doc/
-%{__install} -m 644 %{SOURCE26} %{SOURCE4} %{SOURCE27} %{SOURCE29} doc/m4/
-
# only to update config.* files
automake -a -f -c || :
aclocal -I cmulocal
@@ -178,11 +141,13 @@ autoconf -f
find . -type f -name "*.pl" | xargs %{__perl} -pi -e "s@/usr/local/bin/perl@%{__perl}@"
# modify lmtp socket path in .conf files
-%{__perl} -pi -e "s@/var/imap/@%{_var}/lib/imap/@" master/conf/*.conf doc/cyrusv2.mc doc/m4/%{name}-sendmail-8.12.9-cyrusv2.m4
+%{__perl} -pi -e "s@/var/imap/@%{_var}/lib/imap/@" master/conf/*.conf doc/cyrusv2.mc #doc/m4/%{name}-sendmail-8.12.9-cyrusv2.m4
# enable idled in .conf files to prevent error messages
%{__perl} -pi -e "s/# idled/ idled/" master/conf/*.conf
+# Fix permissions on perl programs
+find . -type f -name "*.pl" -exec %{__chmod} 755 {} \;
%build
CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/et -I%{_includedir}/kerberosIV"; export CPPFLAGS
@@ -218,9 +183,6 @@ LDFLAGS="$LDFLAGS -pie"; export LDFLAGS
%install
%{__rm} -rf %{buildroot}
-# Fix permissions on perl programs
-find . -type f -name "*.pl" -exec %{__chmod} 755 {} \;
-
# This is needed to install the perl files correctly
pushd perl/imap
%{__perl} Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor
@@ -255,7 +217,6 @@ done
# Install additional files
%{__install} -m 755 %{SOURCE13} %{buildroot}%{_cyrexecdir}/cvt_cyrusdb_all
-%{__install} -m 755 %{SOURCE28} %{buildroot}%{_cyrexecdir}/rpm_set_permissions
%{__install} -m 644 %{SOURCE14} %{buildroot}%{_datadir}/%{name}/rpm/magic
%{__install} -p -m 644 master/conf/prefork.conf %{buildroot}%{_sysconfdir}/cyrus.conf
%{__install} -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/imapd.conf
@@ -272,8 +233,8 @@ done
%{__install} -p -m 755 %{SOURCE25} %{buildroot}%{_sysconfdir}/cron.daily/%{name}
# Cleanup of doc dir
-find doc perl -name CVS -type d | xargs -r %{__rm} -rf
-find doc perl -name .cvsignore -type f | xargs -r %{__rm} -f
+find doc perl -name CVS -type d -prune -exec echo %{__rm} -rf {} \;
+find doc perl -name .cvsignore -type f -exec %{__rm} -rf {} \;
%{__rm} -f doc/Makefile.dist*
%{__rm} -f doc/text/htmlstrip.c
%{__rm} -f doc/text/Makefile
@@ -308,9 +269,6 @@ touch %{buildroot}%{ssl_pem_file}
%{__perl} -pi -e 's|fetchnews|cyrfetchnews|g;s|Fetchnews|Cyrfetchnews|g;s/FETCHNEWS/CYRFETCHNEWS/g' \
%{buildroot}%{_mandir}/man8/cyrfetchnews.8
-# compress manpages
-[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
-
#remove executable bit from docs
for ddir in doc perl/imap/examples
do
@@ -339,7 +297,7 @@ find %{buildroot}%{perl_vendorarch} -name "*.bs" -exec %{__rm} -f {} \;
%post
/sbin/chkconfig --add %{name}
-# Force synchronous updates, usually only on ext2 filesystems
+# Force synchronous updates, usually only on extX filesystems
chattr -R +S $i %{_var}/lib/imap/{user,quota} %{_var}/spool/imap 2>/dev/null ||:
# Create SSL certificates
@@ -374,14 +332,6 @@ if [ $1 != 0 ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
-%post utils
-# FIXME: remove when setup > 2.8.10 is released
-# Add service entries if necessary
-if ! %{__grep} -q ^csync %{_sysconfdir}/services; then
- echo -e 'csync\t\t2005/tcp\t\t\t# Cyrus IMAP Replication Daemon' >> %{_sysconfdir}/services
- echo -e 'csync\t\t2005/udp\t\t\t# Cyrus IMAP Replication Daemon' >> %{_sysconfdir}/services
-fi
-
%files
%defattr(-,root,root,-)
%doc COPYRIGHT README
@@ -444,7 +394,6 @@ fi
%{_cyrexecdir}/unexpunge
%{_cyrexecdir}/upgradesieve
%{_cyrexecdir}/cvt_cyrusdb_all
-%{_cyrexecdir}/rpm_set_permissions
%{_cyrexecdir}/idled
%{_cyrexecdir}/compile_sieve
%{_cyrexecdir}/mupdate
@@ -489,11 +438,12 @@ fi
%{_libdir}/lib*.a
%{_mandir}/man3/imclient.3*
-%files perl
+%files utils
%defattr(-,root,root)
%doc perl/imap/README
%doc perl/imap/Changes
%doc perl/imap/examples
+%{_bindir}/*
%dir %{perl_vendorarch}/Cyrus
%dir %{perl_vendorarch}/Cyrus/IMAP
%{perl_vendorarch}/Cyrus/IMAP/Admin.pm
@@ -514,13 +464,16 @@ fi
%{_mandir}/man3/Cyrus::IMAP.3pm.gz
%{_mandir}/man3/Cyrus::IMAP::IMSP.3pm.gz
%{_mandir}/man3/Cyrus::SIEVE::managesieve.3pm.gz
-
-%files utils
-%defattr(0644,root,root,0755)
-%attr(0755,root,root) %{_bindir}/*
%{_mandir}/man1/*
%changelog
+* Mon Jun 07 2010 Michal Hlavinka - 2.3.16-5
+- spec cleanup
+- simplified packaging (merge -perl in -utils)
+- remove obsoleted and/or unmaintained additional sources/patches
+- remove long time not used files from the cvs/srpm
+- update additional sources/patches from their upstream
+
* Tue Jun 01 2010 Marcela Maslanova - 2.3.16-4
- Mass rebuild with perl-5.12.0
diff --git a/cyrus-imapd.upd_groupcache b/cyrus-imapd.upd_groupcache
deleted file mode 100644
index bf50c35..0000000
--- a/cyrus-imapd.upd_groupcache
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# This script updates a cache of the unix group database. It's purpose is to
-# speedup group authorization when using large groups with slow nss backends.
-# For more info consult the README.groupcache file.
-#
-# This script can safely be run as root, it will reexec itself as user
-# cyrus if needed.
-#
-# author: Simon Matter, Invoca Systems
-
-# changelog
-# v1.0.0, Dec 15 2004 Simon Matter
-# - initial release
-
-if [ ! -f /etc/imapd.conf ]; then
- echo "ERROR: configuration file not found."
- exit 1
-fi
-
-# fallback to su if runuser not available
-if [ -x /sbin/runuser ]; then
- RUNUSER=runuser
-else
- RUNUSER=su
-fi
-
-# force cyrus user for security reasons
-if [ ! $(whoami) = "cyrus" ]; then
- exec $RUNUSER - cyrus -c "cd $PWD < /dev/null ; $0"
-fi
-
-# files get mode 0600
-umask 166
-
-# get_config [config default]
-# extracts config option from config file
-get_config() {
- if config=$(grep "^$1" /etc/imapd.conf); then
- echo $config | cut -d: -f2
- else
- echo $2
- fi
-}
-
-# where to find files and directories
-imap_prefix=$(get_config configdirectory /var/lib/imap)
-group_cache=${imap_prefix}/group.cache
-
-TMPCACHE=$(mktemp ${group_cache}.XXXXXX) || exit 1
-getent group >> $TMPCACHE
-mv -f $TMPCACHE $group_cache
diff --git a/cyrus-procmailrc b/cyrus-procmailrc
deleted file mode 100644
index 66c6127..0000000
--- a/cyrus-procmailrc
+++ /dev/null
@@ -1,129 +0,0 @@
-#################################################
-# procmailrc
-# This is the main procmail file with common SPAM recipes
-# Based on the article at
-# http://www.ncworldmag.com/ncw-05-1998/ncw-05-imap.html
-#
-#
-# First we define some basics
-
-PATH=/usr/bin:/bin
-SHELL=/bin/sh
-
-# We define DELIVERTO just to prevent a lot of extra
-# typing later on. We define SPAMIT to prevent even more
-# repetitive typing, as it's the same action for every user.
-# This assumes we set up a SPAM folder right off the INBOX
-# for every user on the system. If we neglect to do that, we'll
-# get in a bit of trouble.
-
-DELIVERTO=/usr/cyrus/bin/deliver-wrapper
-SPAMIT="$DELIVERTO user.$LOGNAME.SPAM"
-
-# This file includes the appropriate procmail.$LOGNAME
-# file so that each user has his or her own recipe techniques
-# for subscribed lists, e-mail alerts, etc.
-
-# Before we begin any recipes, let's make a backup
-# copy of any incoming mail.
-#
-# Remember to comment out the next recipe once
-# you know everything is working fine, otherwise
-# you'll fill up the backup directory very quickly.
-# Some procmail tutorials demonstrate how you can
-# set a quota on the backup directory so that you can
-# leave it in force at all times.
-
-:0 ic
-| $DELIVERTO user.$LOGNAME.Backup
-
-###############################
-# If there used to be an existing system-wide procmailrc, you can
-# include it here
-#INCLUDERC=/etc/procmailrc
-
-# We shouldn't be running as a privileged user, but just in case,
-# make sure we drop any privileges we have
-DROPPRIVS=1
-
-###############################
-# If users want to be able to define their own private recipes
-# and put them in their home .procmailrc files, comment out
-# the next definition.
-#
-# These recipes will be processed BEFORE the user-specific
-# recipes that are kept in the /home/cyrus directory
-#
-# setup some variables, before we start
-ALERTSBOX=user.$LOGNAME.Folders.Alerts
-LISTSBOX=user.$LOGNAME.Folders.Lists
-#
-INCLUDERC=$HOME/.procmailrc
-
-# If you want to define user-specific recipes that
-# you manage centrally (perhaps because you don't want
-# to allow your users to "roll their own," then
-# uncomment the following line. In this case, you have
-# to create a file for each user in the form:
-# procmail.username -- for example, procmail.Joe
-#
-# INCLUDERC=/usr/cyrus/etc/procmail.$LOGNAME
-
-#############################
-# Now we begin our recipes
-
-#############################
-# Email-specific SPAM recipes
-# Here's one example
-
-#### NOTE: surely cyrus 'deliver' does its own locking? There should
-#### thus be no need for :0:$LOGNAME.lock
-
-:0
-* ^To:.*anyplace@juno.com
-| $SPAMIT
-
-#############################
-# General SPAM Recipes
-# Here are a few examples
-#
-# The "To:" line doesn't exist
-
-#:0
-#* !^To:
-#| $SPAMIT
-
-# The "To:" line is empty
-
-#:0
-#* ^To: $
-#| $SPAMIT
-
-# The "From:" line is empty
-
-#:0
-#* ^From: $
-#| $SPAMIT
-
-#############################
-# All the mail that falls
-# through the above recipes
-# will be put into the user's
-# inbox. This is always the LAST
-# recipe to appear in the file.
-
-:0W
-| $DELIVERTO user.$LOGNAME
-
-# If that fails - maybe because the user is out of quota, or the mailbox
-# hasn't been created - then force a bounce (otherwise the message would
-# get silently appended to /var/spool/mail/$LOGNAME).
-
-# This is EX_CANTCREAT (Can't create output)
-EXITCODE=73
-:0
-/dev/null
-
-#
-# End of procmailrc file
-##############################
diff --git a/cyrus-user-procmailrc.template b/cyrus-user-procmailrc.template
deleted file mode 100644
index 8a018a1..0000000
--- a/cyrus-user-procmailrc.template
+++ /dev/null
@@ -1,58 +0,0 @@
-##############################
-# Begin procmailrc.joe file
-#
-# This is Joe's specific set of procmail
-# recipes. It assumes that Joe has a
-# number of specific folders created
-# to which these recipes refer. Otherwise
-# the mail cannot be sorted properly.
-#
-# First, let's define some high-level
-# folder macros to save typing later on.
-# The ALERTSBOX points to the
-# folder where we'll sort out various
-# incoming news alerts.
-# The LISTSBOX will point to a
-# folder where we'll sort out various
-# list services to which we're subscribed.
-#
-# Both ALERTSBOX and LISTSBOX
-# are subfolders of a generic folder called,
-# duh, Folders, which is right off the
-# user's INBOX.
-#
-# So if a Linux-kernel message comes in
-# it gets deposited in the folder
-# Folders/Lists/Linux_Kernel which is
-# represented in Cyrus IMAP terms as
-# user.Joe.Folders.Lists.Linux_kernel
-#
-
-############################
-# Put anchordesk alerts in news alerts folder
-
-:0:$LOGNAME.lock
-* ^From:.*anchordesk
-| $DELIVERTO $ALERTSBOX.News-Alerts
-
-# Put NC World alerts in their own folder
-
-:0:$LOGNAME.lock
-* ^From:.*NCWorld@FDDS.com
-| $DELIVERTO $ALERTSBOX.NCWorld-Alerts
-
-#############################
-# List processing & Misc Alerts
-
-:0:$LOGNAME.lock
-* (^Cc:|^CC:|^To:|^Sender:).*linux-kernel@vger.rutgers.edu
-| $DELIVERTO $LISTSBOX.Linux_Kernel
-
-:0:$LOGNAME.lock
-* (^Cc:|^CC:|^To:|^Sender:).*linux-net@vger.rutgers.edu
-| $DELIVERTO $LISTSBOX.Linux_Net
-
-#
-# End of procmailrc.joe file
-##############################
-
diff --git a/cyrus_ldap_quota.pl b/cyrus_ldap_quota.pl
deleted file mode 100644
index 2fcf052..0000000
--- a/cyrus_ldap_quota.pl
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/perl
-use Cyrus::IMAP::Admin;
-
-# This script was created by Kevin J. Menard, Jr. .
-# It requires root privileges to write to a file in /etc. Best use is
-# to set this up as cron job. Works for me. Hope it does for you.
-# Any questions/complaints/praise/whatever, send 'em to the address
-# above. -- 08/16/2001
-
-
-# These are the variables you might want to tweak.
-my $quota_attr = "mailQuota";
-my $mail_attr = "mailRoutingAddress";
-my $user = "cyrus";
-my $passwd = "blah";
-
-# These are the ones that you shouldn't have to.
-my @entries = ();
-my $index = 0;
-my $counter = 0;
-my $old_timestamp = 0;
-my $timestamp = "199412161032Z";
-
-# Open the /etc/cyrus_ldap_quota_time file; it's a long name, but
-# shouldn't interfere with existing files :) This file contains 1 line,
-# the generalized time format of the last time the script ran. This is
-# used for the search, so we only update quotas that have been modified
-# since then.
-
-{
- if (-e "/etc/cyrus_ldap_quota_time")
- {
- open(TIME_FILE, "/etc/cyrus_ldap_quota_time") or die "could not
- open the time file: $!\n";
-
- while() { $old_timestamp = $_; }
-
- close(TIME_FILE);
- }
-
- # Now we deal with the case where the file doesn't exist, that is to
- # say the first time the script was run.
-
- unless ($old_timestamp == 0) { $timestamp = $old_timestamp; }
-
-
- # Now that we have that information, we can overwrite the file with
- # the new timestamp. Maybe this overkill, but this is only a
- # temporary solution anyway.
-
- open(TIME_FILE, ">/etc/cyrus_ldap_quota_time") or die "could not
- create file: $!\n";
-
- my @time = (localtime)[0..5];
-
- printf TIME_FILE $time[5] + 1900;
- printf TIME_FILE "%02d", $time[4] + 1;
- for (my $i = 3; $i >= 0; $i--) { printf TIME_FILE "%02d", $time[$i];}
- print TIME_FILE 'Z';
-
- close(TIME_FILE);
-}
-
-
-# This is where we do the search and then parse the results into a
-# useable form. In this case, an arry of hash entries.
-{
- # Okay, this very ugly line sets up the LDAP search, and the strips
- # away the meaningless stuff. This could be prettier, but I didn't
- # want to add a dependency for an LDAP module, and everyone should
- # have LDAP search. The greps are just to make things simpler.
-
- (my $query = "ldapsearch -x '(&(modifyTimestamp>=$timestamp)($quota_attr=*))' $quota_attr $mail_attr
- | grep -v ^# | grep -v ^dn | grep -v ^version | grep -v ^search | grep -v ^result | grep -v ^\$") =~ s!\n!!;
-
- # Now actually do the commands in the above line.
- my $result = `$query`;
-
-
- # Split the output into an array, one entry per line.
- my @output = split(/\n/, $result);
-
- # Now go through each line . . .
- foreach (@output)
- {
- # Split on the attribute:value boundary.
- (my $key, my $value) = split(/: /);
-
- # Handle mailRoutingAddress; strip away everything after '@'.
- if ($value =~ m!@!)
- {
- ($value, undef) = split (/@/, $value);
- }
-
- # Add each doctored up attribute:value pair to the entries array.
- $entries[$index]{$key} = $value;
-
- # A crude hack to make sure each of the two attributes makes it
- # into one of the entries array element.
- if ($counter % 2)
- {
- $index++;
- }
-
- $counter++;
- }
-}
-
-# Now here's the actual interaction with Cyrus IMAPd. It's all pretty
-# self-explanatory.
-{
- my $imap = Cyrus::IMAP::Admin->new('localhost') or die "imap:
- cannot connect to server: $!\n";
-
- $imap->send(undef, undef, "LOGIN %s %s", $user, $passwd) or die
- "could not send user:pass to the server: $!\n";
-
- for (my $i = 0; $i <= $#entries; $i++)
- {
- $imap->setquota("user." . $entries[$i]{$mail_attr}, "STORAGE",
- $entries[$i]{$quota_attr})
- or die "imap: could not set quota for
- user.$entries[$i]{$mail_attr}: $!\n";
- }
-
- $imap=undef;
-}
diff --git a/folderxfer b/folderxfer
deleted file mode 100644
index 095fadc..0000000
--- a/folderxfer
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl
-#
-# Usage: folderxfer inputfile
-#
-# Purpose: Converts contents of Berkeley-format mail folders
-# to Cyrus mailboxes
-#
-# Input: Output of 'bsd2cyrus'
-# (username:Cyrus-folder-name:Berkeley-folder-path)
-#
-# Warnings: The root mailbox and empty Cyrus folder must
-# exist before conversion takes place, and source folders
-# should be checked for RFC 822 content before being processed
-#
-#$Id: folderxfer,v 1.1 2004/02/04 12:59:42 karsten Exp $
-
-$pwd = "/usr/lib/cyrus-imapd";
-$mailstore = "/var/spool/imap"; # Cyrus mailstore
-$cat = "/bin/cat";
-$cmd = "/usr/bin/formail -n 20 -s $pwd/cpmsg";
-
-$folders = "$ARGV[0]";
-if (!$folders) { die "Usage: $0 filename"; }
-
-open (MB,"$folders") || die "can't open $folders";
-
-while () {
-
- chop;
-
- # Be careful with this split - the last token might have
- # whitespace we want to preserve
-
- ($user,$cyrusfolder,$folder) = split(/:/,$_,3);
- @fields = split(/\./,$cyrusfolder);
- $cyrfol = $fields[$#fields];
-
- $fcat = "$cat \"$folder\"";
- print $fcat;
- $prefix = substr($user,0,1);
- system ("$fcat | $cmd '$mailstore/$prefix/user/$user/$cyrfol'");
- #print "'$mailstore/$prefix/user/$user/$cyrfol";
-}
-close MB;
-
-
diff --git a/imapcreate.pl b/imapcreate.pl
deleted file mode 100644
index b26af24..0000000
--- a/imapcreate.pl
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/perl -w
-#
-# imapcreate: create IMAP mailboxes with quotas
-# Reads user names from standard input.
-# launch without argument for a short help.
-#
-# originally found on http://cyrus-utils.sourceforge.net
-# (could not find any copyright info, thought)
-#
-# enhanced by Clément "nodens" Hermann
-#
-# I'd like to consider this as GPL'd (cf www.gnu.org), but won't add any copyright without the original author's consent.
-#
-
-use Getopt::Long;
-use Cyrus::IMAP::Admin;
-use strict;
-
-
-my $debug;
-my $user;
-my $pass;
-my $quota;
-my @part;
-my $useunixhierarchy;
-my @mailboxes;
-my $delete;
-my $cyrus;
-
-sub usage {
- print <]]
- [-q quota] [-t partition:list] [-s] [-v]
-
-Options:
- -t : the partition to use. Default to the \"default\" partition
- -q ; the quota, if a quota is needed. It is normally in KiloBytes, but you can use m,M,g or G suffix to use MB or GB instead, e.g 10k, 2048M or 100g
- -m : a comma-separated mailbox list
- -u : your cyrus admin user (usually cyrus or cyradm)
- -p : your cyrus admin password (if not provided, it will be asked for)
- -s : use the unix hierarchy separator (see imapd.conf(1))
- -d : delete mailboxes instead of creating them
- -v : run in debug mode, and print information on stdout
-
-If no password is submitted with -p, we'll prompt for one.
-if no mailbox name is specified with -m, read user names from standard input
-
- examples:
- imapcreate -u cyradm -m foo,bar,joe -q 50000 -t p1:p2 mail.testing.umanitoba.ca
- cat list.txt | imapcreate -u cyradm -p 'cyruspass' -q 50M mail.testing.umanitoba.ca
-EOU
- exit 1;
-}
-
-# Create a mailbox... usage : &CreateMailBox(user,partition[,quota]).
-# You have to be authentified already. We use "$cyrus" as the connection name.
-# partition can be 'default'
-sub CreateMailBox {
- my $mbuser = $_[0];
- my $mbpart = $_[1];
- my $mbquota = $_[2];
-
- print "Creating $mbuser on $mbpart\n" if $debug;
- if ($mbpart eq 'default') {
- $cyrus->createmailbox($mbuser);
- }
- else {
- $cyrus->createmailbox($mbuser, $mbpart);
- }
- warn $cyrus->error if $cyrus->error;
-
- # Set the quota
- if ($mbquota) {
- print "Setting quota for $mbuser to $mbquota\n" if $debug;
- $cyrus->setquota($mbuser, 'STORAGE', $mbquota);
- warn $cyrus->error if $cyrus->error;
- }
-}
-
-# Delete a mailbox. Usage: $DeleteMailBox($user)
-# Assuming we use $user as the admin.
-sub DeleteMailBox {
- my $mbuser = $_[0];
- my $delacl = "c";
-
- print "Deleting $mbuser\n" if $debug;
- $cyrus->setaclmailbox($mbuser, $user, $delacl);
- $cyrus->deletemailbox($mbuser);
- warn $cyrus->error if $cyrus->error;
-}
-
-GetOptions("d|delete" => \$delete, "u|user=s" => \$user, "p|pass=s" => \$pass, "m|mailboxes=s" => \@mailboxes, "q|quota=s" => \$quota,
- "t|part=s" => \@part, "s|UnixHierarchy" => \$useunixhierarchy, "v|verbose" => \$debug );
-@part = split(/:/, join(':', @part));
-push @part, 'default' unless @part;
-my $pn = 0;
-@mailboxes = split(/,/, join(',', @mailboxes));
-
-my $server = shift(@ARGV) if (@ARGV);
-usage unless $server;
-
-# quotas formatting:
-if ($quota) {
- if ($quota =~ /^(\d+)([mk]?)$/i) {
- my $numb = $1;
- my $letter = $2;
- if ($letter =~ /^m$/i) {
- $quota = $numb * 1024;
- print "debug: quota=$quota\n" if $debug;
- } elsif ($letter =~ /^k$/i) {
- $quota = $numb;
- print "debug: quota=$quota\n" if $debug;
- } else {
- die "malformed quota: $quota (must be at least one digit eventually followed by m, M, k or K\n";
-# $quota = $numb;
-# print "debug: quota=$quota\n" if $debug;
- }
- } else {
- die "malformed quota: $quota (must be at least one digit eventually followed by m, M, k or K\n";
- }
-}
-
-# Authenticate
-$cyrus = Cyrus::IMAP::Admin->new($server);
-$cyrus->authenticate(-mechanism => 'login', -user => $user,
- -password => $pass);
-die $cyrus->error if $cyrus->error;
-
-# if there isn't any mailbox defined yet, get them from standard input
-if (! (defined $mailboxes[0])) {
- # For all users
- while (<>) {
- chomp;
- my $mbox = $_;
- push @mailboxes, $mbox;
- }
-}
-
-# create/delete mailboxes for each user
-foreach my $mailbox (@mailboxes) {
- if ($useunixhierarchy) {
- $mailbox = 'user/' . $mailbox;
- } else {
- $mailbox = 'user.' . $mailbox;
- }
-
- if ($delete) {
- &DeleteMailBox($mailbox)
- } else {
- # Select the partition
- my $pt = $part[$pn];
- $pn += 1;
- $pn = 0 unless $pn < @part;
- &CreateMailBox($mailbox,$pt,$quota)
- }
-}
-
diff --git a/inboxfer b/inboxfer
deleted file mode 100644
index eea6837..0000000
--- a/inboxfer
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/perl
-#
-# Usage: inboxfer inputfile
-#
-# Purpose: Transfer messages from Berkeley-format inbox to Cyrus inbox
-#
-# Input: Text file containing one username per line
-#
-# Warning: Do not use this script to transfer messages into a Cyrus
-# mailbox that already contain messages. Existing messages
-# will be overwritten.
-#
-#$Id: inboxfer,v 1.1 2005/04/15 20:24:15 jdennis Exp $
-
-$mailstore = "/var/spool/imap"; # Cyrus mailstore
-$oldspool = "/var/spool/mail"; # Old mail spool
-$cat = "/bin/cat"; # /usr/bin/cat on Solaris
-$formail = "/usr/bin/formail";
-$pwd = "/usr/lib/cyrus-imapd";
-$cpmsg = "cpmsg";
-
-$cmd = "$formail -n 20 -s $pwd/$cpmsg";
-
-$users = "$ARGV[0]";
-if (!$users) { die "Usage: $0 $users\n"; }
-
-open(USERS,"$users") || die "can't open $users";
-
-while () {
- chop;
- $inbox = "$oldspool/$_";
- $prefix = substr($_,0,1);
- system("$cat $inbox | $cmd $mailstore/$prefix/user/$_");
-}
-
-
diff --git a/skiplist.py b/skiplist.py
deleted file mode 100644
index b0a9cfb..0000000
--- a/skiplist.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env python
-# -*- Mode: Python; tab-width: 4 -*-
-#
-# Cyrus Imapd Skiplist db recovery tool
-#
-# Copyright (C) 2004 Gianluigi Tiesi
-# Copyright (C) 2004 NetFarm S.r.l. [http://www.netfarm.it]
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-# ======================================================================
-
-__version__= '0.1'
-__doc__="""Cyrus skiplist db recover"""
-
-from sys import argv,exit,stdout,stderr
-from struct import unpack
-from time import localtime, strftime
-
-### User Conf
-debug = 0
-###
-
-TIMEFMT ='%a, %d %b %Y %H:%M:%S %z'
-PADDING = '\xff' * 4
-INORDER = 1
-ADD = 2
-DELETE = 4
-COMMIT = 255
-DUMMY = 257
-HEADER = -1
-MAIN = -2
-
-types = {
- 1: 'INORDER',
- 2: 'ADD',
- 4: 'DELETE',
- 255: 'COMMIT',
- 257: 'DUMMY',
- -1: 'HEADER',
- -2: '*'
- }
-
-def log(rtype, text):
- global debug
- if debug:
- out = '[%s] %s\n' % (types[rtype], text)
- stdout.write(out)
- stdout.flush()
-
-def roundto4(value):
- if value % 4:
- return ((value / 4) + 1) * 4
- return value
-
-def get_header(fp):
- #### Magic ??
- fp.seek(4)
-
- sign = fp.read(16)
- log(HEADER, sign[:-3])
-
- version = unpack('>I', fp.read(4))[0]
- version_minor = unpack('>I', fp.read(4))[0]
-
- log(HEADER, 'Version %d,%d' % (version, version_minor))
-
- maxlevel = unpack('>I', fp.read(4))[0]
- curlevel = unpack('>I', fp.read(4))[0]
-
- log(HEADER, 'Level %d/%d' % (curlevel, maxlevel))
-
- listsize = unpack('>I', fp.read(4))[0]
- log(HEADER, 'List size %d' % listsize)
-
- logstart = unpack('>I', fp.read(4))[0]
- log(HEADER, 'Offset %d' % logstart)
-
- lastrecovery = localtime(unpack('>I', fp.read(4))[0])
- lastrecovery = strftime(TIMEFMT, lastrecovery)
-
- log(HEADER, 'Last Recovery %s' % lastrecovery)
-
- return { 'version' : [version, version_minor],
- 'level' : [curlevel, maxlevel],
- 'listsize' : listsize,
- 'logstart' : logstart,
- 'lastrecover': lastrecovery
- }
-
-def getkeys(fp):
- values = []
- keys = {}
- keystring = ''
- datastring = ''
-
- while 1:
- log(MAIN, '-'*78)
-
- stype = fp.read(4)
-
- ### EOF
- if len(stype) != 4:
- break
-
- rtype = unpack('>I', stype)[0]
- if not types.has_key(rtype):
- log(MAIN, 'Invalid type %d' % rtype)
- continue
-
- log(rtype, 'Record type %s' % types[rtype])
-
- if rtype == DELETE:
- ptr = unpack('>I', fp.read(4))[0]
- log(rtype, 'DELETE %d (0x%x)' % (ptr, ptr))
- continue
-
- if rtype == COMMIT:
- continue
-
- ksize = unpack('>I', fp.read(4))[0]
- log(rtype, 'Key size %d (%d)' % (ksize, roundto4(ksize)))
-
- if ksize:
- keystring = fp.read(roundto4(ksize))[:ksize]
- log(rtype, 'Key String %s' % keystring)
-
- datasize = unpack('>I', fp.read(4))[0]
- log(rtype, 'Data size %d (%d)' % (datasize, roundto4(datasize)))
-
- if datasize:
- datastring = fp.read(roundto4(datasize))[:datasize]
- log(rtype, 'Data String %s' % datastring)
-
- n = 0
- while 1:
- str_p = fp.read(4)
- if str_p == PADDING:
- break
- spointer = unpack('>I', str_p)[0]
- n = n +1
- if spointer: log(rtype, 'Skip pointer %d' % spointer)
-
- log(rtype, 'Total Skip pointers: %d' % n)
-
- if rtype != DUMMY:
- if keystring not in values:
- values.append(keystring)
- keys[keystring] = datastring
-
- return values, keys
-
-if __name__ == '__main__':
- if len(argv) != 2:
- print 'Usage: %s skiplist.file' % argv[0]
- exit()
-
- fp = open(argv[1], 'rb')
- header = get_header(fp)
- values, keys = getkeys(fp)
- fp.close()
-
- if debug: exit()
- for v in values:
- print '%s\t%s' % (v, keys[v])
|