[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Retrieving email message body only via 'net/pop'

dazzle

3/8/2007 10:30:00 AM

Hi,

Is it possible to retrieive just the email message body using 'net/
pop' or is there another Ruby POP3 library where you can do this?

All help, code etc appreciated.

1 Answer

Brian Candler

3/8/2007 12:30:00 PM

0

On Thu, Mar 08, 2007 at 07:35:10PM +0900, dazzle wrote:
> Is it possible to retrieive just the email message body using 'net/
> pop' or is there another Ruby POP3 library where you can do this?

The POP3 protocol (RFC 1939) has a command to retrieve the headers without
the body, but not the body without the headers.

If the library offered a way to retrieve just the body, it would still have
to retrieve the whole lot, and then trim off the head. So you could just do
that yourself:

headers, body = message.split(/\r\n\r\n/, 2)