Retrieving email message body only via 'net/pop'

Discussion in 'Ruby' started by dazzle, Mar 8, 2007.

  1. dazzle

    dazzle Guest

    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.
     
    dazzle, Mar 8, 2007
    #1
    1. Advertising

  2. 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)
     
    Brian Candler, Mar 8, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marc Van Laer
    Replies:
    0
    Views:
    423
    Marc Van Laer
    Apr 11, 2005
  2. divya
    Replies:
    1
    Views:
    353
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
  3. srinivasan srinivas
    Replies:
    0
    Views:
    256
    srinivasan srinivas
    Dec 3, 2008
  4. Replies:
    1
    Views:
    199
  5. Replies:
    8
    Views:
    251
    Bart Van der Donck
    Nov 10, 2007
Loading...

Share This Page