From: Matt Armstrong Date: 2002-03-19T17:45:05+09:00 Subject: ANN: RubyMail 0.8 / RubyFilter 0.8 == RubyMail == RubyMail is a mail email handling library that is designed to be convenient, fast and lightweight. It understands RFC2822 messages (including the dreaded RFC822/RFC2822 email address syntax), and most of the portions of MIME that cover multipart messages. It also has very exhaustive set of unit tests -- if I am going to trust my mail to this thing I want to make sure it works. RubyMail faster at handling big messages than any other mail package written for Ruby, Python or Perl. Here is a benchmark reading a 2 megabyte multipart message and then writing it to disk 100 times: ruby 1.7.2 w/rubymail (100 times) 5.74s user 8.29s system 14.03s total ruby 1.7.2 w/tmail 0.10.1 (100 times) 7.67s user 10.89s system 18.56s total ruby 1.6.6 w/rubymail (100 times) 75.87s user 8.67s system 84.54s total python 2.2 w/email (100 times) 77.36 user 15.37s system 92.73s total perl 5.006001 w/mimetools 5.411 (parsing on disk) (100 times) 191.61s user 14.52s system 206.13s total ruby 1.6.6 w/tmail 0.10.0 (100 times) 198.28s user 14.17s system 212.45s total perl 5.006001 w/mimetools 5.411 (parsing in memory) (100 times) 971.21s user 11.19s system 982.40s total Various optimizations happened in ruby 1.7 that made both RubyMail and TMail much faster. Go Ruby! I've been writing this in one way or another for about a year, and the API has just started to become stable. http://www.lickey.com/rubymail/ Why not TMail? TMail seemed very slow in my initial tests one year ago and performance was a major concern. TMail also uses some C extensions, which I didn't want. But TMail is more mature, and also has the ability to encode/decode Japanese character sets using Ruby's native support for them. TMail is surely worth a look. == RubyFilter == RubyFilter is a rough collection of modules, classes and scripts that make up a mail filter program capable of delivering mail from your .forward or .qmail file. It uses RubyMail to do its mail manipulation, but also includes: - a module that can deliver mail to a Unix pipe, a standard Unix mbox file, or a qmail-style Maildir. - a DeliveryAgent class that can take care of executing code for you in a "safe" environment where all exceptions will be caught and logged, as well a script that exits with a temporary failure exit code when this happens (so you lose no mail). - a script that lets you write your mail filter in pure Ruby code, which allows the filter to be as flexible and complex as you want. - various other experimental classes, etc. Right now RubyFilter is so raw I won't even put it on RAA, but you can check it out at: http://www.lickey.com/rubyfilter/ It provides good examples of how to use RubyMail. -- matt