SourceForge.net Logo 

DeleteFromPOP3

How it works

Background

Implementing the function to delete selected message from POP3 server is not easy. POP3 protocol is very simple and it was not intended for random access to particular messages on the server. Selecting a message with given properties, such as header field with given value, requires parsing all messages and checking one by one for match. As far as I know there is no easier way. (If you know better solution - let me know.)

The idea is simple:

  1. mark messages for deleting in the mail client - It is not so difficult to do it manually. I just delete mails from my inbox or mark them as spam. Then, from time to time I mark all files in the trash and spam folder for removal from POP3 server. When you create a mail filter and add it to the toolbar, it just requires one click to mark messages for removal.
  2. pass the list of messages marked for deletion to the external program - This is done together with marking for removal. No additional action required.
  3. run external program to delete messages from the server - You can run it automatically if you wish

How it works:

DeleteFromPOP3 consists of two simple Perl scripts, which are independent of e-mail client. It is not a plugin.

  • A message(s) from mail client is piped through a helper script, which parses it and collects information needed for identification of message on the server.
    The script produces a pair of <server name> and <Message-Id> for every message. The pairs of <server name> and <Message-Id> are stored in separate file, each in separate line
  • The second script, which actually deletes messages from POP3 server, is executed whenever you like.
    This script requires a list of messages created by previous script. It also requires POP3 account details to connect to server(s). After connecting to the POP3 server it looks through all  messages and checks if a message is on the list and should be deleted. After deleting messages it truncates the message list file.
    It takes a while if your mailbox at the server is large, so  I don't recommend executing it on logout.
BuiltWithNOF

[Home] [Details] [Downloads]