On 10/22/2016 11:56 PM, Jason Friedman wrote:
>>
>> for message in mailbox.mbox(sys.argv[1]):
>> if message.has_key("From") and message.has_key("To"):
>> addrs = message.get_all("From")
>> addrs.extend(message.get_all("To"))
>> for addr in add
On 2016-10-23, Jason Friedman wrote:
>>
>> for message in mailbox.mbox(sys.argv[1]):
>> if message.has_key("From") and message.has_key("To"):
>> addrs = message.get_all("From")
>> addrs.extend(message.get_all("To"))
>> for addr in addrs:
>>
On 2016-10-23, Jon Ribbens wrote:
> On 2016-10-23, Jason Friedman wrote:
>>>
>>> for message in mailbox.mbox(sys.argv[1]):
>>> if message.has_key("From") and message.has_key("To"):
>>> addrs = message.get_all("From")
>>> addrs.extend(message.get_all("To"))
>
> for message in mailbox.mbox(sys.argv[1]):
> if message.has_key("From") and message.has_key("To"):
> addrs = message.get_all("From")
> addrs.extend(message.get_all("To"))
> for addr in addrs:
> addrl = addr.lower()
>
Sat, 22 Oct 2016 19:41:45 -0400 wrote Adam Jensen:
> On 10/22/2016 05:47 AM, andy wrote:
>> I would type: help(mailbox) after importing it.
>
> I guess the output of that might be more meaningful once I understand
> the underlying structures and conventions.
yes - you are right. fortunatelly pyt
On 10/21/2016 11:22 PM, MRAB wrote:
> The docs say that it's subclass of the email.message module's Message.
>
> You can get the email's header fields like it's a dict, except that the
> field names are case-insensitive. The author(s) of the module couldn't
> use a true dict because of the need fo
On 10/22/2016 03:24 AM, dieter wrote:
> In addition to the previous (excellent) responses:
>
> A "message" models a MIME (RFC1521 Multipurpose Internet Mail Extensions)
> message (the international standard for the structure of emails).
> The standard tells you that a message consists essentially
On 10/22/2016 05:47 AM, andy wrote:
> I would type: help(mailbox) after importing it.
I guess the output of that might be more meaningful once I understand
the underlying structures and conventions.
--
https://mail.python.org/mailman/listinfo/python-list
On 10/21/2016 11:45 PM, Ben Finney wrote:
> So each instance you're getting has (a superset of) the API of
> ``email.message.Message``, which is a lot of behaviour
> https://docs.python.org/2.7/library/email.message.html#email.message.Message>
> including being able to interrogate the message heade
Fri, 21 Oct 2016 22:43:55 -0400 wrote Adam Jensen:
> The mailbox library documentation seems to be a little weak. In this
> example:
>
> https://docs.python.org/2.7/library/mailbox.html#examples
>
> import mailbox for message in mailbox.mbox('~/mbox'):
> subject = message['subject'] #
Adam Jensen writes:
> ...
> https://docs.python.org/2.7/library/mailbox.html#examples
>
> import mailbox
> for message in mailbox.mbox('~/mbox'):
> subject = message['subject'] # Could possibly be None.
> if subject and 'python' in subject.lower():
> print subject
>
> What is
Adam Jensen writes:
> import mailbox
> for message in mailbox.mbox('~/mbox'):
> subject = message['subject'] # Could possibly be None.
> if subject and 'python' in subject.lower():
> print subject
>
> What is the structure of "message"?
You're binding that name to each item
On 2016-10-22 03:43, Adam Jensen wrote:
The mailbox library documentation seems to be a little weak. In this
example:
https://docs.python.org/2.7/library/mailbox.html#examples
import mailbox
for message in mailbox.mbox('~/mbox'):
subject = message['subject'] # Could possibly be None.
13 matches
Mail list logo