0

Is there a way to force-delete a message from a POP3 server without sending 'quit'?

So, for example, right now I have:

>> dele 1
<< +OK Deleted.
>> quit
<< +OK Bye-bye.

I want something where I can flush the deleted messages before the quit,

>> dele 1
<< +OK Deleted.
>> flush
<< +OK You are awesome.
(many more ops)
>> quit
<< +OK Bye-bye.

The reason is I have a script that reads and processes email and if a fatal happens on, say, message #10, then the script halts and the 'quit' command is never sent. Then the next time the scripts is run, messages 1-9 are re-processed because they weren't removed.

(We have lots of error handling to make sure fatal errors don't happen, and we have protection against dupe messages further up the stack. But it'd still be better to make sure messages are deleted when they should be.)

chroder
  • 664
  • 2
  • 8
  • 17

1 Answers1

2

afaik this is not possible with a rfc-compliant pop3-server. according to RFC 1939 , the server can only start updating the mailbox (deleting messages) when the client sends the quit command.

maybe you could modify your script to work in smaller batches and reconnect after each batch. Or use IMAP instead.

Gryphius
  • 2,720
  • 1
  • 19
  • 19