Messaging Library
I’ve created a new module in Hep CVS called "messaging". This is the code for the new messaging library that I’ve been working on, the library that will be in Hep 0.4. You can also use this library for your own applications, although at the moment that wouldn’t be a good idea since it’s buggy and the API is still changing. It uses the Twisted framework.
As proof that the code does actually work, though, there’s a script in the examples/ sub-directory called copymessages.py. This is a command line tool that reads all the messages at one location, and posts them to another.
For example, you could send all items in an RSS feed to an e-mail address with a command like this: copymessages.py http://www.scripting.com/rss.xml mailto:yourname@isp
Or you could download all the messages from a POP3 mailbox to a local maildir folder: copymessages.py pop3://user:pass@server file:///home/username/maildir
copymessages.py is only 54 lines of Python code. The work is all done by the messaging library and Twisted. Of course, there’s plenty of issues left untouched by this example – configuration options, URI-specific preferences, caching, etc. Support for some of these things are in the library already. The rest will be added in time.
If you’re interested in playing with the code, you can get it by following the instructions on the Hep CVS page at SourceForge.