Retrieving email message body only via 'net/pop'

D

dazzle

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.
 
B

Brian Candler

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top