commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-3.1.1-56-g0648035


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-3.1.1-56-g0648035
Date: Thu, 26 Jan 2017 10:45:14 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=0648035219293c028b88b5bcb0c08b5c0d541e4e

The branch, master has been updated
       via  0648035219293c028b88b5bcb0c08b5c0d541e4e (commit)
       via  24a868b2f1158ef2ae82f9d342b0039226a761a3 (commit)
      from  014c99be6f811a0e099f3c0013a0a0bcc6316a1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0648035219293c028b88b5bcb0c08b5c0d541e4e
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Jan 26 12:40:51 2017 +0200

    Improve description of variables useful in namespace directory statements

commit 24a868b2f1158ef2ae82f9d342b0039226a761a3
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Jan 26 11:47:13 2017 +0200

    Minor fix.
    
    * imap4d/list.c (list_ref): Use mu_imap_wildmatch_ci to check for
    a request matching INBOX.
    * include/mailutils/imaputil.h (mu_imap_wildmatch_ci): New prototype.
    * libmailutils/imapio/wildmatch.c (mu_imap_wildmatch_ci): New function.

-----------------------------------------------------------------------

Summary of changes:
 doc/texinfo/programs.texi       |   60 +++++++++++++++++++++++++++++++++++----
 imap4d/list.c                   |    3 +-
 include/mailutils/imaputil.h    |    3 +-
 libmailutils/imapio/wildmatch.c |   19 +++++++++----
 4 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/doc/texinfo/programs.texi b/doc/texinfo/programs.texi
index e27f6e0..58f8184 100644
--- a/doc/texinfo/programs.texi
+++ b/doc/texinfo/programs.texi
@@ -7591,9 +7591,9 @@ be run either as a standalone program or from 
@file{inetd.conf} file.
 @cindex IMAP4 namespace
 
 GNU @command{imap4d} supports a notion of @dfn{namespaces} defined
-in RFC 2342.  A namespace can be regarded as a list of triplets,
+in RFC 2342.  A namespace can be regarded as a list of entities,
 defining locations to which the user has certain access rights.  Each
-triplet defines the @dfn{prefix}, under which the mailboxes can be
+entity includes the @dfn{prefix}, under which the mailboxes can be
 found, @dfn{hierarchy delimiter}, a character used to delimit parts of
 a path to a mailbox, and a @dfn{directory} on the file system on the
 server, which actually holds the mailboxes.  Among these three values,
@@ -7679,8 +7679,17 @@ determines their mappings to the server's file system.  
The @var{pfx}
 argument defines the prefix which will be visible to the IMAP client.
 
 The @code{directory} statement defines the directory in the file
-system to which @var{pfx} is mapped.  Its argument can contain
-references to the following variables(@pxref{Variables}):
+system to which @var{pfx} is mapped.  Exactly one @code{directory}
+statement must be present in each @code{prefix} block.  The
+inerpretation of its argument depends on the namespace in which it
+occurs.
+
+When used in the @samp{namespace shared} block, the argument to this
+statement is interpreted verbatim, as an absolute pathname.
+
+When used in @samp{namespace personal} the argument to 
address@hidden statement can contain references to the following
+variables (@pxref{Variables}):
 
 @table @asis
 @item user
@@ -7690,8 +7699,47 @@ Login name of the user.
 Home directory of the user.
 @end table
 
