首先我必须承认我不知道 POP3 支持什么命令,但是......如果你可以做一个明确的'DELE'并且如果消息不再存在则得到一个错误,那么我会说:
编辑:
阅读 RFC1939 后,这种方法应该可行;来自 RFC:
DELE msg
Arguments:
a message-number (required) which may NOT refer to a
message marked as deleted
Restrictions:
may only be given in the TRANSACTION state
Discussion:
The POP3 server marks the message as deleted. Any future
reference to the message-number associated with the message
in a POP3 command generates an error. The POP3 server does
not actually delete the message until the POP3 session
enters the UPDATE state.
Possible Responses:
+OK message deleted
-ERR no such message
Examples:
C: DELE 1
S: +OK message 1 deleted
...
C: DELE 2
S: -ERR message 2 already deleted
这当然是假设 Gmail 实现实际上遵守 RFC。