Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.059 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'messages.': 0.05; 'msg': 0.09; 'skip:/ 10': 0.09; 'url:github': 0.09; 'filename:fname piece:signature': 0.16; 'formatted': 0.16; 'gpg': 0.16; 'jabber:': 0.16; 'resist': 0.16; ':-)': 0.16; 'fix': 0.17; 'tests': 0.22; 'install': 0.23; 'header:User-Agent:1': 0.23; 'skip:e 30': 0.24; '(or': 0.24; 'script': 0.25; 'possibly': 0.26; 'installed': 0.27; 'correct': 0.29; 'fixed': 0.29; 'skip:p 30': 0.29; 'etc.).': 0.31; 'purely': 0.31; 'url:cz': 0.31; 'run': 0.32; 'anybody': 0.35; 'test': 0.35; 'but': 0.35; 'thanks': 0.36; 'subject:?': 0.36; 'hi,': 0.36; 'received:209': 0.37; 'received:10': 0.37; 'to:addr :python-list': 0.38; 'does': 0.39; '(from': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'is.': 0.60; 'from:charset:utf-8': 0.61; 'more': 0.64; 'actually,': 0.84; 'apt-get': 0.84; 'fortunes': 0.84; 'received:10.36': 0.84; 'subject:good': 0.84; 'poorly': 0.93; 'reply,': 0.93 Date: Thu, 09 Jan 2014 17:05:55 +0100 From: =?UTF-8?B?TWF0xJtqIENlcGw=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Thunderbird/28.0a2 MIME-Version: 1.0 To: python-list@python.org Subject: Is email.parser a good replacement for formail? X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jEeRvShAqx9LoDL4Jil72TrqB6u3PF394" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389283566 news.xs4all.nl 2830 [2001:888:2000:d::a6]:58747 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63610 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jEeRvShAqx9LoDL4Jil72TrqB6u3PF394 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I have a script (https://github.com/mcepl/gg_scraper) where I need to read possibly malformed mbox messages. I use subprocess.Popen() and /usr/bin/formail to clean up them to be correct mbox messages (with correct leading From line etc.). Now I try to run tests for my script on Travis-CI, where I don't have installed formail. Actually, I learned now that I can run apt-get install procmail in .travis.yml. But still, I started to think whether I couldn=E2=80=99t fix my script to be purely Py= thonic. I know that msg =3D email.message_from_string(original_msg) print(msg.as_string(unixfrom=3DTrue)) works as a poor-man=E2=80=99s replacement for `formail -d`. Now, I would = like to know how reliable replacement it is. Does anybody have (or know about) a corpus of poorly formatted messages which can be fixed by formail to test upon it? Thanks a lot for any reply, Mat=C4=9Bj --=20 http://www.ceplovi.cz/matej/, Jabber: mcepl@ceplovi.cz GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC Less is more or less more. -- Y_Plentyn on #LinuxGER (from fortunes -- I cannot resist :-) --jEeRvShAqx9LoDL4Jil72TrqB6u3PF394 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iD8DBQFSzsjj4J/vJdlkhKwRAnoyAJ0aiXJSbC5GzzxQPgzTSKaki6OKagCfa9Fl wlKBE7QPQTuWaYdmmPbXHCI= =DDGj -----END PGP SIGNATURE----- --jEeRvShAqx9LoDL4Jil72TrqB6u3PF394--