-Exactly one @code{directory} statement must be present in each
address@hidden block.
+For example, the following statement maps the default personal
+namespace to the directory @samp{imap} in the user's home directory:
+
address@hidden
address@hidden
+namespace personal @{
+  prefix "";
+  directory "$home/imap";
address@hidden
address@hidden group
address@hidden example
+
+If the @samp{directory} statement is used within the @samp{namespace
+other} block, its value can contain the @samp{$user} and
address@hidden variables as well, but their meaning is different.  For
+the @samp{other} namespace, the @samp{$user} variable is expanded
+to the part of the actual reference contained between the prefix and
+first hierarchy delimiter (or the end of the reference, if no
+delimiter occurs to the right of the prefix).  Correspondingly,
address@hidden expands to the home directory of that user.  Consider,
+for example, the following statement:
+
address@hidden
address@hidden
+namespace other @{
+  prefix "~";
+  directory "/var/imap/$user";
address@hidden  
address@hidden group
address@hidden example
+
+If the client issues the following statement:
+
address@hidden
+1 LIST "~smith" "%"
address@hidden example
+
address@hidden
+then @samp{$user} will expand to the string @samp{smith} and the
+server will look for all mailboxes in the directory 
address@hidden/var/imap/smith}.
 
 The @code{delimiter} statement defines the folder hierarchy delimiter
 for that prefix.  It is optional, the default value being @samp{"/"}.
diff --git a/imap4d/list.c b/imap4d/list.c
index 2a4e072..069804b 100644
--- a/imap4d/list.c
+++ b/imap4d/list.c
@@ -171,8 +171,7 @@ list_ref (char const *ref, char const *wcard, char const 
*cwd,
      on this or some other server. */
   
   if (!*ref &&
-      (mu_imap_wildmatch (wcard, "INBOX", MU_HIERARCHY_DELIMITER) == 0
-       || mu_imap_wildmatch (wcard, "inbox", MU_HIERARCHY_DELIMITER) == 0))
+      mu_imap_wildmatch_ci (wcard, "INBOX", MU_HIERARCHY_DELIMITER) == 0)
     io_untagged_response (RESP_NONE, "LIST (\\NoInferiors) NIL INBOX");
   
   mu_folder_enumerate (folder, NULL, (void*) wcard, 0, 0, NULL,
diff --git a/include/mailutils/imaputil.h b/include/mailutils/imaputil.h
index d22c7ec..5183529 100644
--- a/include/mailutils/imaputil.h
+++ b/include/mailutils/imaputil.h
@@ -24,9 +24,10 @@ extern "C" {
 # include <mailutils/types.h>
 
 int mu_imap_wildmatch (const char *pattern, const char *name, int delim);
+int mu_imap_wildmatch_ci (const char *pattern, const char *name, int delim);
 
 int mu_imap_flag_to_attribute (const char *item, int *attr);
-  int mu_imap_format_flags (mu_stream_t str, int flags, int include_recent);
+int mu_imap_format_flags (mu_stream_t str, int flags, int include_recent);
 
 #ifdef __cplusplus
 }
diff --git a/libmailutils/imapio/wildmatch.c b/libmailutils/imapio/wildmatch.c
index 4df81ff..6fff66c 100644
--- a/libmailutils/imapio/wildmatch.c
+++ b/libmailutils/imapio/wildmatch.c
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <mailutils/types.h>
 #include <mailutils/imaputil.h>
+#include <mailutils/cctype.h>
 
 /* Match STRING against the IMAP4 wildcard pattern PATTERN. */
 
@@ -26,7 +27,7 @@
 #define WILD_ABORT 2
 
 int
-_wild_match (const char *pat, const char *name, char delim)
+_wild_match (const char *pat, const char *name, char delim, int icase)
 {
   while (pat && *pat)
     {
@@ -41,7 +42,7 @@ _wild_match (const char *pat, const char *name, char delim)
            return WILD_TRUE;
          while (*name)
            {
-             int res = _wild_match (pat, name++, delim);
+             int res = _wild_match (pat, name++, delim, icase);
              if (res != WILD_FALSE)
                return res;
            }
@@ -54,14 +55,15 @@ _wild_match (const char *pat, const char *name, char delim)
            return strchr (name, delim) ? WILD_FALSE : WILD_TRUE;
          while (*name && *name != delim)
            {
-             int res = _wild_match (pat, name++, delim);
+             int res = _wild_match (pat, name++, delim, icase);
              if (res != WILD_FALSE)
                return res;
            }
-         return _wild_match (pat, name, delim);
+         return _wild_match (pat, name, delim, icase);
          
        default:
-         if (*pat != *name)
+         if (icase ? mu_toupper (*pat) != mu_toupper (*name)
+                   : *pat != *name)
            return WILD_FALSE;
          pat++;
          name++;
@@ -73,6 +75,11 @@ _wild_match (const char *pat, const char *name, char delim)
 int
 mu_imap_wildmatch (const char *pattern, const char *name, int delim)
 {
-  return _wild_match (pattern, name, delim) != WILD_TRUE;
+  return _wild_match (pattern, name, delim, 0) != WILD_TRUE;
 }
 
+int
+mu_imap_wildmatch_ci (const char *pattern, const char *name, int delim)
+{
+  return _wild_match (pattern, name, delim, 1) != WILD_TRUE;
+}


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]