Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

Matts
  (email not shown publicly)

I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Thursday May 31, 2007
10:52 PM

Hacking

[ #33396 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • So I wrote my own "fetchmail"
    Dude, you are the next Eric Raymond. But with fewer bugs. And probably fewer guns. PHEAR ME IDIOTARIANS!!!
  • Nice story - I'm glad you found a solution. You probably realise that the current Fetchmail (no longer maintained by ESR) probably has these things fixed, and that the Perl Fetchmail-replacement you wrote has a very small subset of the Fetchmail features, and as such is not an accurate replacement. It works for you, but most people will not find it an accurate replacement.

    I believe many programmers wrote ad-hoc replacements for popular programs. For example, I wrote my own RSS/Atom aggregator based on

    • Nice story - I'm glad you found a solution. You probably realise that the current Fetchmail (no longer maintained by ESR) probably has these things fixed, and that the Perl Fetchmail-replacement you wrote has a very small subset of the Fetchmail features, and as such is not an accurate replacement. It works for you, but most people will not find it an accurate replacement.

      I think he mentioned upgrading wasn't an option. I also didn't catch where he said that he created his own "feature complete" version of fetchmail. He hacked up a "fetchmail" to do what he needed it to do (probably no more and no less). This is one of the points of Perl. : )

      • I think he mentioned upgrading wasn't an option. I also didn't catch where he said that he created his own "feature complete" version of fetchmail. He hacked up a "fetchmail" to do what he needed it to do (probably no more and no less). This is one of the points of Perl. : )

        I know he said upgrading wasn't an option. However, assuming his work constraints were not as silly as requiring RedHat 8, then everything probably would have worked as it is. See this fortune file (search for "Mozilla") [shlomifish.org] for me and others mocking the fact that some people are still using ancient software due to their work constraints.

        In regards to being "feature complete", maybe I phrased my original post in a bad way, but I knew he knew it wasn't as feature-complete as Fetchmail. What I meant was t

        • I am stuck on Perl 5.6.0 at the moment myself. I am looking at getting the project over to 5.8 but that is what I am stuck with at the moment. : )
        • He didn't say that it was "as good as" Fetchmail. He said that for his needs it was better. :-)
  • Now I have that song from Office Space stuck in my head.
  • I just said "I could mail Matt, or I could write my own too". guess which option I took. NIH! ;)

    (mind you mine came out as 272 lines, but that's with a config file parser and support for deleting messages from some folders, while keeping messages in others and using SHA1 of the TOP output to track seen messages -- ie. the feature that my fetchmail doesn't do....)