Commit da88ef54 da88ef5409ea73f0de3d4bf66b766f2ee297d8c1 by Sergey Poznyakoff

Don't bail out if the mailbox does not exist.

1 parent 71152562
Showing 1 changed file with 14 additions and 3 deletions
......@@ -38,6 +38,7 @@
#include <mailutils/observer.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
static char* show_field;
static int show_to;
......@@ -348,9 +349,16 @@ main(int argc, char **argv)
if (status != 0)
{
fprintf (stderr, "could not open mailbox <%s>: %s\n",
mailbox_name ? mailbox_name : "default",
url_t url = NULL;
mailbox_get_url (mbox, &url);
if (status == ENOENT)
status = 2;
else
fprintf (stderr, "could not open mailbox %s: %s\n",
url_to_string (url),
mu_errstring(status));
goto cleanup;
}
......@@ -366,8 +374,11 @@ main(int argc, char **argv)
if (status != 0)
{
url_t url = NULL;
mailbox_get_url (mbox, &url);
fprintf (stderr, "could not scan mailbox <%s>: %s\n",
mailbox_name ? mailbox_name : "default",
url_to_string (url),
mu_errstring(status));
goto cleanup;
}
......