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/ Martin 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]'] > > thanks