fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] Re: python script to delete old mail

2003-10-13 11:11:55
On Mon, Oct 13, 2003 at 02:54:20PM +0530, Sunil Shetye wrote:
Quoting from James Stone's mail on Sun, Oct 12, 2003 at 04:11:04PM +0100:
Please find python script attached. I should be able to add the size
deletion feature as well, but I want to be happy that this script is
working optimally first. Would be grateful for any feedback on the code,
or experiences from using the script.

The script seems to be great. 

Thats very kind of you.. I think it is adequate but could do with some
polishing (the speed particularly is a bit of a concern but I can't
really see how this can be improved).

I had a few doubts of how exactly the
time calculation was being done. However, I now see that local
timestamps are indeed being used. A few notes:

- mold_remover cannot be used as a cron job as the comments indicate.
  fetchmail running in daemon mode and the cron job may run together
  causing problems in accessing the id file as well as the mailbox.

True as it is. I run it as part of my connection script. I stop
fetchmail first with /etc/init.d/fetchmail stop 
and then restart it after mold_remover has done its stuff.

It would be a simple matter to use a similar script as a cron job.

- ssl and various auth methods supported by fetchmail are not
  supported here. When security is an issue, this script cannot be
  used.

Yes I could possibly add these.. wanted to make sure it was working
first!

- The id file format may change soon and may already have timestamps.
  Then, mold_remover may not have to write any files then!

- IMAP UIDs may be supported soon. Then, mold_remover should do the
  same for IMAP also!

Yes that would be very helpful. Would also help with the speed problem.

Note that as it is, mold remover is designed just for POP3 mailboxes. It
could be converted for use with IMAP very easily though.

James