From: Eric Hodel Date: 2007-01-21T06:54:34+09:00 Subject: Re: IMAP stuff (or POP) On Jan 19, 2007, at 04:01, Martin Boese wrote: > On Thursday 18 January 2007 20:52, Phil Cooperking wrote: >> I've been trying to find a good source of imap or pop information >> with >> ruby and cant. maybe I'm missing somthing. >> >> as I understand with imap you can select parts of the BODY like >> [TEXT] >> [1]. I understand what text does but I was underthe impression >> that [1] >> would select just the plain text. with that does'nt always seem to be >> the case with my test program. most of the results will come in plain >> text then some will contain a both multiparts. So does [1] actually >> do(mean). >> >> What I'm trying to do is strip everything from the mail apart from >> the >> Enevelope and the plain text. can somebody point me in the right >> direction? this is the line of code that I've been using to pull the >> email with >> >> mail.message = imap.fetch(message_id, 'BODY[1]')[0].attr['BODY[1]'] > > If it is an option for you, try downloading the entire mail and use > tmail or > rubymail to parse/split it. Maybe the problem is with your imap > server. > > http://www.lickey.com/rubymail/ > http://i.loveruby.net/en/projects/tmail/ No need. The IMAP RFC, like most RFCs, takes a little practice to read. Plus you save bandwidth and processing time by only downloading the chunks of the message you need. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net A: Yes Q: Is top-posting bad? � Derek Milhous Zumsteg