Назад | Перейти на главную страницу

как перечислить команды приглашения Dovecot imap?

Когда я выполняю предварительную аутентификацию imap с помощью:

/usr/libexec/dovecot/imap -u username

Я вижу приглашение imap, но не знаю, как вывести список доступных команд (например, выйти из системы или выбрать входящие и т. Д.).

Как перечислить эти команды?

Готово (из imap-commands.c)!

Надеюсь, это вам очень поможет!

static const struct command imap4rev1_commands[] = {
    { "CAPABILITY",     cmd_capability,  0 },
    { "LOGOUT",     cmd_logout,      COMMAND_FLAG_BREAKS_MAILBOX },
    { "NOOP",       cmd_noop,        COMMAND_FLAG_BREAKS_SEQS },

    { "APPEND",     cmd_append,      COMMAND_FLAG_BREAKS_SEQS },
    { "EXAMINE",        cmd_examine,     COMMAND_FLAG_BREAKS_MAILBOX },
    { "CREATE",     cmd_create,      0 },
    { "DELETE",     cmd_delete,      COMMAND_FLAG_BREAKS_MAILBOX |
                         COMMAND_FLAG_USE_NONEXISTENT },
    { "RENAME",     cmd_rename,      COMMAND_FLAG_USE_NONEXISTENT },
    { "LIST",       cmd_list,        0 },
    { "LSUB",       cmd_lsub,        0 },
    { "SELECT",     cmd_select,      COMMAND_FLAG_BREAKS_MAILBOX },
    { "STATUS",     cmd_status,      0 },
    { "SUBSCRIBE",      cmd_subscribe,   0 },
    { "UNSUBSCRIBE",    cmd_unsubscribe, COMMAND_FLAG_USE_NONEXISTENT },

    { "CHECK",      cmd_check,       COMMAND_FLAG_BREAKS_SEQS },
    { "CLOSE",      cmd_close,       COMMAND_FLAG_BREAKS_MAILBOX },
    { "COPY",       cmd_copy,        COMMAND_FLAG_USES_SEQS |
                         COMMAND_FLAG_BREAKS_SEQS },
    { "EXPUNGE",        cmd_expunge,     COMMAND_FLAG_BREAKS_SEQS },
    { "FETCH",      cmd_fetch,       COMMAND_FLAG_USES_SEQS },
    { "SEARCH",     cmd_search,      COMMAND_FLAG_USES_SEQS },
    { "STORE",      cmd_store,       COMMAND_FLAG_USES_SEQS },
    { "UID",        cmd_uid,         0 },
    { "UID COPY",       cmd_copy,        COMMAND_FLAG_BREAKS_SEQS },
    { "UID FETCH",      cmd_fetch,       COMMAND_FLAG_BREAKS_SEQS },
    { "UID SEARCH",     cmd_search,      COMMAND_FLAG_BREAKS_SEQS },
    { "UID STORE",      cmd_store,       COMMAND_FLAG_BREAKS_SEQS }
};
#define IMAP4REV1_COMMANDS_COUNT N_ELEMENTS(imap4rev1_commands)

static const struct command imap_ext_commands[] = {
    { "CANCELUPDATE",   cmd_cancelupdate,0 },
    { "ENABLE",     cmd_enable,      0 },
    { "ID",         cmd_id,          0 },
    { "IDLE",       cmd_idle,        COMMAND_FLAG_BREAKS_SEQS |
                         COMMAND_FLAG_REQUIRES_SYNC },
    { "NAMESPACE",      cmd_namespace,   0 },
    { "SORT",       cmd_sort,        COMMAND_FLAG_USES_SEQS },
    { "THREAD",     cmd_thread,      COMMAND_FLAG_USES_SEQS },
    { "UID EXPUNGE",    cmd_uid_expunge, COMMAND_FLAG_BREAKS_SEQS },
    { "UID SORT",       cmd_sort,        COMMAND_FLAG_BREAKS_SEQS },
    { "UID THREAD",     cmd_thread,      COMMAND_FLAG_BREAKS_SEQS },
    { "UNSELECT",       cmd_unselect,    COMMAND_FLAG_BREAKS_MAILBOX },
    { "X-CANCEL",       cmd_x_cancel,    0 },
    { "XLIST",      cmd_list,        0 }
};
#define IMAP_EXT_COMMANDS_COUNT N_ELEMENTS(imap_ext_commands)

Проверьте эту страницу для примера тестирования IMAP https://workaround.org/ispmail/lenny/test-fetching-with-imap-and-pop3