Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77540 > unrolled thread

Re: Best way to filter parts of a email.message.Message

Started byTim Chase <python.list@tim.thechases.com>
First post2014-09-04 05:45 -0500
Last post2014-09-04 05:45 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Best way to filter parts of a email.message.Message Tim Chase <python.list@tim.thechases.com> - 2014-09-04 05:45 -0500

#77540 — Re: Best way to filter parts of a email.message.Message

FromTim Chase <python.list@tim.thechases.com>
Date2014-09-04 05:45 -0500
SubjectRe: Best way to filter parts of a email.message.Message
Message-ID<mailman.13763.1409827608.18130.python-list@python.org>
On 2014-09-04 14:08, Chris Angelico wrote:
> On Thu, Sep 4, 2014 at 1:52 PM, Cameron Simpson wrote:
>> On 03Sep2014 20:59, Tim Chase wrote:
>>> - mime-parts can be nested, so I need to recursively handle them
>>
>> Just to this. IIRC, the MIME part delimiter is supposed to be
>> absolute. That is, it will not occur in the nested subparts, if
>> any.
>
> I think the point here is that the validity check of a mime-part may
> involve checking sub-parts - eg the message is a mailing list digest
> (with one part per actual message), and some of those have
> attachments, which are to be stripped off if over 1MB.

Indeed, ChrisA divined my intent--an attachment remover based on
various types of mime-type and size tests.  A cursory search didn't
turn up any pre-existing utilities that did quite what I wanted.

Perhaps my previous message about detecting mbox-vs-maildir-vs-mh
format mailboxes hinted at this.  Thanks to all who answered there
(though I encountered a possible bug, as Claws Mail doesn't put
a .mh_sequences file in what it claims are MH local folders which
causes issues with MH() http://bugs.python.org/issue22319 ).

So the goal is to keep the original message with highest fidelity
while still stripping out the undesirable attachments.

Thanks for your thoughts,

-tkc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web