This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Fwding with RubyMail
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
When it comes to e-mail manipulation, RubyMail has always been my answer. The fortunate thing about RubyMail is that it parses each message into RMail::Message objects, which can also be converted back into e-mail with to_s.
This makes for simple modification of messages. The issue is slightly complicated by stuff like multiple From: fields. So, if you’re forwarding a message and simply want to modify header fields, be sure to delete the fields from the message first.
Here’s an excerpt from a simple mailing list script: