From 8dbd7eceb6a041ec0ec50cd0ebd7da80f0f45bc4 Mon Sep 17 00:00:00 2001 From: mario Date: Thu, 3 Jan 2013 21:38:08 +0100 Subject: network/cyrus-imapd: Updated for version 2.4.17. (changed download location because upstream plays hide-and-seek with the sources --ponce) Signed-off-by: Matteo Bernardini --- network/cyrus-imapd/README.SLACKWARE | 2 +- network/cyrus-imapd/cyrus-imapd.SlackBuild | 5 +- network/cyrus-imapd/cyrus-imapd.info | 6 +- .../cyrus-imapd-2.4.12-autosieve-0.6.0.patch | 179 ++++++++++++++++++++ .../cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch | 183 --------------------- 5 files changed, 186 insertions(+), 189 deletions(-) create mode 100644 network/cyrus-imapd/patches/cyrus-imapd-2.4.12-autosieve-0.6.0.patch delete mode 100644 network/cyrus-imapd/patches/cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch diff --git a/network/cyrus-imapd/README.SLACKWARE b/network/cyrus-imapd/README.SLACKWARE index 7772378a26..7fadb01925 100644 --- a/network/cyrus-imapd/README.SLACKWARE +++ b/network/cyrus-imapd/README.SLACKWARE @@ -8,7 +8,7 @@ a specific directory structure, you can do something like this: Afterwards run mkimap script to setup the enviroment: # su - cyrus -# /usr/doc/cyrus-imapd-2.4.12/tools/mkimap +# /usr/doc/cyrus-imapd-2.4.17/tools/mkimap You will probably also want to put this into rc.local: diff --git a/network/cyrus-imapd/cyrus-imapd.SlackBuild b/network/cyrus-imapd/cyrus-imapd.SlackBuild index ef1ff30876..6579042342 100644 --- a/network/cyrus-imapd/cyrus-imapd.SlackBuild +++ b/network/cyrus-imapd/cyrus-imapd.SlackBuild @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=cyrus-imapd -VERSION=${VERSION:-2.4.12} +VERSION=${VERSION:-2.4.17} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -92,7 +92,7 @@ find . \ if [ "$PATCHES" = yes ]; then # Patches for autocreate/autosieve patch -p1 <$CWD/patches/cyrus-imapd-2.4.4-autocreate-0.10-0-sv1.patch - patch -p1 <$CWD/patches/cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch + patch -p1 <$CWD/patches/cyrus-imapd-2.4.12-autosieve-0.6.0.patch fi CFLAGS="$SLKCFLAGS" \ @@ -111,6 +111,7 @@ CXXFLAGS="$SLKCFLAGS" \ --with-bdb-incdir=/usr/include/db4 \ --with-cyrus-user=cyrus \ --with-cyrus-group=cyrus \ + --enable-idled \ --build=$ARCH-slackware-linux \ $DATABASE diff --git a/network/cyrus-imapd/cyrus-imapd.info b/network/cyrus-imapd/cyrus-imapd.info index 9f6b41703c..92e6db8cfe 100644 --- a/network/cyrus-imapd/cyrus-imapd.info +++ b/network/cyrus-imapd/cyrus-imapd.info @@ -1,8 +1,8 @@ PRGNAM="cyrus-imapd" -VERSION="2.4.12" +VERSION="2.4.17" HOMEPAGE="http://www.cyrusimap.org/" -DOWNLOAD="http://cyrusimap.org/releases/cyrus-imapd-2.4.12.tar.gz" -MD5SUM="80f27401490a3dc9e422884ceee6ecf6" +DOWNLOAD="http://ponce.cc/slackware/sources/repo/cyrus-imapd-2.4.17.tar.gz" +MD5SUM="c1747c6252587535d3d27f71eca8bd44" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/cyrus-imapd/patches/cyrus-imapd-2.4.12-autosieve-0.6.0.patch b/network/cyrus-imapd/patches/cyrus-imapd-2.4.12-autosieve-0.6.0.patch new file mode 100644 index 0000000000..d3526669fc --- /dev/null +++ b/network/cyrus-imapd/patches/cyrus-imapd-2.4.12-autosieve-0.6.0.patch @@ -0,0 +1,179 @@ +--- cyrus-imapd-2.4.12.orig/README.autosievefolder 1970-01-01 01:00:00.000000000 +0100 ++++ cyrus-imapd-2.4.12/README.autosievefolder 2011-10-31 10:07:44.890693235 +0100 +@@ -0,0 +1,43 @@ ++Cyrus IMAP autosievefolder 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 ++ ++NOTE : Patch updated to Cyrus IMAPD 2.4.x by Martin Matuska ++ ++ When the lmtpd daemon receives an email message prior to delivering it to the ++INBOX folder of the user, checks if the user has specified sieve filters. If the ++user has specified sieve filters the filters are evaluated. If the message matches ++any of the filters the action that is specified in the filter is executed. If the action ++is FileInto it is stored in the subfolder specified in the filter. If the ++subfolder doesn't exist then the message is sent to the INBOX folder of the user. ++ ++ With this patch if the folder doesn't exist AND the name of the subfolder is ++specified in the autosievefolders option, OR the anysievefolder is set to ++yes in the cyrus-imap configuration file then the subfolder is created and the mail ++is stored there. ++ ++ ++Check the following options of the imapd.conf file ++================================================== ++ ++* anysievefolder : It must be "yes" in order to permit the autocreation of any ++INBOX subfolder requested by a sieve filter, through the "fileinto" action. (default = no) ++* autosievefolders : It is a "|" separated list of subfolders of INBOX that will be ++automatically created, if requested by a sieve filter, through the "fileinto" ++action. (default = null) ++ i.e. autosievefolders: Junk | Spam ++ ++WARNING: anysievefolder, takes precedence over autosievefolders . Which means that if ++anysievefolder is set to "yes", cyrus will create any INBOX subfolder requested, no-matter what the value of autosievefolders is. ++ ++ ++Things to be done ++================= ++ ++1. Support cyrus wildcards in the autosievefolders option. ++ ++ ++For more information and updates please visit http://email.uoa.gr/projects/cyrus/autosievefolder ++ +--- cyrus-imapd-2.4.12.orig/imap/lmtp_sieve.c 2011-10-31 10:07:03.922690650 +0100 ++++ cyrus-imapd-2.4.12/imap/lmtp_sieve.c 2011-10-31 10:08:36.752691723 +0100 +@@ -88,6 +88,9 @@ + struct auth_state *authstate; + } script_data_t; + ++static int autosieve_subfolder(char *userid, struct auth_state *auth_state, ++ char *subfolder, struct namespace *namespace); ++ + static char *make_sieve_db(const char *user) + { + static char buf[MAX_MAILBOX_PATH+1]; +@@ -503,7 +506,20 @@ + sd->username, mdata->notifyheader, + namebuf, md->date, quotaoverride, 0); + } +- ++ ++ if (ret == IMAP_MAILBOX_NONEXISTENT) { ++ /* if "plus" folder under INBOX, then try to create it */ ++ ret = autosieve_subfolder((char *) sd->username, sd->authstate, namebuf, mdata->namespace); ++ ++ /* Try to deliver the mail again. */ ++ if (!ret) ++ ret = deliver_mailbox(md->f, mdata->content, mdata->stage, md->size, ++ fc->imapflags->flag, fc->imapflags->nflags, ++ (char *) sd->username, sd->authstate, md->id, ++ sd->username, mdata->notifyheader, ++ namebuf, md->date, quotaoverride, 0); ++ } ++ + if (!ret) { + snmp_increment(SIEVE_FILEINTO, 1); + return SIEVE_OK; +@@ -973,3 +989,80 @@ + we'll do normal delivery */ + return r; + } ++ ++ ++#define SEP '|' ++ ++static int autosieve_subfolder(char *userid, struct auth_state *auth_state, ++ char *subfolder, struct namespace *namespace) ++{ ++ char option_name_external[MAX_MAILBOX_NAME + 1]; ++ char option_name_internal[MAX_MAILBOX_NAME + 1]; ++ const char *subf ; ++ char *p, *q, *next_subf; ++ int len, r = 0; ++ int createsievefolder = 0; ++ ++ /* Check if subfolder or userid are NULL */ ++ if(userid == NULL || subfolder == NULL) ++ return IMAP_MAILBOX_NONEXISTENT; ++ ++ syslog(LOG_DEBUG, "autosievefolder: autosieve_subfolder() was called for user %s, folder %s", ++ userid, subfolder); ++ ++ if (config_getswitch(IMAPOPT_ANYSIEVEFOLDER)) { ++ createsievefolder = 1; ++ } else if ((subf = config_getstring(IMAPOPT_AUTOSIEVEFOLDERS)) != NULL) { ++ /* Roll through subf */ ++ next_subf = (char *) subf; ++ while (*next_subf) { ++ for (p = next_subf ; isspace((int) *p) || *p == SEP ; p++); ++ for (next_subf = p ; *next_subf && *next_subf != SEP ; next_subf++); ++ for (q = next_subf ; q > p && (isspace((int) *q) || *q == SEP || !*q); q--); ++ ++ if (!*p) continue; ++ ++ len = q - p + 1; ++ /* ++ * This is a preliminary length check based on the assumption ++ * that the *final* internal format will be something ++ * like user.userid.subfolder(s). ++ */ ++ if (len > sizeof(option_name_external) - strlen(userid) - 5) ++ return IMAP_MAILBOX_BADNAME; ++ ++ strlcpy(option_name_external, namespace->prefix[NAMESPACE_INBOX], sizeof(option_name_external)); ++ strncat(option_name_external, p, len); ++ ++ /* ++ * Transform the option folder name to internal namespace and compare it ++ * with what must be created. ++ */ ++ r = namespace->mboxname_tointernal(namespace, option_name_external, userid, option_name_internal); ++ if (r) continue; ++ ++ if (!strcmp(option_name_internal, subfolder)) { ++ createsievefolder = 1; ++ break; ++ } ++ } ++ } ++ ++ if (createsievefolder) { ++ /* Folder is already in internal namespace format */ ++ r = mboxlist_createmailbox(subfolder, 0, NULL, ++ 1, userid, auth_state, 0, 0, 0); ++ if (!r) { ++ mboxlist_changesub(subfolder, userid, auth_state, 1, 1); ++ syslog(LOG_DEBUG, "autosievefolder: User %s, folder %s creation succeeded", ++ userid, subfolder); ++ return 0; ++ } else { ++ syslog(LOG_ERR, "autosievefolder: User %s, folder %s creation failed. %s", ++ userid, subfolder,error_message(r)); ++ return r; ++ } ++ } else ++ return IMAP_MAILBOX_NONEXISTENT; ++} ++ +--- cyrus-imapd-2.4.12.orig/lib/imapoptions 2011-10-31 10:07:03.969690694 +0100 ++++ cyrus-imapd-2.4.12/lib/imapoptions 2011-10-31 10:13:23.876700183 +0100 +@@ -1145,6 +1145,15 @@ + /* If enabled, lmtpd will look for Sieve scripts in user's home + directories: ~user/.sieve. */ + ++{ "anysievefolder", 0, SWITCH } ++/* It must be "yes" in order to permit the autocreation of any INBOX subfolder ++ requested by a sieve filter, through the "fileinto" action. (default = no) */ ++ ++{ "autosievefolders", NULL, STRING } ++/* It is a "|" separated list of subfolders of INBOX that will be automatically created, ++ if requested by a sieve filter, through the "fileinto" action. (default = null) ++ i.e. autosievefolders: Junk | Spam */ ++ + { "singleinstancestore", 1, SWITCH } + /* If enabled, imapd, lmtpd and nntpd attempt to only write one copy + of a message per partition and create hard links, resulting in a diff --git a/network/cyrus-imapd/patches/cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch b/network/cyrus-imapd/patches/cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch deleted file mode 100644 index 6168d224a3..0000000000 --- a/network/cyrus-imapd/patches/cyrus-imapd-2.4.4-autosieve-0.6.0-sv1.patch +++ /dev/null @@ -1,183 +0,0 @@ -# Added md->date in deliver_mailbox function for Cyrus 2.4.12 by mario@slackverse.org, 2011 -diff -Naur cyrus-imapd-2.4.4.orig/README.autosievefolder cyrus-imapd-2.4.4/README.autosievefolder ---- cyrus-imapd-2.4.4.orig/README.autosievefolder 1970-01-01 01:00:00.000000000 +0100 -+++ cyrus-imapd-2.4.4/README.autosievefolder 2010-11-15 10:40:56.299163485 +0100 -@@ -0,0 +1,43 @@ -+Cyrus IMAP autosievefolder 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 -+ -+NOTE : Patch updated to Cyrus IMAPD 2.4.x by Martin Matuska -+ -+ When the lmtpd daemon receives an email message prior to delivering it to the -+INBOX folder of the user, checks if the user has specified sieve filters. If the -+user has specified sieve filters the filters are evaluated. If the message matches -+any of the filters the action that is specified in the filter is executed. If the action -+is FileInto it is stored in the subfolder specified in the filter. If the -+subfolder doesn't exist then the message is sent to the INBOX folder of the user. -+ -+ With this patch if the folder doesn't exist AND the name of the subfolder is -+specified in the autosievefolders option, OR the anysievefolder is set to -+yes in the cyrus-imap configuration file then the subfolder is created and the mail -+is stored there. -+ -+ -+Check the following options of the imapd.conf file -+================================================== -+ -+* anysievefolder : It must be "yes" in order to permit the autocreation of any -+INBOX subfolder requested by a sieve filter, through the "fileinto" action. (default = no) -+* autosievefolders : It is a "|" separated list of subfolders of INBOX that will be -+automatically created, if requested by a sieve filter, through the "fileinto" -+action. (default = null) -+ i.e. autosievefolders: Junk | Spam -+ -+WARNING: anysievefolder, takes precedence over autosievefolders . Which means that if -+anysievefolder is set to "yes", cyrus will create any INBOX subfolder requested, no-matter what the value of autosievefolders is. -+ -+ -+Things to be done -+================= -+ -+1. Support cyrus wildcards in the autosievefolders option. -+ -+ -+For more information and updates please visit http://email.uoa.gr/projects/cyrus/autosievefolder -+ -diff -Naur cyrus-imapd-2.4.4.orig/imap/lmtp_sieve.c cyrus-imapd-2.4.4/imap/lmtp_sieve.c ---- cyrus-imapd-2.4.4.orig/imap/lmtp_sieve.c 2010-11-11 23:15:33.000000000 +0100 -+++ cyrus-imapd-2.4.4/imap/lmtp_sieve.c 2010-11-15 10:40:13.127210740 +0100 -@@ -88,6 +88,9 @@ - struct auth_state *authstate; - } script_data_t; - -+static int autosieve_subfolder(char *userid, struct auth_state *auth_state, -+ char *subfolder, struct namespace *namespace); -+ - static char *make_sieve_db(const char *user) - { - static char buf[MAX_MAILBOX_PATH+1]; -@@ -496,7 +499,20 @@ - sd->username, mdata->notifyheader, - namebuf, quotaoverride, 0); - } -- -+ -+ if (ret == IMAP_MAILBOX_NONEXISTENT) { -+ /* if "plus" folder under INBOX, then try to create it */ -+ ret = autosieve_subfolder((char *) sd->username, sd->authstate, namebuf, mdata->namespace); -+ -+ /* Try to deliver the mail again. */ -+ if (!ret) -+ ret = deliver_mailbox(md->f, mdata->content, mdata->stage, md->size, -+ fc->imapflags->flag, fc->imapflags->nflags, -+ (char *) sd->username, sd->authstate, md->id, -+ sd->username, mdata->notifyheader, -+ namebuf, md->date, quotaoverride, 0); -+ } -+ - if (!ret) { - snmp_increment(SIEVE_FILEINTO, 1); - return SIEVE_OK; -@@ -947,3 +963,80 @@ - we'll do normal delivery */ - return r; - } -+ -+ -+#define SEP '|' -+ -+static int autosieve_subfolder(char *userid, struct auth_state *auth_state, -+ char *subfolder, struct namespace *namespace) -+{ -+ char option_name_external[MAX_MAILBOX_NAME + 1]; -+ char option_name_internal[MAX_MAILBOX_NAME + 1]; -+ const char *subf ; -+ char *p, *q, *next_subf; -+ int len, r = 0; -+ int createsievefolder = 0; -+ -+ /* Check if subfolder or userid are NULL */ -+ if(userid == NULL || subfolder == NULL) -+ return IMAP_MAILBOX_NONEXISTENT; -+ -+ syslog(LOG_DEBUG, "autosievefolder: autosieve_subfolder() was called for user %s, folder %s", -+ userid, subfolder); -+ -+ if (config_getswitch(IMAPOPT_ANYSIEVEFOLDER)) { -+ createsievefolder = 1; -+ } else if ((subf = config_getstring(IMAPOPT_AUTOSIEVEFOLDERS)) != NULL) { -+ /* Roll through subf */ -+ next_subf = (char *) subf; -+ while (*next_subf) { -+ for (p = next_subf ; isspace((int) *p) || *p == SEP ; p++); -+ for (next_subf = p ; *next_subf && *next_subf != SEP ; next_subf++); -+ for (q = next_subf ; q > p && (isspace((int) *q) || *q == SEP || !*q); q--); -+ -+ if (!*p) continue; -+ -+ len = q - p + 1; -+ /* -+ * This is a preliminary length check based on the assumption -+ * that the *final* internal format will be something -+ * like user.userid.subfolder(s). -+ */ -+ if (len > sizeof(option_name_external) - strlen(userid) - 5) -+ return IMAP_MAILBOX_BADNAME; -+ -+ strlcpy(option_name_external, namespace->prefix[NAMESPACE_INBOX], sizeof(option_name_external)); -+ strncat(option_name_external, p, len); -+ -+ /* -+ * Transform the option folder name to internal namespace and compare it -+ * with what must be created. -+ */ -+ r = namespace->mboxname_tointernal(namespace, option_name_external, userid, option_name_internal); -+ if (r) continue; -+ -+ if (!strcmp(option_name_internal, subfolder)) { -+ createsievefolder = 1; -+ break; -+ } -+ } -+ } -+ -+ if (createsievefolder) { -+ /* Folder is already in internal namespace format */ -+ r = mboxlist_createmailbox(subfolder, 0, NULL, -+ 1, userid, auth_state, 0, 0, 0); -+ if (!r) { -+ mboxlist_changesub(subfolder, userid, auth_state, 1, 1); -+ syslog(LOG_DEBUG, "autosievefolder: User %s, folder %s creation succeeded", -+ userid, subfolder); -+ return 0; -+ } else { -+ syslog(LOG_ERR, "autosievefolder: User %s, folder %s creation failed. %s", -+ userid, subfolder,error_message(r)); -+ return r; -+ } -+ } else -+ return IMAP_MAILBOX_NONEXISTENT; -+} -+ -diff -Naur cyrus-imapd-2.4.4.orig/lib/imapoptions cyrus-imapd-2.4.4/lib/imapoptions ---- cyrus-imapd-2.4.4.orig/lib/imapoptions 2010-11-11 23:15:33.000000000 +0100 -+++ cyrus-imapd-2.4.4/lib/imapoptions 2010-11-15 10:40:13.129220481 +0100 -@@ -1096,6 +1096,15 @@ - /* If enabled, lmtpd will look for Sieve scripts in user's home - directories: ~user/.sieve. */ - -+{ "anysievefolder", 0, SWITCH } -+/* It must be "yes" in order to permit the autocreation of any INBOX subfolder -+ requested by a sieve filter, through the "fileinto" action. (default = no) */ -+ -+{ "autosievefolders", NULL, STRING } -+/* It is a "|" separated list of subfolders of INBOX that will be automatically created, -+ if requested by a sieve filter, through the "fileinto" action. (default = null) -+ i.e. autosievefolders: Junk | Spam */ -+ - { "singleinstancestore", 1, SWITCH } - /* If enabled, imapd, lmtpd and nntpd attempt to only write one copy - of a message per partition and create hard links, resulting in a -- cgit v1.2.3