summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-12-19 14:23:07 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-12-19 14:23:07 +0000
commit6d490ce129c98caddf5db5601094497a375f47e7 (patch)
treea45e387037d549bce635947655afd2fb993f8db9
parent5a30e7b27c8d51e1e8177205ea8b484b2b6c35a2 (diff)
downloadmailutils-6d490ce129c98caddf5db5601094497a375f47e7.tar.gz
mailutils-6d490ce129c98caddf5db5601094497a375f47e7.tar.bz2
* NEWS: Update.
* configure.ac (MU_LIB_REMOTE): New substitution variable. (AC_CONFIG_FILES): Add libproto/remote/Makefile. * imap4d/copy.c, imap4d/create.c, imap4d/delete.c, imap4d/fetch.c, imap4d/imap4d.c, imap4d/list.c, imap4d/lsub.c, imap4d/rename.c, imap4d/subscribe.c, imap4d/unsubscribe.c, imap4d/util.c: Spelling fixes. * include/mailutils/cfg.h (mu_cfg_error_count): New variable. * include/mailutils/gocs.h (struct mu_gocs_mailbox): New member mailbox_pattern * include/mailutils/libargp.h (mu_rcfile_lint): New variable. * include/mailutils/mailbox.h (mu_set_mailbox_pattern): New function. (mu_mail_directory): Removed. (mu_mailbox_url): New function. * include/mailutils/mutil.h (mu_normalize_mailbox_url): Remove. * include/mailutils/registrar.h (mu_0_6_registrar_lookup): Remove. * libargp/common.c: New options --rcfile-lint and --mailbox-pattern. * libargp/muinit.c: Handle --rcfile-lint. * libcfg/common.c: New statement mailbox-pattern * libmu_scm/mu_mailbox.c (mu-mail-directory): Deprecated. (mu-user-mailbox-url): New function. * libproto/remote: New directory. * libproto/remote/folder.c: New file. * libproto/remote/mbox.c: New file. * libproto/remote/.cvsignore: New file. * libproto/Makefile.am (SUBDIRS): Add remote * libproto/mbox/folder.c, libproto/mbox/url.c: Indentation and spelling fixes. * maidag/Makefile.am (maidag_LDADD): Add MU_LIB_REMOTE. * maidag/maidag.c: Register mu_remote_mbox_record. * mailbox/cfg_parser.y (mu_cfg_error_count): New variable. (mu_cfg_format_error,_mu_cfg_vperror): Increment mu_cfg_error_count. * mailbox/debug.c (mu_debug_check_level): Do not mask out inheritance bit. * mailbox/gocs.c (mu_gocs_mailbox_init): Set mailbox pattern. * mailbox/mailbox.c (_create_mailbox): Bugfix. * mailbox/mbx_default.c (mu_set_mailbox_pattern): New finction. (mu_set_mail_directory): Rewrite. (user_mailbox_name): Rewrite. * mailbox/mutil.c (mu_normalize_mailbox_url): Remove. * mailbox/registrar.c (mu_0_6_registrar_lookup): Remove. * guimb/scm/sieve-core.scm (sieve-main): Use mu-user-mailbox-url.
-rw-r--r--ChangeLog51
-rw-r--r--NEWS26
-rw-r--r--configure.ac2
-rw-r--r--guimb/scm/sieve-core.scm4
-rw-r--r--imap4d/copy.c2
-rw-r--r--imap4d/create.c6
-rw-r--r--imap4d/delete.c4
-rw-r--r--imap4d/fetch.c2
-rw-r--r--imap4d/imap4d.c13
-rw-r--r--imap4d/list.c4
-rw-r--r--imap4d/lsub.c2
-rw-r--r--imap4d/rename.c4
-rw-r--r--imap4d/subscribe.c2
-rw-r--r--imap4d/unsubscribe.c2
-rw-r--r--imap4d/util.c2
-rw-r--r--include/mailutils/cfg.h1
-rw-r--r--include/mailutils/gocs.h1
-rw-r--r--include/mailutils/libargp.h3
-rw-r--r--include/mailutils/mailbox.h3
-rw-r--r--include/mailutils/mutil.h1
-rw-r--r--include/mailutils/registrar.h27
-rw-r--r--libargp/common.c17
-rw-r--r--libargp/muinit.c5
-rw-r--r--libcfg/common.c4
-rw-r--r--libmu_scm/mu_mailbox.c34
-rw-r--r--libproto/Makefile.am2
-rw-r--r--libproto/mbox/folder.c7
-rw-r--r--libproto/mbox/url.c2
-rw-r--r--libproto/remote/.cvsignore9
-rw-r--r--libproto/remote/Makefile.am29
-rw-r--r--libproto/remote/folder.c94
-rw-r--r--libproto/remote/mbox.c225
-rw-r--r--maidag/Makefile.am1
-rw-r--r--maidag/maidag.c8
-rw-r--r--mailbox/cfg_parser.y3
-rw-r--r--mailbox/debug.c2
-rw-r--r--mailbox/gocs.c10
-rw-r--r--mailbox/mailbox.c26
-rw-r--r--mailbox/mbx_default.c88
-rw-r--r--mailbox/mutil.c29
-rw-r--r--mailbox/registrar.c9
41 files changed, 627 insertions, 139 deletions
diff --git a/ChangeLog b/ChangeLog
index 685fa57b5..6dc577e61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,54 @@
+2007-12-19 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * NEWS: Update.
+ * configure.ac (MU_LIB_REMOTE): New substitution variable.
+ (AC_CONFIG_FILES): Add libproto/remote/Makefile.
+ * imap4d/copy.c, imap4d/create.c, imap4d/delete.c, imap4d/fetch.c,
+ imap4d/imap4d.c, imap4d/list.c, imap4d/lsub.c, imap4d/rename.c,
+ imap4d/subscribe.c, imap4d/unsubscribe.c, imap4d/util.c: Spelling
+ fixes.
+ * include/mailutils/cfg.h (mu_cfg_error_count): New variable.
+ * include/mailutils/gocs.h (struct mu_gocs_mailbox): New member
+ mailbox_pattern
+ * include/mailutils/libargp.h (mu_rcfile_lint): New variable.
+ * include/mailutils/mailbox.h (mu_set_mailbox_pattern): New
+ function.
+ (mu_mail_directory): Removed.
+ (mu_mailbox_url): New function.
+ * include/mailutils/mutil.h (mu_normalize_mailbox_url): Remove.
+ * include/mailutils/registrar.h (mu_0_6_registrar_lookup): Remove.
+
+ * libargp/common.c: New options --rcfile-lint and
+ --mailbox-pattern.
+ * libargp/muinit.c: Handle --rcfile-lint.
+ * libcfg/common.c: New statement mailbox-pattern
+ * libmu_scm/mu_mailbox.c (mu-mail-directory): Deprecated.
+ (mu-user-mailbox-url): New function.
+
+ * libproto/remote: New directory.
+ * libproto/remote/folder.c: New file.
+ * libproto/remote/mbox.c: New file.
+ * libproto/remote/.cvsignore: New file.
+
+ * libproto/Makefile.am (SUBDIRS): Add remote
+ * libproto/mbox/folder.c, libproto/mbox/url.c: Indentation and
+ spelling fixes.
+ * maidag/Makefile.am (maidag_LDADD): Add MU_LIB_REMOTE.
+ * maidag/maidag.c: Register mu_remote_mbox_record.
+ * mailbox/cfg_parser.y (mu_cfg_error_count): New variable.
+ (mu_cfg_format_error,_mu_cfg_vperror): Increment
+ mu_cfg_error_count.
+ * mailbox/debug.c (mu_debug_check_level): Do not mask out
+ inheritance bit.
+ * mailbox/gocs.c (mu_gocs_mailbox_init): Set mailbox pattern.
+ * mailbox/mailbox.c (_create_mailbox): Bugfix.
+ * mailbox/mbx_default.c (mu_set_mailbox_pattern): New finction.
+ (mu_set_mail_directory): Rewrite.
+ (user_mailbox_name): Rewrite.
+ * mailbox/mutil.c (mu_normalize_mailbox_url): Remove.
+ * mailbox/registrar.c (mu_0_6_registrar_lookup): Remove.
+ * guimb/scm/sieve-core.scm (sieve-main): Use mu-user-mailbox-url.
+
2007-12-15 Sergey Poznyakoff <gray@gnu.org.ua>
* libcfg/acl.c (getword): Bugfix.
diff --git a/NEWS b/NEWS
index b9505d835..1730f164c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU mailutils NEWS -- history of user-visible changes. 2007-12-07
+GNU mailutils NEWS -- history of user-visible changes. 2007-12-19
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
See the end of file for copying conditions.
@@ -30,10 +30,14 @@ affect the given program.
Maidag is a MAIl Delivery AGent. It is a general-purpose MDA able to
run in both traditional and LMTP mode and to deliver mails to various
-mailbox formats. It is also able to process incoming messages using
-Sieve or Scheme scripts and, based on results of this processing,
-to take a decision on whether to actually deliver and where to
-deliver them.
+mailbox formats. These formats, among others, include remote+smtp and
+remote+sendmail (see `New mailbox types.', below), which are
+equivalent to forwarding a message over SMTP. Thus, maidag supercedes
+both `mail.local' and `mail.remote' (both of which are still included
+for backward compatibility). Maidag is also able to process incoming
+messages using Sieve or Scheme scripts and, based on results of this
+processing, to take a decision on whether to actually deliver and
+where to deliver them.
** New Sieve action `pipe'
@@ -215,6 +219,14 @@ Any mu_url_get_.* accessors return MU_ERR_ENOENT if the corresponding
field is not present in the object. Previous versions in that case
returned 0 and stored empty string in the output buffer.
+** New mailbox types.
+
+Two new mailbox types, "remote+smtp" and "remote+sendmail", are
+supported. These are `append-only' mailboxes, i.e. the only operation
+that can be done over them is mu_mailbox_append_message. E.g.,
+appending to the URL `remote+smtp://127.0.0.1:24' is equivalent to
+sending a message using mailer `smtp://127.0.0.1:24'.
+
** Fixed parsing of URLs similar to file:///a/b.
It is parsed as an absolute file name `/a/b'.
@@ -224,6 +236,10 @@ Previous versions incorrectly understood such an URL as `a/b'
** Remove v0.6 compatibility layer.
+** Function mu_mail_directory is removed.
+
+** New function mu_mailbox_url.
+
Version 1.2:
diff --git a/configure.ac b/configure.ac
index 0236161e0..7ca1d4d24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@ AC_SUBST(MU_LIB_MBOX,'${top_builddir}/libproto/mbox/libmu_mbox.la')
AC_SUBST(MU_LIB_MH,'${top_builddir}/libproto/mh/libmu_mh.la')
AC_SUBST(MU_LIB_NNTP,'${top_builddir}/libproto/nntp/libmu_nntp.la')
AC_SUBST(MU_LIB_POP,'${top_builddir}/libproto/pop/libmu_pop.la')
+AC_SUBST(MU_LIB_REMOTE,'${top_builddir}/libproto/remote/libmu_remotembox.la')
AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libsieve/libsieve.la')
AC_SUBST(MU_LIB_SCM,'${top_builddir}/libmu_scm/libmu_scm.la')
AC_SUBST(MU_LIB_CPP,'${top_builddir}/libmu_cpp/libmu_cpp.la')
@@ -1194,6 +1195,7 @@ AC_CONFIG_FILES([Makefile
libproto/nntp/Makefile
libproto/imap/Makefile
libproto/include/Makefile
+ libproto/remote/Makefile
libsieve/Makefile
libsieve/extensions/Makefile
libargp/Makefile
diff --git a/guimb/scm/sieve-core.scm b/guimb/scm/sieve-core.scm
index 8ab5b73b8..89a0872d6 100644
--- a/guimb/scm/sieve-core.scm
+++ b/guimb/scm/sieve-core.scm
@@ -492,8 +492,8 @@
(name (if (and (not (null? (cdr cl)))
(string? (cadr cl)))
(cadr cl)
- (string-append (mu-mail-directory) "/"
- (passwd:name (mu-getpwuid (getuid)))))))
+ (mu-user-mailbox-url
+ (passwd:name (mu-getpwuid (getuid)))))))
(set! sieve-mailbox (mu-mailbox-open name "rw"))
(sieve-run thunk)
diff --git a/imap4d/copy.c b/imap4d/copy.c
index 912d229db..f3a82a641 100644
--- a/imap4d/copy.c
+++ b/imap4d/copy.c
@@ -109,7 +109,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
return RESP_OK;
}
- /* Unless it is certain that the destination mailbox can not be created,
+ /* Unless it is certain that the destination mailbox cannot be created,
the server MUST send the response code "[TRYCREATE]" as the prefix
of the text of the tagged NO response. This gives a hint to the
client that it can attempt a CREATE command and retry the copy if
diff --git a/imap4d/create.c b/imap4d/create.c
index 2a3de3b21..7914c60c4 100644
--- a/imap4d/create.c
+++ b/imap4d/create.c
@@ -71,7 +71,7 @@ imap4d_create (struct imap4d_command *command, char *arg)
name = namespace_getfullpath (name, delim);
if (!name)
- return util_finish (command, RESP_NO, "Can not create mailbox");
+ return util_finish (command, RESP_NO, "Cannot create mailbox");
/* It will fail if the mailbox already exists. */
if (access (name, F_OK) != 0)
@@ -98,7 +98,7 @@ imap4d_create (struct imap4d_command *command, char *arg)
else
{
rc = RESP_NO;
- msg = "Can not create mailbox";
+ msg = "Cannot create mailbox";
break;
}
}
@@ -113,7 +113,7 @@ imap4d_create (struct imap4d_command *command, char *arg)
else
{
rc = RESP_NO;
- msg = "Can not create mailbox";
+ msg = "Cannot create mailbox";
}
}
}
diff --git a/imap4d/delete.c b/imap4d/delete.c
index 3192e2ee8..b5a23e919 100644
--- a/imap4d/delete.c
+++ b/imap4d/delete.c
@@ -44,12 +44,12 @@ imap4d_delete (struct imap4d_command *command, char *arg)
/* Allocates memory. */
name = namespace_getfullpath (name, delim);
if (!name)
- return util_finish (command, RESP_NO, "Can not remove");
+ return util_finish (command, RESP_NO, "Cannot remove");
if (remove (name) != 0)
{
rc = RESP_NO;
- msg = "Can not remove";
+ msg = "Cannot remove";
}
free (name);
return util_finish (command, rc, msg);
diff --git a/imap4d/fetch.c b/imap4d/fetch.c
index 39bd9a8d0..790303535 100644
--- a/imap4d/fetch.c
+++ b/imap4d/fetch.c
@@ -1031,7 +1031,7 @@ fetch_operation (mu_message_t msg, char **arg, int silent)
{
if (!silent)
{
- /* NOTE: We violate the RFC here: Header can not take a prefix for
+ /* NOTE: We violate the RFC here: Header cannot take a prefix for
section messages it only referes to the RFC822 header .. ok
see it as an extension. But according to IMAP4 we should
have send an empty string: util_send (" \"\"");
diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c
index 6c8c0021c..6a68d6535 100644
--- a/imap4d/imap4d.c
+++ b/imap4d/imap4d.c
@@ -59,9 +59,10 @@ size_t children;
const char *program_version = "imap4d (" PACKAGE_STRING ")";
static char doc[] = N_("GNU imap4d -- the IMAP4D daemon");
-#define ARG_LOGIN_DISABLED 1
-#define ARG_TLS_REQUIRED 2
-#define ARG_CREATE_HOME_DIR 3
+#define ARG_LOGIN_DISABLED 256
+#define ARG_TLS_REQUIRED 257
+#define ARG_CREATE_HOME_DIR 258
+#define ARG_OPTION_PREAUTH 259
static struct argp_option options[] = {
{"other-namespace", 'O', N_("PATHLIST"), OPTION_HIDDEN,
@@ -73,6 +74,8 @@ static struct argp_option options[] = {
{"create-home-dir", ARG_CREATE_HOME_DIR, N_("MODE"),
OPTION_ARG_OPTIONAL|OPTION_HIDDEN,
N_("Create home directory, if it does not exist")},
+ {"preauth", ARG_OPTION_PREAUTH, NULL, 0,
+ N_("Start in preauth mode") },
#ifdef WITH_TLS
{"tls-required", ARG_TLS_REQUIRED, NULL, OPTION_HIDDEN,
N_("Always require STARTTLS before entering authentication phase")},
@@ -140,6 +143,10 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state)
break;
#endif
+ case ARG_OPTION_PREAUTH:
+ preauth_mode = preauth_stdio;
+ break;
+
case ARGP_KEY_INIT:
mu_argp_node_list_init (&lst);
break;
diff --git a/imap4d/list.c b/imap4d/list.c
index daafc8978..924bb4e09 100644
--- a/imap4d/list.c
+++ b/imap4d/list.c
@@ -36,7 +36,7 @@ struct inode_list
};
/*
- 1- IMAP4 insists: the reference argument that is include in the
+ 1- IMAP4 insists: the reference argument present in the
interpreted form SHOULD prefix the interpreted form. It SHOULD
also be in the same form as the reference name argument. This
rule permits the client to determine if the returned mailbox name
@@ -52,7 +52,7 @@ struct inode_list
2- The character "*" is a wildcard, and matches zero or more characters
at this position. The charcater "%" is similar to "*",
- but it does not match ahierarchy delimiter. */
+ but it does not match a hierarchy delimiter. */
static int match (const char *, const char *, const char *);
static void list_file (const char *, const char *, const char *, const char *, struct inode_list *);
diff --git a/imap4d/lsub.c b/imap4d/lsub.c
index c7209f376..bb2b30ad4 100644
--- a/imap4d/lsub.c
+++ b/imap4d/lsub.c
@@ -74,5 +74,5 @@ imap4d_lsub (struct imap4d_command *command, char *arg)
}
else if (errno == ENOENT)
return util_finish (command, RESP_OK, "Completed");
- return util_finish (command, RESP_NO, "Can not list subscriber");
+ return util_finish (command, RESP_NO, "Cannot list subscriber");
}
diff --git a/imap4d/rename.c b/imap4d/rename.c
index 6f9187804..eed7c28f5 100644
--- a/imap4d/rename.c
+++ b/imap4d/rename.c
@@ -75,7 +75,7 @@ imap4d_rename (struct imap4d_command *command, char *arg)
if (S_ISDIR(newst.st_mode))
{
free (newname);
- return util_finish (command, RESP_NO, "Can not be a directory");
+ return util_finish (command, RESP_NO, "Cannot be a directory");
}
name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1);
sprintf (name, "mbox:%s", newname);
@@ -84,7 +84,7 @@ imap4d_rename (struct imap4d_command *command, char *arg)
{
free (name);
free (newname);
- return util_finish (command, RESP_NO, "Can not create new mailbox");
+ return util_finish (command, RESP_NO, "Cannot create new mailbox");
}
free (name);
free (newname);
diff --git a/imap4d/subscribe.c b/imap4d/subscribe.c
index 348ecd34d..91b635e63 100644
--- a/imap4d/subscribe.c
+++ b/imap4d/subscribe.c
@@ -45,5 +45,5 @@ imap4d_subscribe (struct imap4d_command *command, char *arg)
fclose (fp);
return util_finish (command, RESP_OK, "Completed");
}
- return util_finish (command, RESP_NO, "Can not subscribe");
+ return util_finish (command, RESP_NO, "Cannot subscribe");
}
diff --git a/imap4d/unsubscribe.c b/imap4d/unsubscribe.c
index b0d203535..671e7a112 100644
--- a/imap4d/unsubscribe.c
+++ b/imap4d/unsubscribe.c
@@ -112,7 +112,7 @@ imap4d_unsubscribe (struct imap4d_command *command, char *arg)
free (file);
if (rc)
- return util_finish (command, RESP_NO, "Can not unsubscribe");
+ return util_finish (command, RESP_NO, "Cannot unsubscribe");
return util_finish (command, RESP_OK, "Completed");
}
diff --git a/imap4d/util.c b/imap4d/util.c
index 55fd1c6f9..c54156d17 100644
--- a/imap4d/util.c
+++ b/imap4d/util.c
@@ -26,7 +26,7 @@ static int add2set (size_t **, int *, unsigned long);
static const char *sc2string (int);
/* Get the next space/CR/NL separated word, some words are between double
- quotes, strtok() can not handle it. */
+ quotes, strtok() cannot handle it. */
char *
util_getword (char *s, char **save)
{
diff --git a/include/mailutils/cfg.h b/include/mailutils/cfg.h
index d4214dbaf..002a90fbb 100644
--- a/include/mailutils/cfg.h
+++ b/include/mailutils/cfg.h
@@ -231,6 +231,7 @@ int mu_parse_config (const char *file, const char *progname,
int mu_cfg_parse_boolean (const char *str, int *res);
extern int mu_cfg_parser_verbose;
+extern size_t mu_cfg_error_count;
void mu_cfg_format_docstring (mu_stream_t stream, const char *docstring,
int level);
diff --git a/include/mailutils/gocs.h b/include/mailutils/gocs.h
index 17112fc4e..295ae3ede 100644
--- a/include/mailutils/gocs.h
+++ b/include/mailutils/gocs.h
@@ -52,6 +52,7 @@ struct mu_gocs_debug
struct mu_gocs_mailbox
{
char *mail_spool;
+ char *mailbox_pattern;
char *mailbox_type;
};
diff --git a/include/mailutils/libargp.h b/include/mailutils/libargp.h
index 8344d0f6a..931f6b495 100644
--- a/include/mailutils/libargp.h
+++ b/include/mailutils/libargp.h
@@ -43,7 +43,8 @@ struct mu_cmdline_capa
};
extern int mu_help_config_mode;
-
+extern int mu_rcfile_lint;
+
extern struct mu_cmdline_capa mu_common_cmdline;
extern struct mu_cmdline_capa mu_logging_cmdline;
extern struct mu_cmdline_capa mu_license_cmdline;
diff --git a/include/mailutils/mailbox.h b/include/mailutils/mailbox.h
index 773b0d966..65f91d0ff 100644
--- a/include/mailutils/mailbox.h
+++ b/include/mailutils/mailbox.h
@@ -29,8 +29,9 @@ extern "C" {
#endif
int mu_set_mail_directory (const char *p);
+int mu_set_mailbox_pattern (const char *pat);
void mu_set_folder_directory (const char *p);
-const char *mu_mail_directory (void);
+const char *mu_mailbox_url (void);
const char *mu_folder_directory (void);
int mu_construct_user_mailbox_url (char **pout, const char *name);
diff --git a/include/mailutils/mutil.h b/include/mailutils/mutil.h
index d18dfe7a6..6802de8cf 100644
--- a/include/mailutils/mutil.h
+++ b/include/mailutils/mutil.h
@@ -97,7 +97,6 @@ extern int mu_get_user_email_domain (const char** domain);
extern char *mu_get_user_email (const char *name);
extern char *mu_normalize_path (char *path, const char *delim);
-extern int mu_normalize_mailbox_url (char **out, const char *dir);
extern int mu_tempfile (const char *tmpdir, char **namep);
extern char *mu_tempname (const char *tmpdir);
diff --git a/include/mailutils/registrar.h b/include/mailutils/registrar.h
index 4ad1c3c0d..03836b85e 100644
--- a/include/mailutils/registrar.h
+++ b/include/mailutils/registrar.h
@@ -51,8 +51,6 @@ extern int mu_registrar_get_list (mu_list_t *) __attribute__ ((deprecated));
extern int mu_registrar_lookup (const char *name, int flags,
mu_record_t *precord, int *pflags);
-extern int mu_0_6_registrar_lookup (const char *name, mu_record_t *precord,
- int flags);
extern int mu_registrar_record (mu_record_t);
extern int mu_unregistrar_record (mu_record_t);
@@ -103,17 +101,20 @@ extern mu_record_t mu_path_record;
extern mu_record_t mu_mh_record;
/* Maildir, "maildir:" */
extern mu_record_t mu_maildir_record;
-
-#define MU_IMAP_PRIO 100
-#define MU_POP_PRIO 200
-#define MU_MBOX_PRIO 300
-#define MU_MH_PRIO 400
-#define MU_MAILDIR_PRIO 500
-#define MU_NNTP_PRIO 600
-#define MU_PATH_PRIO 1000
-
-#define MU_SMTP_PRIO 10000
-#define MU_SENDMAIL_PRIO 10000
+/* Remote mailbox */
+extern mu_record_t mu_remote_mbox_record;
+
+#define MU_IMAP_PRIO 100
+#define MU_POP_PRIO 200
+#define MU_MBOX_PRIO 300
+#define MU_MH_PRIO 400
+#define MU_MAILDIR_PRIO 500
+#define MU_NNTP_PRIO 600
+#define MU_PATH_PRIO 1000
+
+#define MU_REMOTE_MBOX_PRIO 10000
+#define MU_SMTP_PRIO 10000
+#define MU_SENDMAIL_PRIO 10000
/* SMTP mailer, "smtp://" */
extern mu_record_t mu_smtp_record;
diff --git a/libargp/common.c b/libargp/common.c
index e2bc4b300..1aefd7c41 100644
--- a/libargp/common.c
+++ b/libargp/common.c
@@ -34,6 +34,7 @@ enum {
OPT_NO_USER_RCFILE,
OPT_NO_SITE_RCFILE,
OPT_RCFILE,
+ OPT_RCFILE_LINT,
OPT_RCFILE_VERBOSE,
OPT_LOG_FACILITY,
OPT_LOCK_FLAGS,
@@ -41,7 +42,8 @@ enum {
OPT_LOCK_RETRY_TIMEOUT,
OPT_LOCK_EXPIRE_TIMEOUT,
OPT_LOCK_EXTERNAL_PROGRAM,
- OPT_LICENSE,
+ OPT_LICENSE,
+ OPT_MAILBOX_PATTERN,
OPT_MAILBOX_TYPE,
OPT_DEBUG_LEVEL,
OPT_LINE_INFO,
@@ -63,6 +65,8 @@ static struct argp_option mu_common_argp_options[] =
N_("Load this configuration file"), 0, },
{ "rcfile-verbose", OPT_RCFILE_VERBOSE, NULL, 0,
N_("Verbosely log parsing of the configuration files"), 0 },
+ { "rcfile-lint", OPT_RCFILE_LINT, NULL, 0,
+ N_("Check configuration file syntax and exit"), 0 },
{ NULL, 0, NULL, 0, NULL, 0 }
};
@@ -87,6 +91,11 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
mu_load_rcfile = arg;
break;
+ case OPT_RCFILE_LINT:
+ mu_cfg_parser_verbose++;
+ mu_rcfile_lint = 1;
+ break;
+
case OPT_RCFILE_VERBOSE:
mu_cfg_parser_verbose++;
break;
@@ -222,6 +231,8 @@ struct mu_cmdline_capa mu_license_cmdline = {
static struct argp_option mu_mailbox_argp_option[] = {
{ "mail-spool", 'm', N_("URL"), OPTION_HIDDEN,
N_("Use specified URL as a mailspool directory"), 0 },
+ { "mailbox-pattern", OPT_MAILBOX_PATTERN, N_("pat"), OPTION_HIDDEN,
+ "", 0 },
{ "mailbox-type", OPT_MAILBOX_TYPE, N_("PROTO"), OPTION_HIDDEN,
N_("Default mailbox type to use"), 0 },
{ NULL }
@@ -239,6 +250,10 @@ mu_mailbox_argp_parser (int key, char *arg, struct argp_state *state)
mu_argp_node_list_new (&lst, "mail-spool", arg);
break;
+ case OPT_MAILBOX_PATTERN:
+ mu_argp_node_list_new (&lst, "mailbox-pattern", arg);
+ break;
+
case OPT_MAILBOX_TYPE:
mu_argp_node_list_new (&lst, "mailbox-type", arg);
break;
diff --git a/libargp/muinit.c b/libargp/muinit.c
index c39108f75..797047b00 100644
--- a/libargp/muinit.c
+++ b/libargp/muinit.c
@@ -49,6 +49,7 @@ get_canonical_name ()
}
int mu_help_config_mode;
+int mu_rcfile_lint;
int
mu_app_init (struct argp *myargp, const char **capa,
@@ -115,7 +116,9 @@ mu_app_init (struct argp *myargp, const char **capa,
cfgflags |= MU_PARSE_CONFIG_DUMP;
rc = mu_cfg_tree_reduce (mu_argp_tree, mu_program_name, cfg_param,
cfgflags, data);
-
+ if (mu_rcfile_lint)
+ exit ((rc || mu_cfg_error_count) ? 1 : 0);
+
mu_gocs_flush ();
mu_cfg_destroy_tree (&mu_argp_tree);
diff --git a/libcfg/common.c b/libcfg/common.c
index 7b7ddb5a8..6288e89a6 100644
--- a/libcfg/common.c
+++ b/libcfg/common.c
@@ -43,6 +43,10 @@ static struct mu_cfg_param mu_mailbox_param[] = {
{ "mail-spool", mu_cfg_string, &mailbox_settings.mail_spool, 0, NULL,
N_("Use specified URL as a mailspool directory."),
N_("url") },
+ { "mailbox-pattern", mu_cfg_string, &mailbox_settings.mailbox_pattern,
+ 0, NULL,
+ N_("Create mailbox URL using <pattern>."),
+ N_("pattern") },
{ "mailbox-type", mu_cfg_string, &mailbox_settings.mailbox_type, 0, NULL,
N_("Default mailbox type."), N_("protocol") },
{ NULL }
diff --git a/libmu_scm/mu_mailbox.c b/libmu_scm/mu_mailbox.c
index d90315185..6fb611ae6 100644
--- a/libmu_scm/mu_mailbox.c
+++ b/libmu_scm/mu_mailbox.c
@@ -106,16 +106,34 @@ mu_scm_is_mailbox (SCM scm)
SCM_DEFINE (scm_mu_mail_directory, "mu-mail-directory", 0, 1, 0,
(SCM URL),
-"If URL is given, sets it as a name of the user's mail directory.\n"
-"Returns the current value of the mail directory.")
+"Do not use this function. Use mu-user-mailbox-url instead.")
#define FUNC_NAME s_scm_mu_mail_directory
{
- if (!SCM_UNBNDP (URL))
- {
- SCM_ASSERT (scm_is_string (URL), URL, SCM_ARG1, FUNC_NAME);
- mu_set_mail_directory (scm_i_string_chars (URL));
- }
- return scm_makfrom0str (mu_mail_directory ());
+ mu_scm_error (FUNC_NAME, ENOSYS,
+ "This function is deprecated. Use mu-user-mailbox-url instead.",
+ scm_list_1 (URL));
+ return SCM_EOL;
+}
+#undef FUNC_NAME
+
+SCM_DEFINE (scm_mu_user_mailbox_url, "mu-user-mailbox-url", 1, 0, 0,
+ (SCM USER),
+ "")
+#define FUNC_NAME s_scm_mu_user_mailbox_url
+{
+ int rc;
+ char *p;
+ SCM ret;
+
+ SCM_ASSERT (scm_is_string (USER), USER, SCM_ARG1, FUNC_NAME);
+ rc = mu_construct_user_mailbox_url (&p, scm_i_string_chars (USER));
+ if (rc)
+ mu_scm_error (FUNC_NAME, rc,
+ "Cannot construct mailbox URL for ~A",
+ scm_list_1 (USER));
+ ret = scm_makfrom0str (p);
+ free (p);
+ return ret;
}
#undef FUNC_NAME
diff --git a/libproto/Makefile.am b/libproto/Makefile.am
index 78e617916..591ef65fa 100644
--- a/libproto/Makefile.am
+++ b/libproto/Makefile.am
@@ -17,5 +17,5 @@
##