Esempio n. 1
0
 * mboxlist_findall() callback function to examine a mailbox
 */
static int do_examine(struct findall_data *data, void *rock __attribute__((unused)))
{
    if (!data) return 0;
    unsigned i, msgno;
    int r = 0;
    int flag = 0;
    struct mailbox *mailbox = NULL;
    const struct index_record *record;
    int j;

    signals_poll();

    /* Convert internal name to external */
    const char *extname = mbname_extname(data->mbname, &recon_namespace, "cyrus");
    printf("Examining %s...", extname);

    const char *name = mbname_intname(data->mbname);

    /* Open/lock header */
    r = mailbox_open_irl(name, &mailbox);
    if (r) return r;

    /* Open/lock header */
    r = mailbox_open_irl(name, &mailbox);
    if (r) return r;

    if (chdir(mailbox_datapath(mailbox, 0)) == -1) {
        r = IMAP_IOERROR;
        goto done;
Esempio n. 2
0
/*
 * mboxlist_findall() callback function to examine a mailbox
 */
static int do_examine(struct findall_data *data, void *rock __attribute__((unused)))
{
    if (!data) return 0;
    unsigned i, msgno;
    int r = 0;
    int flag = 0;
    struct mailbox *mailbox = NULL;
    int j;

    signals_poll();

    /* Convert internal name to external */
    const char *extname = mbname_extname(data->mbname, &mbexamine_namespace, "cyrus");
    printf("Examining %s...", extname);

    const char *name = mbname_intname(data->mbname);

    /* Open/lock header */
    r = mailbox_open_irl(name, &mailbox);
    if (r) return r;

    if (chdir(mailbox_datapath(mailbox, 0)) == -1) {
        r = IMAP_IOERROR;
        goto done;
    }

    printf(" Mailbox Header Info:\n");
    printf("  Path to mailbox: %s\n", mailbox_datapath(mailbox, 0));