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

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

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. TaeHo Yoo
    Replies:
    1
    Views:
    1,880
    martin
    Apr 19, 2004
  2. Marc Van Laer
    Replies:
    0
    Views:
    509
    Marc Van Laer
    Apr 11, 2005
  3. Max M
    Replies:
    1
    Views:
    346
    Tim Howarth
    Oct 7, 2003
  4. divya
    Replies:
    1
    Views:
    422
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
  5. srinivasan srinivas
    Replies:
    0
    Views:
    343
    srinivasan srinivas
    Dec 3, 2008
  6. Replies:
    1
    Views:
    290
  7. Replies:
    8
    Views:
    390
    Bart Van der Donck
    Nov 10, 2007
  8. W. Trevor King
    Replies:
    0
    Views:
    190
    W. Trevor King
    Jan 24, 2013
Loading...