Some days it's good to be a hacker.
For a long time I've had fetchmail running at work to download all mail from our Exchange server (which has IMAP enabled), run through procmail (for filtering into folders) delivering to my Maildir folders.
But every so often it would just hang.
So I wrote a job to kill fetchmail every 3 hours. But this bugged me - why should I have to hack around someone's broken software? Sadly the platform I was running it on had to be Red Hat 8 (for various work reasons), and upgrading fetchmail didn't seem to be an option.
So I wrote my own "fetchmail". 30-ish lines of perl using Net::IMAP::Simple and job done.
Unsurprisingly it has yet to hang.