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=1f9e808fa3e458c0331f3ef2b065fa70dcc46b25 The branch, master has been updated via 1f9e808fa3e458c0331f3ef2b065fa70dcc46b25 (commit) from 7585f48fd66e55f85fea516e1706a945db5e1149 (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 1f9e808fa3e458c0331f3ef2b065fa70dcc46b25 Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Sat Nov 30 18:09:21 2013 +0200 Fix appending to IMAP[S] mailboxes * libproto/imap/appmsg.c (mu_imap_append_message): Fix conditional. * libproto/imap/mbox.c (_imap_mbx_append_message): Fix error checking. * libproto/imap/url.c (_mu_imap_url_init) (_mu_imaps_url_init): Set _get_path member. This allows the user to specify an URL without explicit path, implying INBOX. ----------------------------------------------------------------------- Summary of changes: libproto/imap/appmsg.c | 2 +- libproto/imap/mbox.c | 2 ++ libproto/imap/url.c | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libproto/imap/appmsg.c b/libproto/imap/appmsg.c index 6fa280e..1c8676e 100644 --- a/libproto/imap/appmsg.c +++ b/libproto/imap/appmsg.c @@ -36,7 +36,7 @@ mu_imap_append_message (mu_imap_t imap, const char *mailbox, int flags, int rc; rc = mu_message_get_streamref (msg, &str); - if (rc) + if (rc == 0) { rc = mu_imap_append_stream (imap, mailbox, flags, tm, tz, str); mu_stream_unref (str); diff --git a/libproto/imap/mbox.c b/libproto/imap/mbox.c index d181cbc..fcf78e8 100644 --- a/libproto/imap/mbox.c +++ b/libproto/imap/mbox.c @@ -1106,6 +1106,8 @@ _imap_mbx_append_message (mu_mailbox_t mbox, mu_message_t msg) if (rc) return rc; rc = mu_url_sget_path (url, &mbox_name); + if (rc) + return rc; return mu_imap_append_message (imap, mbox_name, 0, NULL, NULL, msg); } diff --git a/libproto/imap/url.c b/libproto/imap/url.c index da87aea..dc1e5c4 100644 --- a/libproto/imap/url.c +++ b/libproto/imap/url.c @@ -29,6 +29,7 @@ #include <mailutils/sys/registrar.h> #include <mailutils/sys/url.h> #include <mailutils/sys/imap.h> +#include <mailutils/util.h> static void url_imap_destroy (mu_url_t url); @@ -37,6 +38,16 @@ url_imap_destroy (mu_url_t url MU_ARG_UNUSED) { } +static int +url_imap_get_path (const mu_url_t url, char *bufptr, size_t bufsize, + size_t *rsize) +{ + bufsize = mu_cpystr (bufptr, "INBOX", bufsize); + if (rsize) + *rsize = bufsize; + return 0; +} + /* IMAP URLs: imap://[<user>[;AUTH=<auth>]@]<host>[/<mailbox>] @@ -50,7 +61,8 @@ _mu_imap_url_init (mu_url_t url) url->port = MU_IMAP_PORT; url->_destroy = url_imap_destroy; - + url->_get_path = url_imap_get_path; + if (!url->host || url->qargc) return EINVAL; @@ -81,6 +93,7 @@ _mu_imaps_url_init (mu_url_t url) url->port = MU_IMAPS_PORT; url->_destroy = url_imap_destroy; + url->_get_path = url_imap_get_path; if (!url->host || url->qargc) return EINVAL; hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org https://lists.gnu.org/mailman/listinfo/commit-mailutils