Delete your old e-mail with a script (python)
Nessun commento » Open Source , Shell , System , Tips & Tricks No Comments »
I happened in these days of having to clean up the mailbox of some customers emptying them of all messages older than a certain number of days.
Wanting to automate this rather boring, I trawled through my old things and I found a script that performs the task admirably.
This program cleanup-maildir written in the programming language Python and featuring a series of advanced functions for manipulating the Maildir.
Without going into too much detail (who wants to can run the program with the usual parameter "-h") here is the command that you can permanently delete all messages older than 90 days:
./cleanup-maildir --age=90 --maildir-root='/home/nomeutente/Maildir' delete ''
As simple as that ... Here I offer the original script, although I suggest you keep an eye on this link for a constantly updated version:







