Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 06/04/07, Tim Williams <[EMAIL PROTECTED]> wrote: > Content: ['text/plain', 'text/html', 'message/delivery-status', > 'text/plain', 'text/plain', 'text/plain', 'unknown', 'message/rfc822', > 'text/plain', 'text/html'] I should explain that this was the content in a single email > > # part.get

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 05/04/07, Collin Stocks <[EMAIL PROTECTED]> wrote: > On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > Using poplib in python I can extract only the headers using the .top, > > there is a way to extract only the message text without the headers? > > > so get

Re: way to extract only the message from pop3

2007-04-05 Thread Collin Stocks
I only put None there so that the colon would be more visible: in some browser fonts, [value:] looks the same as [value] On 4/5/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Thu, 05 Apr 2007 15:09:18 -0300, Collin Stocks <[EMAIL PROTECTED]> escribió: > message=whole_message[len(headers):

Re: way to extract only the message from pop3

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 15:09:18 -0300, Collin Stocks <[EMAIL PROTECTED]> escribió: > message=whole_message[len(headers):None] > > You can omit the word None: it is just there for clarity purposes. Uhm... I can't find any usage of slices including an explicit None in code.google.com (except on th

Re: way to extract only the message from pop3

2007-04-05 Thread Collin Stocks
so get two strings: only headers, and the whole message. find the length of the headers, and chop that off the beginning of the whole message: message=whole_message[len(headers):None] You can omit the word None: it is just there for clarity purposes. On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL

Re: way to extract only the message from pop3

2007-04-05 Thread hlubenow
flit wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? As mentioned before, you should use module "email": #!/usr/bin/env python import popli

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL PROTECTED]> wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? for i in range( M.stat()[0] ): # M.stat returns msg-count and mbox size ms

Re: way to extract only the message from pop3

2007-04-04 Thread flit
Yep you are right.. I made an filter to get the data in the message I want.. So it´s not the most beatiful code, but works. :) On Apr 4, 4:11 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > "flit" <[EMAIL PROTECTED]> wrote: > > >Using poplib in python I can extract only the headers using the .top, >

Re: way to extract only the message from pop3

2007-04-04 Thread Tim Roberts
"flit" <[EMAIL PROTECTED]> wrote: > >Using poplib in python I can extract only the headers using the .top, >there is a way to extract only the message text without the headers? Only by using Python code. The other responses gave you good pointers toward that path, but I thought I would point out

Re: way to extract only the message from pop3

2007-04-03 Thread hlubenow
[EMAIL PROTECTED] wrote: > I found a tutorial on parsing email that should help you: > > http://www.devshed.com/c/a/Python/Python-Email-Libraries-SMTP-and-Email-Parsing/ > > Also see the email module: > > http://www.python.org/doc/2.3.5/lib/module-email.html > > Mike Well, I couldn't work wit

Re: way to extract only the message from pop3

2007-04-03 Thread kyosohma
On Apr 3, 2:36 pm, "flit" <[EMAIL PROTECTED]> wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? > > like remove the fields below: > " > Return-Path: > X-Original-To: > Received: from [

way to extract only the message from pop3

2007-04-03 Thread flit
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: " Return-Path: X-Original-To: Received: from [ by (Postfix) with ESMTP id B32382613C for Tue, 3 Apr