一 文档说明
摘自rfc3501
6.1.2. NOOP Command
Arguments: none
Responses: no specific responses for this command (but see below)
Result:
OK - noop completed
BAD - command unknown or arguments invalid
The NOOP command always succeeds. It does nothing.
Since any command can return a status update as untagged data, the NOOP command can be used as a periodic poll for new messages or message status updates during a period of inactivity (this is the preferred method to do this). The NOOP command can also be used to reset any inactivity autologout timer on the server.
noop命令总是返回成功,但是当服务器有新消息或者消息状态发生改变时,服务器在noop命令响应前会进行响应。
二 举例
C: a002 NOOP
S: a002 OK NOOP completed
. . .
C: a047 NOOP
S: * 22 EXPUNGE // 邮件序号 删除
S: * 23 EXISTS // 收取后,有新邮件到达,邮件总数量,也是当前最大的邮件序号
S: * 3 RECENT // 收取后,有新邮件到达,但没被收取过的数量。(关闭其他邮件客户端时,与EXISTS一起出现)
S: * 14 FETCH (FLAGS (\Seen \Deleted)) // 邮件序号 标签发生改变
S: a047 OK NOOP completed
三 讨论
noop是imap的全局命令,既然涉及到邮件序号,那么要处理该类服务器响应,是否应该先进行select命令。
本文详细解析了IMAP协议中的NOOP命令,其作为全局命令,在不执行任何操作的同时,用于服务器周期性检查新邮件或邮件状态更新,以及重置服务器的自动登出计时器。文章通过实例展示了NOOP命令的使用场景,并讨论了其与邮件序号的关系。
6470

被折叠的 条评论
为什么被折叠?



