Dovecot

如何列出 Dovecot imap 提示命令?

  • December 8, 2014

當我使用以下命令進行 imap 預身份驗證時:

/usr/libexec/dovecot/imap -u username

我可以看到 imap 提示,但不知道如何列出可用命令(如 e 註銷或 b 選擇收件箱等)。

如何列出該命令?

你去(來自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)

引用自:https://serverfault.com/questions/649972