Hello community,
here is the log from the commit of package cyrus-imapd for openSUSE:Factory
checked in at Wed Mar 31 11:03:21 CEST 2010.
--------
--- cyrus-imapd/cyrus-imapd.changes 2010-02-23 15:04:28.000000000 +0100
+++ /mounts/work_src_done/STABLE/cyrus-imapd/cyrus-imapd.changes 2010-03-30 10:34:20.000000000 +0200
@@ -1,0 +2,24 @@
+Tue Mar 30 08:33:47 UTC 2010 - rhafer(a)novell.com
+
+- Mention KOLAB_cyrus-imapd-2.3.16_cross-domain-acls.patch in the
+ spec file
+
+-------------------------------------------------------------------
+Wed Feb 24 21:07:14 UTC 2010 - rbos(a)opensuse.org
+
+- Replaced the 2.3.14 Kolab patches with their 2.3.16 equivalents
+ KOLAB_cyrus-imapd-*_Cyradm_Annotations.patch
+ KOLAB_cyrus-imapd-*_Folder-names.patch
+ KOLAB_cyrus-imapd-*_Groups2.patch
+ KOLAB_cyrus-imapd-*_Logging.patch
+ KOLAB_cyrus-imapd-*_timsieved_starttls-sendcaps.patch
+ KOLAB_cyrus-imapd-*_UID.patch
+
+- Removed the patch KOLAB_cyrus-imapd-2.3.14_Annotations2.patch as
+ this is now part of cyrus
+
+- Added patch KOLAB_cyrus-imapd-2.3.16_cross-domain-acls.patch.
+ This patch can not be directly applied, it needs to recreated
+ due to the patches applied by openSUSE.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
KOLAB_cyrus-imapd-2.3.16_cross-domain-acls.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cyrus-imapd.spec ++++++
--- /var/tmp/diff_new_pack.WwI5QL/_old 2010-03-31 10:55:59.000000000 +0200
+++ /var/tmp/diff_new_pack.WwI5QL/_new 2010-03-31 10:55:59.000000000 +0200
@@ -51,7 +51,7 @@
AutoReqProv: on
Summary: The Cyrus IMAP and POP Mail Server
Version: 2.3.16
-Release: 1
+Release: 2
Source: %{prjname}-%{version}.tar.bz2
Source1: cyrus-imapd-rc.tar.gz
# The autocreate Patchset is maintained at:
@@ -77,6 +77,8 @@
Patch104: KOLAB_cyrus-imapd-%{version}_Logging.patch
Patch105: KOLAB_cyrus-imapd-%{version}_timsieved_starttls-sendcaps.patch
Patch106: KOLAB_cyrus-imapd-%{version}_UID.patch
+# This patch does not apply cleanly currently
+Source107: KOLAB_cyrus-imapd-%{version}_cross-domain-acls.patch
%endif
PreReq: /usr/sbin/useradd /usr/sbin/usermod %insserv_prereq %fillup_prereq /bin/sed /bin/awk /bin/grep /bin/cat /usr/bin/find /usr/bin/db_verify sh-utils fileutils cyrus-sasl netcfg /usr/bin/strings
++++++ KOLAB_cyrus-imapd-2.3.16_Cyradm_Annotations.patch ++++++
--- /var/tmp/diff_new_pack.WwI5QL/_old 2010-03-31 10:55:59.000000000 +0200
+++ /var/tmp/diff_new_pack.WwI5QL/_new 2010-03-31 10:55:59.000000000 +0200
@@ -1,9 +1,9 @@
Allows to use arbitrary annotations with the cyradm tool.
-diff -r 639190be2385 doc/man/cyradm.1.html
---- a/doc/man/cyradm.1.html Mon Oct 27 18:48:18 2008 +0100
-+++ b/doc/man/cyradm.1.html Mon Oct 27 18:48:25 2008 +0100
-@@ -245,6 +245,13 @@
+diff -r 69927cac0b1b doc/man/cyradm.1.html
+--- a/doc/man/cyradm.1.html Fri Dec 04 10:32:26 2009 +0100
++++ b/doc/man/cyradm.1.html Fri Dec 04 10:32:33 2009 +0100
+@@ -220,6 +220,13 @@
<dd>
<p>Sets an email address to which messages injected into the server via NNTP
will be sent.</p>
@@ -15,11 +15,11 @@
+<p>Sets the annotation <em>/explicit/annotation</em>
+on <em>mailbox</em> to <em>value</em>.</p>
</dd>
- </li>
- <dt><strong><a name="sharedseen" class="item"><code>sharedseen</code></a></strong>
-diff -r 639190be2385 perl/imap/IMAP/Admin.pm
---- a/perl/imap/IMAP/Admin.pm Mon Oct 27 18:48:18 2008 +0100
-+++ b/perl/imap/IMAP/Admin.pm Mon Oct 27 18:48:26 2008 +0100
+ <dt><strong><a name="sharedseen" class="item"><code>sharedseen</code></a></strong></dt>
+
+diff -r 69927cac0b1b perl/imap/IMAP/Admin.pm
+--- a/perl/imap/IMAP/Admin.pm Fri Dec 04 10:32:26 2009 +0100
++++ b/perl/imap/IMAP/Admin.pm Fri Dec 04 10:32:33 2009 +0100
@@ -797,11 +797,11 @@
return undef;
}
@@ -36,9 +36,9 @@
my ($rc, $msg);
-diff -r 639190be2385 perl/imap/IMAP/Shell.pm
---- a/perl/imap/IMAP/Shell.pm Mon Oct 27 18:48:18 2008 +0100
-+++ b/perl/imap/IMAP/Shell.pm Mon Oct 27 18:48:26 2008 +0100
+diff -r 69927cac0b1b perl/imap/IMAP/Shell.pm
+--- a/perl/imap/IMAP/Shell.pm Fri Dec 04 10:32:26 2009 +0100
++++ b/perl/imap/IMAP/Shell.pm Fri Dec 04 10:32:33 2009 +0100
@@ -127,7 +127,7 @@
[\&_sc_info, '[mailbox]',
'display mailbox/server metadata'],
@@ -66,9 +66,9 @@
}
if (!$cyrref || !$$cyrref) {
die "mboxconfig: no connection to server\n";
-diff -r 639190be2385 perl/imap/cyradm.sh
---- a/perl/imap/cyradm.sh Mon Oct 27 18:48:18 2008 +0100
-+++ b/perl/imap/cyradm.sh Mon Oct 27 18:48:26 2008 +0100
+diff -r 69927cac0b1b perl/imap/cyradm.sh
+--- a/perl/imap/cyradm.sh Fri Dec 04 10:32:26 2009 +0100
++++ b/perl/imap/cyradm.sh Fri Dec 04 10:32:33 2009 +0100
@@ -241,6 +241,10 @@
Indicates that the mailbox should have a squat index created for it.
++++++ KOLAB_cyrus-imapd-2.3.16_Groups2.patch ++++++
--- /var/tmp/diff_new_pack.WwI5QL/_old 2010-03-31 10:55:59.000000000 +0200
+++ /var/tmp/diff_new_pack.WwI5QL/_new 2010-03-31 10:55:59.000000000 +0200
@@ -1,7 +1,7 @@
-diff -r 0d5aacd84718 lib/auth_unix.c
---- a/lib/auth_unix.c Mon Oct 27 18:37:49 2008 +0100
-+++ b/lib/auth_unix.c Wed Apr 01 18:19:19 2009 +0200
-@@ -46,12 +46,133 @@
+diff -r 37030bf2b2bb lib/auth_unix.c
+--- a/lib/auth_unix.c Fri Dec 04 10:25:24 2009 +0100
++++ b/lib/auth_unix.c Fri Dec 04 10:32:19 2009 +0100
+@@ -46,6 +46,7 @@
#include <stdlib.h>
#include <pwd.h>
#include <grp.h>
@@ -9,10 +9,10 @@
#include <ctype.h>
#include <string.h>
- #include "auth.h"
- #include "libcyr_cfg.h"
+@@ -54,6 +55,126 @@
#include "xmalloc.h"
-+
+ #include "util.h"
+
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+/*
+ * __getgrent.c - This file is part of the libc-8086/grp package for ELKS,
@@ -132,10 +132,11 @@
+ return __getgrent(fileno(file), line_buff, members);
+}
+#endif /* __FreeBSD__ */
-
++
struct auth_state {
char userid[81];
-@@ -140,6 +261,25 @@
+ char **group;
+@@ -141,6 +262,25 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
@@ -161,7 +162,7 @@
/*
* Convert 'identifier' into canonical form.
* Returns a pointer to a static buffer containing the canonical form
-@@ -175,7 +315,7 @@
+@@ -176,7 +316,7 @@
*/
if (!strncmp(retbuf, "group:", 6)) {
@@ -170,7 +171,7 @@
if (!grp) return NULL;
if (strlen(grp->gr_name) >= sizeof(retbuf)-6)
return NULL;
-@@ -223,11 +363,12 @@
+@@ -224,11 +364,12 @@
struct auth_state *newstate;
struct passwd *pwd;
struct group *grp;
@@ -184,7 +185,7 @@
#endif
identifier = mycanonifyid(identifier, 0);
-@@ -245,7 +386,7 @@
+@@ -246,7 +387,7 @@
pwd = getpwnam(identifier);
@@ -193,7 +194,7 @@
gid = pwd ? pwd->pw_gid : (gid_t) -1;
/* get the group ids */
-@@ -283,20 +424,23 @@
+@@ -284,20 +425,23 @@
if (groupids) free(groupids);
#else /* !HAVE_GETGROUPLIST */
++++++ KOLAB_cyrus-imapd-2.3.16_Logging.patch ++++++
--- /var/tmp/diff_new_pack.WwI5QL/_old 2010-03-31 10:55:59.000000000 +0200
+++ /var/tmp/diff_new_pack.WwI5QL/_new 2010-03-31 10:55:59.000000000 +0200
@@ -1,53 +1,34 @@
Provides improved logging for the cyrus imapd server [Version: 2.3.9]
-diff -r 6162fc947b22 imap/append.c
---- a/imap/append.c Tue Dec 11 11:22:03 2007 +0100
-+++ b/imap/append.c Tue Dec 11 11:22:13 2007 +0100
-@@ -648,6 +648,9 @@ int append_fromstage(struct appendstate
-
+diff -r e17e42827afc imap/append.c
+--- a/imap/append.c Wed Dec 23 20:17:41 2009 +0100
++++ b/imap/append.c Wed Dec 23 20:49:56 2009 +0100
+@@ -654,6 +654,9 @@
/* ok, we've successfully added a message */
as->quota_used += message_index.size;
-+
+
+ syslog(LOG_DEBUG, "append_fromstage: message %d added to %s",
+ message_index.uid, mailbox->name );
-
++
return 0;
}
-diff -r 6162fc947b22 imap/imapd.c
---- a/imap/imapd.c Tue Dec 11 11:22:03 2007 +0100
-+++ b/imap/imapd.c Tue Dec 11 11:22:13 2007 +0100
-@@ -3509,17 +3509,19 @@ void cmd_close(char *tag)
- if (!r) sync_log_mailbox(imapd_mailbox->name);
- }
-+ if (r) {
-+ prot_printf(imapd_out, "%s NO %s\r\n", tag, error_message(r));
-+ }
-+ else {
-+ prot_printf(imapd_out, "%s OK %s\r\n", tag,
-+ error_message(IMAP_OK_COMPLETED));
-+ syslog(LOG_DEBUG, "cmd_expunge: user %s, mailbox %s, sequence %s",
-+ imapd_userid, imapd_mailbox->name, "''");
-+ }
-+
- index_closemailbox(imapd_mailbox);
- mailbox_close(imapd_mailbox);
- imapd_mailbox = 0;
--
-- if (r) {
-- prot_printf(imapd_out, "%s NO %s\r\n", tag, error_message(r));
-- }
-- else {
-- prot_printf(imapd_out, "%s OK %s\r\n", tag,
-- error_message(IMAP_OK_COMPLETED));
-- }
- }
+diff -r e17e42827afc imap/imapd.c
+--- a/imap/imapd.c Wed Dec 23 20:17:41 2009 +0100
++++ b/imap/imapd.c Wed Dec 23 20:49:56 2009 +0100
+@@ -3638,6 +3638,8 @@
+ if ((cmd[0] == 'C') && (imapd_mailbox->myrights & ACL_EXPUNGE)) {
+ if (!mailbox_expunge(imapd_mailbox, NULL, NULL, 0)) {
+ sync_log_mailbox(imapd_mailbox->name);
++ syslog(LOG_DEBUG, "cmd_expunge: user %s, mailbox %s, sequence %s",
++ imapd_userid, imapd_mailbox->name, "''");
+ }
+ }
- /*
-diff -r 6162fc947b22 imap/mailbox.c
---- a/imap/mailbox.c Tue Dec 11 11:22:03 2007 +0100
-+++ b/imap/mailbox.c Tue Dec 11 11:22:13 2007 +0100
-@@ -2520,6 +2520,8 @@ int mailbox_expunge(struct mailbox *mail
+diff -r e17e42827afc imap/mailbox.c
+--- a/imap/mailbox.c Wed Dec 23 20:17:41 2009 +0100
++++ b/imap/mailbox.c Wed Dec 23 20:49:56 2009 +0100
+@@ -2575,6 +2575,8 @@
*(fname->tail)++ = '/';
fname->len++;
for (msgno = 0; msgno < numdeleted; msgno++) {
++++++ KOLAB_cyrus-imapd-2.3.16_cross-domain-acls.patch ++++++
diff -ur cyrus-imapd-2.3.16/imap/mboxlist.c cyrus-imapd-2.3.16.new/imap/mboxlist.c
--- cyrus-imapd-2.3.16/imap/mboxlist.c 2010-02-23 23:08:28.210817472 +0000
+++ cyrus-imapd-2.3.16.new/imap/mboxlist.c 2010-02-23 23:16:40.008872697 +0000
@@ -1618,7 +1618,7 @@
except for "anonymous", "anyone", the global admin
and users in the default domain */
if ((cp = strchr(identifier, '@'))) {
- if (rights &&
+ if (!config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) && rights &&
((domain && strncasecmp(cp+1, domain, strlen(cp+1))) ||
(!domain && (!config_defdomain ||
strcasecmp(config_defdomain, cp+1))))) {
@@ -1960,6 +1960,7 @@
int usermboxnamelen;
int checkmboxlist;
int checkshared;
+ int crossdomain;
int isadmin;
struct auth_state *auth_state;
int (*proc)(char *, int, int, void *rock);
@@ -1977,7 +1978,9 @@
long matchlen;
/* don't list mailboxes outside of the default domain */
- if (!rock->domainlen && !rock->isadmin && memchr(key, '!', keylen)) return 0;
+ if (!rock->domainlen && !rock->isadmin && memchr(key, '!', keylen) &&
+ !config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS))
+ return 0;
minmatch = 0;
if (rock->inboxoffset) {
@@ -2150,6 +2153,23 @@
}
rock->checkshared = 0;
+
+ if (rock->find_namespace == NAMESPACE_USER &&
+ config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) && !rock->isadmin &&
+ !rock->crossdomain) {
+ char *cp = strchr(namebuf+rock->inboxoffset, '!');
+ if (cp) {
+ int local_matchlen = (matchlen - 1 -
+ (cp - (namebuf+rock->inboxoffset)));
+ if (!strncmp(cp + 1, "user", local_matchlen)) {
+ r = (*rock->proc)(cp + 1, local_matchlen, 1,
+ rock->procrock);
+ return CYRUSDB_DONE;
+ }
+ }
+ }
+
+
r = (*rock->proc)(namebuf+rock->inboxoffset, matchlen,
1, rock->procrock);
@@ -2170,6 +2190,91 @@
return r;
}
+
+static void convert_cross_domain_pattern(char *domainpat, int domainpatlen,
+ char **converted_pattern,
+ const char *pattern, int *crossdomainmatch,
+ const char *domain)
+{
+ int patternlen = strlen(pattern);
+ char *domain_pattern, *local_dest;
+ char *local_pattern, *domain_dest;
+ int local_prefix_len;
+ const char *src;
+ int c;
+
+ domain_dest = domain_pattern = xmalloc(patternlen + 1);
+ local_dest = local_pattern = xmalloc(patternlen + 1);
+ src = pattern;
+
+ while ((c = *src++)) {
+ *local_dest++ = c;
+ if (c == '.' || c == '*')
+ break;
+ }
+
+ local_prefix_len = local_dest - local_pattern;
+ if (c && c != '.')
+ local_prefix_len -= 1;
+ if (strncmp(pattern, "user.", local_prefix_len) == 0) {
+ /* pattern matches "user.*". so convert the domain part of the
+ * pattern */
+
+ if (c == '*') {
+ /* the pattern can match any domain */
+ *domain_dest++ = '*';
+ }
+ else if (c == '.') {
+ while ((c = *src++)) {
+ if (c == '.')
+ break;
+ if (c == '^')
+ c = '.';
+ *domain_dest++ = (c == '%' ? '*' : c);
+ if (c == '*')
+ break;
+ }
+
+ if (c == '*') {
+ *local_dest++ = '*';
+ }
+ }
+
+ if (c) {
+ strcpy(local_dest, src);
+ }
+ else {
+ if (local_dest > local_pattern) {
+ if (local_dest[-1] == '.') {
+ local_dest--;
+ }
+ }
+ *local_dest = 0;
+ }
+
+ if (domain_dest == domain_pattern) {
+ *domain_dest++ = '*';
+ }
+ *domain_dest++ = '!';
+ *domain_dest = 0;
+
+ strncpy(domainpat, domain_pattern, domainpatlen);
+ domainpat[domainpatlen - 1] = 0;
+ strncat(domainpat, local_pattern, domainpatlen - strlen(domainpat) - 1);
+
+ *converted_pattern = xstrdup(local_pattern);
+ *crossdomainmatch = 1;
+ }
+ else {
+ /* pattern doesn't contain an explicit domain part */
+ snprintf(domainpat, domainpatlen, "*!%s", pattern);
+ *crossdomainmatch = 0;
+ }
+
+ free(domain_pattern);
+ free(local_pattern);
+}
+
/*
* Find all mailboxes that match 'pattern'.
* 'isadmin' is nonzero if user is a mailbox admin. 'userid'
@@ -2193,8 +2298,11 @@
char *p;
int prefixlen;
int userlen = userid ? strlen(userid) : 0, domainlen = 0;
+ int domainpat_prefixlen = 0;
char domainpat[MAX_MAILBOX_BUFFER] = ""; /* do intra-domain fetches only */
char *pat = NULL;
+ char *converted_pattern = NULL;
+ int crossdomainmatch = 0;
if (config_virtdomains) {
char *domain;
@@ -2204,8 +2312,10 @@
domainlen = strlen(domain); /* includes separator */
if ((p = strchr(pattern , '!'))) {
- if ((p-pattern != domainlen-1) ||
- strncmp(pattern, domain+1, domainlen-1)) {
+ if (!(config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) &&
+ !isadmin) &&
+ ((p-pattern != domainlen-1) ||
+ strncmp(pattern, domain+1, domainlen-1))) {
/* don't allow cross-domain access */
return IMAP_MAILBOX_BADNAME;
}
@@ -2213,7 +2323,16 @@
pattern = p+1;
}
- snprintf(domainpat, sizeof(domainpat), "%s!%s", domain+1, pattern);
+ if (!(config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) && !isadmin)) {
+ snprintf(domainpat, sizeof(domainpat), "%s!%s", domain+1, pattern);
+ }
+ else {
+ convert_cross_domain_pattern(domainpat, sizeof(domainpat),
+ &converted_pattern, pattern,
+ &crossdomainmatch, domain + 1);
+ if (converted_pattern)
+ pattern = converted_pattern;
+ }
}
if ((p = strrchr(pattern, '@'))) {
/* global admin specified mbox@domain */
@@ -2243,6 +2362,7 @@
cbrock.auth_state = auth_state;
cbrock.checkmboxlist = 0; /* don't duplicate work */
cbrock.checkshared = 0;
+ cbrock.crossdomain = 0;
cbrock.proc = proc;
cbrock.procrock = rock;
@@ -2302,6 +2422,12 @@
prefixlen = p - pattern;
*p = '\0';
+ /* Find fixed-string domain pattern prefix */
+ for (p = domainpat; *p; p++) {
+ if (*p == '*' || *p == '%' || *p == '?' || *p == '@') break;
+ }
+ domainpat_prefixlen = p - domainpat;
+
/*
* If user.X.* or INBOX.* can match pattern,
* search for those mailboxes next
@@ -2334,6 +2460,7 @@
glob_free(&cbrock.g);
cbrock.g = glob_init(domainpat, GLOB_HIERARCHY);
cbrock.inboxoffset = 0;
+ cbrock.crossdomain = crossdomainmatch;
if (usermboxnamelen) {
usermboxname[--usermboxnamelen] = '\0';
cbrock.usermboxname = usermboxname;
@@ -2343,7 +2470,7 @@
just bother looking at the ones that have the same pattern
prefix. */
r = DB->foreach(mbdb,
- domainpat, domainlen + prefixlen,
+ domainpat, domainpat_prefixlen,
&find_p, &find_cb, &cbrock,
NULL);
}
@@ -2352,6 +2479,7 @@
done:
glob_free(&cbrock.g);
if (pat) free(pat);
+ if (converted_pattern) free(converted_pattern);
return r;
}
@@ -2389,6 +2517,7 @@
cbrock.auth_state = auth_state;
cbrock.checkmboxlist = 0; /* don't duplicate work */
cbrock.checkshared = 0;
+ cbrock.crossdomain = 0;
cbrock.proc = proc;
cbrock.procrock = rock;
@@ -3029,6 +3158,7 @@
cbrock.auth_state = auth_state;
cbrock.checkmboxlist = !force;
cbrock.checkshared = 0;
+ cbrock.crossdomain = 0;
cbrock.proc = proc;
cbrock.procrock = rock;
@@ -3180,6 +3310,7 @@
cbrock.auth_state = auth_state;
cbrock.checkmboxlist = !force;
cbrock.checkshared = 0;
+ cbrock.crossdomain = 0;
cbrock.proc = proc;
cbrock.procrock = rock;
Only in cyrus-imapd-2.3.16.new/imap: mboxlist.c.orig
diff -ur cyrus-imapd-2.3.16/imap/mboxname.c cyrus-imapd-2.3.16.new/imap/mboxname.c
--- cyrus-imapd-2.3.16/imap/mboxname.c 2009-11-10 04:16:46.000000000 +0000
+++ cyrus-imapd-2.3.16.new/imap/mboxname.c 2010-02-23 23:16:40.009869896 +0000
@@ -113,6 +113,8 @@
char *cp;
char *atp;
int userlen, domainlen = 0, namelen;
+ int name_has_domain = 0;
+ const char *name_local_part = NULL;
/* Blank the result, just in case */
result[0] = '\0';
@@ -163,6 +165,18 @@
}
}
+ if (config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) &&
+ !namespace->isadmin &&
+ !strncmp(name, "user", 4) && name[4] == namespace->hier_sep) {
+ name_local_part = strchr(name + 5, namespace->hier_sep);
+ if (!name_local_part) {
+ name_local_part = name + strlen(name);
+ }
+ domainlen = name_local_part - (name + 5) + 1;
+ sprintf(result, "%.*s!", domainlen - 1, name + 5);
+ name_has_domain = 1;
+ }
+
/* if no domain specified, we're in the default domain */
}
@@ -193,7 +207,13 @@
if (domainlen+namelen > MAX_MAILBOX_NAME) {
return IMAP_MAILBOX_BADNAME;
}
- sprintf(result, "%.*s", namelen, name);
+
+ if (name_has_domain) {
+ sprintf(result, "user%s", name_local_part ? name_local_part : "");
+ }
+ else {
+ sprintf(result, "%.*s", namelen, name);
+ }
/* Translate any separators in mailboxname */
mboxname_hiersep_tointernal(namespace, result, 0);
@@ -356,6 +376,7 @@
{
char *domain = NULL, *cp;
size_t domainlen = 0, resultlen;
+ int append_domain = 1;
/* Blank the result, just in case */
result[0] = '\0';
@@ -370,18 +391,29 @@
/* don't use the domain if it matches the user's domain */
if (userid && (cp = strchr(userid, '@')) &&
(strlen(++cp) == domainlen) && !strncmp(domain, cp, domainlen))
- domain = NULL;
+ append_domain = 0;
}
- strcpy(result, name);
-
- /* Translate any separators in mailboxname */
- mboxname_hiersep_toexternal(namespace, result, 0);
+ if (config_getswitch(IMAPOPT_ALLOWCROSSDOMAINACLS) && !namespace->isadmin
+ && domain && !strncmp(name, "user", 4) &&
+ (name[4] == 0 || name[4] == '.')) {
+ sprintf(result, "user%c%.*s", namespace->hier_sep, domainlen, domain);
+ if (name[4] != 0)
+ sprintf(result + domainlen + 5, "%c%s", namespace->hier_sep,
+ name + 5);
+ mboxname_hiersep_toexternal(namespace, result + domainlen + 6, 0);
+ append_domain = 0;
+ }
+ else {
+ strcpy(result, name);
+ /* Translate any separators in mailboxname */
+ mboxname_hiersep_toexternal(namespace, result, 0);
+ }
resultlen = strlen(result);
/* Append domain */
- if (domain) {
+ if (domain && append_domain) {
if(resultlen+domainlen+1 > MAX_MAILBOX_NAME)
return IMAP_MAILBOX_BADNAME;
Only in cyrus-imapd-2.3.16.new/imap: mboxname.c.orig
diff -ur cyrus-imapd-2.3.16/lib/imapoptions cyrus-imapd-2.3.16.new/lib/imapoptions
--- cyrus-imapd-2.3.16/lib/imapoptions 2010-02-23 23:08:28.222930032 +0000
+++ cyrus-imapd-2.3.16.new/lib/imapoptions 2010-02-23 23:16:40.010875442 +0000
@@ -1283,6 +1283,9 @@
/* Send mail to mailboxes, which do not exists, to this user. NOTE: This must
be an existing local mailbox name. NOT an email address! */
+{ "allowcrossdomainacls", 0, SWITCH }
+/* Allow ACL across domain boundaries. */
+
/*
.SH SEE ALSO
.PP
Only in cyrus-imapd-2.3.16.new/lib: imapoptions.orig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org