Skip to content

Instantly share code, notes, and snippets.

@pazz
Last active January 26, 2023 18:14
Show Gist options
  • Save pazz/953e0f7cce8220c59d742aecc8779bb7 to your computer and use it in GitHub Desktop.
Save pazz/953e0f7cce8220c59d742aecc8779bb7 to your computer and use it in GitHub Desktop.
msg that blows up email.message.EmailMessage.get_body
Delivered-To: [email protected]
Received: by 2002:a19:c8cb:0:0:0:0:0 with SMTP id y194csp990479lff;
Wed, 22 Apr 2020 12:20:46 -0700 (PDT)
X-Google-Smtp-Source: APiQypLkVvJqLZSsqnj/WluaxyFw+5xGAV7NMroMXfM2585L3xloa97gcNxjsUFUclVuKZdASm/p
X-Received: by 2002:adf:e5c8:: with SMTP id a8mr709981wrn.56.1587583246640;
Wed, 22 Apr 2020 12:20:46 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1587583246; cv=none;
d=google.com; s=arc-20160816;
b=kMS/kp3CjOBrwOylzhzn4tHsD3eAbFnvZTpX1IVpK8vcR6+BwYFDKitkTBy7ech+yW
hcB3RK5f+3AedMDiJ4/2uYrED9bzuKZz+k25CoyL21IPS6wn9NZThr/6j6Z/cMIX/1yg
jocDAGXLPdixPuuiUBGcB6HHQ9FPWce7Y8yuY6v7KqIhraVhsQt+qtJcfaPvj4lEdxSe
1aV8scUt5ljGj8rh/SQytVS/E9lc5TIlaBd9EVk89q/liiuc1EZmZXbqTdtQ7E3gFDZ1
WY9nqzR1EDgRT9cdmj6KvqsZudPyd6zbNE+DPgpob/1oM1Vw+YEUU1OzcgSXk2/d4xoq
ZbQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=date:to:subject:from:references:mime-version:cc:message-id
:in-reply-to;
bh=ulsX0lXL5F5STbJhegk5u8/Ugbvxv+XSPvSwEAAj85Y=;
b=hgM44FYjpOpbw91cmH68kpz6fGgxCzicGxp0pbucU0Lec/s7bMZ2WiJ2+rCZG0ZjVr
FMNclZKx+7nJSJDDa2Yv11Jsa71tpgU4PX/yW5XPtKtTq8zImAGDgR2V6VhZqNbu1PVp
48pHsTFA+47PCvosf46wOxoP+MkMxHL2butfSsLRRYwInJ//hS5rKNMTu+cx8zG1ziJC
gTl9ixm+n2dxMU+BB32g2tvbpmkL58kAXi6t4xUJ2YhKuA9ZUen84Q7yN6aF5tbI+led
0uzSXqFnBcYTT6CvI393AcZ1lRb2vDSEdtgqD/cDMkgRb/1dM0bTwamxzdZMuTj/2rtm
8ISg==
ARC-Authentication-Results: i=1; mx.google.com;
spf=neutral (google.com: 85.95.235.222 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Return-Path: <[email protected]>
Received: from nm36-mail-give.angrycalm.com (nm36-mail-give.angrycalm.com. [85.95.235.222])
by mx.google.com with ESMTP id r6si285136wrj.45.2020.04.22.12.20.45
for <[email protected]>;
Wed, 22 Apr 2020 12:20:46 -0700 (PDT)
Received-SPF: neutral (google.com: 85.95.235.222 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=85.95.235.222;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 85.95.235.222 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Received: from app19.muc.ec-messenger.com (app19.muc.ec-messenger.com )
(envelope-from <[email protected]>)
by gp13mtaq123 (mtaq-receiver/2.20190311.1) with ESMTP id yA3jJ-_S5g8Z
for <[email protected]>; Thu, 30 May 2019 19:00:22 +0200
2 Mar 2020 17:59:46 +0000 (WET)
Received: from www.takataka.gr (realshop.gr )
by uat.atnet.gr (Postfix) with ESMTPA id 24BF957C2E58
for <[email protected]>; Wed, 29 May 2019 20:27:11 +0300 (EEST)
In-Reply-To: <CADT5qSj0REQQpwKiW6P5cL27kFY85.95.235.222MN9CKmSEOMQ7yhhwm46NH1Cu5OuqVwXww@vastwasted.org>
Message-ID: <[email protected]>
Cc: <[email protected]>
X-Feedback-ID: 7748:20074871:campaign:sailthru
MIME-Version: 1.0
References: <CADT5qSj0RE5cL27kFYMN9CKmQQpwKiW6_P46NH1Cu5OuqVwXww@>
From: <[email protected]> ProvideInsurance
Subject: WelcomeTo ProvideAuto.
Content-Type: multipart/Encrypted;boundary="37514535086_394702549.1584958286511"
To: <[email protected]>
Date: Wed, 22 Apr 2020 19:18:42 UTC
X-TUID: h0MWSITrVPXV
--37514535086_394702549.1584958286511
Content-Type: multipart/parallel; boundary="___=_Part_3356294_1593387166.1587381200533"
--___=_Part_3356294_1593387166.1587381200533:
Content-Type: multipart/alternative; boundary="_=_swift_v4_1587379173_5d8cf42fae5faf0b3ab76211db382e79_=_"
----sg;qvvm;cih
----yb;ulha;fzm
--_=_swift_v4_1587379173_5d8cf42fae5faf0b3ab76211db382e79_=_
Content-Type: text/plain; charset=utf-8
----iA;pkev;qcb
----KY;wiat;adu
<p>Dear K,<br />It was a pleasure to meet you, and I’m so glad we got a chance to discuss what you’re looking for in a new home. I know this is an exciting and potentially nervous time for you, so let me say that you are in good hands. Since you mentioned that you would like to look at some different styles, I will make sure that our team gives you a variety of options. Thanks for your visit, and I hope to see you soon!</p>
--------
<p>Thank you so much for your hard work over the weekend. You showed tremendous character by keeping cool and helping us to make sure everything got done, even during such a busy time. I am glad to know that we can depend on you to stick it out when things get a little hairy, and your exceptional work ethic does not go unnoticed.
<br>
<br>——
<br>
<br>Our management is always happy to serve you! if you have any comments and suggestions regarding our services and products please feel free to share it with us. We value our customers and your opinions.
</p>
----uy;nwwp;smy
--------
<p>Thank you for choosing is. You may reach Customer Support by visiting our Submit A Ticket page.</p>
<p>Craig Levy<br />
<p>Zipcode: Zipcode Thank for your order Previously ordered | Thank for your order Thank you - your order has been received. Your Graduation Coordinator will be in touch closer to graduation to let you know when and where to collect your regalia.</p>
--------
<p>Thank you very much for your order<br />On behalf of everyone at RLOPL, we would like to thank you for vcyeef. We value the trust you have put in our UENG and would like to thank you for that. RI s always a pleasure serving you and we certainly look forward to doing that in the future. Your feedback is very important as we are constantly looking for ways to improve our Clouds. <br />Thar, you very much.</p>
----LU;lplj;esl
--_=_swift_v4_1587379173_5d8cf42fae5faf0b3ab76211db382e79_=_
Content-Type: text/html; charset=utf-8
--_=_swift_v4_1587379173_5d8cf42fae5faf0b3ab76211db382e79_=_
Content-Type: text/html; charset=utf-8
<cEnTeR><b><H1><a href="https://orebytd.storage.googleapis.com/2350#qs=r-aidjadgjjggkbdaccgjhcgaeebkfjeadegkfabababaefahcaccajbiacgebagcbhiacb">$378.92 For 6Mo.``pazz<a></h1></b><HR>
<iMG SrC="https://orebytd.storage.googleapis.com/2351" USEmAP="#OPTDOWN">
<mAP naME="OPTDOWN">
<aReA target="" alt="" title="" href="https://orebytd.storage.googleapis.com/2350#qs=r-aidjadgjjggkbdaccgjhcgaeebkfjeadegkfabababaefahcaccajbiacgebagcbhiacb" coords="0,2,602,900" shAPe="">
<aReA target="" alt="" title="" href="https://orebytd.storage.googleapis.com/2350#qs=ua-aidjadgjjggkbdaccgjhcgaeebkfjeadegkfabababaefahcaccajbiacgebagcbhiacb" coords="88,947,511,996" shAPe="">
<aReA target="" alt="" title="" hRef="https://orebytd.storage.googleapis.com/2350#qs=op-aidjadgjjggkbdaccgjhcgaeebkfjeadegkfabababaefahcaccajbiacgebagcbhiacb"coords="37,1046,557,1109" shAPe="">
<ObjecT>
<head>
--_=_swift_v4_1587379173_5d8cf42fae5faf0b3ab76211db382e79_=_--
--37514535086_394702549.1584958286511
Content-Type: text/html;
----RA;mmnb;jsq
<p>Thank you for choosing yz. You may reach Customer Support by visiting our Submit A Ticket page.</p>
<p>Craig Levy<br />
<p>Zipcode: Zipcode Thank for your order Previously ordered | Thank for your order Thank you - your order has been received. Your Graduation Coordinator will be in touch closer to graduation to let you know when and where to collect your regalia.</p>
----oZ;vmmf;uio
----RS;wsuy;ett
----ft;hxkx;lrd
----qt;vksg;vsu
UNIVERSITY GRANTS COMMISSION Total No. of Universities in the Country as on 01.02.2020 Universities Total No. State Universities 409 Deemed to be Universities 127 Central Universities 50 Private Universities 349 Total 935
<p>Dear K,<br />It was a pleasure to meet you, and I’m so glad we got a chance to discuss what you’re looking for in a new home. I know this is an exciting and potentially nervous time for you, so let me say that you are in good hands. Since you mentioned that you would like to look at some different styles, I will make sure that our team gives you a variety of options. Thanks for your visit, and I hope to see you soon!</p>
----eo;zelv;rcj
----sB;zfek;ozc
ITEM R5
OFFICE OF THE CITY MANAGER
(910) 341-7810 | FAX (910)341-5839
TDD (910)341-7873
4/21/2020
City Council
City Hall
Wilmington, North Carolina 28401
Dear Mayor and Councilmembers:
North Carolina has been under a state of emergency since March 10, 2020, in order to fight the
outbreak of the COVID-19 virus. The Governor has issued no less than twelve (12) Executive Orders
in response to the outbreak. Local governments have retained the authority to issue supplementary
local declarations of emergency in order to tailor the emergency response that is best for their
jurisdictions.
The City of Wilmington has recognized that a unified emergency response for the entirety of our county
is desirable and that local consistency is a significant help for our people. For that reason, City staff
have worked closely with county and town officials and the New Hanover County Chair has issued a
restated and amended state of emergency declaration that supersedes all previous local declarations,
includes a timetable that is consistent with the Governor's 'Stay at Home' order, and will provide the
public with a single document that sets forth the local restrictions that are in addition to the state
restrictions.
Staff recommends that City Council consent to the 4-13-20 New Hanover County state of emergency
declaration and request that it continue to apply within the corporate limits of the City of Wilmington.
Passage of the attached Resolution is recommended.
Respectfully submitted,
Sterling B. Cheatham,
City Manager
R5-1
Resolution City Council
City of Wilmington
North Carolina
Introduced By: Sterling B. Cheatham, City Manager Date: 4/21/2020
Resolution Consenting to and Requesting the Application of the New Hanover County
State of Emergency Declaration Dated April 13, 2020, to the Entirety of the Corporate
Limits of the City of Wilmington
LEGISLATIVE INTENT/PURPOSE:
WHEREAS, the COVID-19 outbreak has posed, and continues to pose, an imminent threat of
severe health consequences, including loss of life, as well as potential severe economic damages
to the City of Wilmington; and
WHEREAS, on March 10, 2020, Governor Roy Cooper issued North Carolina’s first
COVID-19 Executive Order No. 116 (EO 116), which declared a state of emergency on behalf
of the state of North Carolina in order to coordinate emergency response and to implement
protective actions to prevent the spread of COVID-19; and
WHEREAS, Governor Roy Cooper has issued several more outbreak-related Executive Orders,
including Nos. 116 - 122, 124, 125, 129, 130, and 131, all designed to fight the spread of the
virus; and
WHEREAS, New Hanover County, through its Board of Commissioners Chair Julia
Olson-Boseman, issued a state of emergency on March 20, 2020, which imposed additional
restrictions, beyond those present in EO 116, for the unincorporated areas of New Hanover
County, including prohibitions against gatherings of more than 10 people and closing public
beach access points; and
WHEREAS, on March 20, 2020, pursuant to NCGS 166A-19.22 and Section 6-17 of the
Wilmington City Code, Mayor Bill Saffo, on behalf of the City of Wilmington, consented to
New Hanover County’s declaration of state of emergency and requested for the declaration to
apply to the entirety of the corporate limits of the City of Wilmington; and
WHEREAS, on March 27, 2020, Governor Roy Cooper, in Executive Order No. 121 (EO 121),
issued a statewide Stay at Home Order beginning Monday, March 30, 2020, at 5:00 p.m., and
lasting until April 29, 2020. This order directed people to stay at home except to visit essential
businesses, exercise outdoors, or help a family member. It also provided social distancing
requirements for everyone to physically stay at least six feet apart from others and specifically
banned gatherings of more than 10 people; and
R5-2
WHEREAS, New Hanover County Board of Commissioners Chair Julia Olson-Boseman issued
an amended state of emergency on March 28, 2020, which imposed additional restrictions
beyond those present in EO 121 for the unincorporated areas of New Hanover County; and
WHEREAS, on March 30, 2020, pursuant to NCGS 166A-19.22 and Section 6-17 of the
Wilmington City Code, the City Council of the City of Wilmington consented, by Resolution, to
New Hanover County’s amended declaration of state of emergency and requested for the
declaration to apply to the entirety of the corporate limits of the City of Wilmington; and
WHEREAS, on April 9, 2020, Governor Roy Cooper, in Executive Order No. 131 (EO 131),
established emergency occupancy limits and cleaning requirements for retail establishments and
long-term care facilities beginning Friday, April 10, 2020, at 5:00 p.m., and lasting until May
13, 2020; and
WHEREAS, New Hanover County Board of Commissioners Chair Julia Olson-Boseman issued
a restated state of emergency that began on April 13, 2020, at 5:00 p.m. and lasting until April
29, 2020, at 5:00 p.m., (attached as Exhibit A to this Resolution) which revised and superseded
the restrictions in the previous New Hanover County declarations, amended or otherwise, and
beyond those present in EO 121 and EO 131 for the unincorporated areas of New Hanover
County; and
WHEREAS, on April 13, 2020, and again on April 17, 2020, by way of a renewal and
extension, and pursuant to NCGS 166A-19.22 and Section 6-17 of the Wilmington City Code,
Mayor Bill Saffo, on behalf of the City of Wilmington, consented to New Hanover County’s
declaration of April 13, 2020, state of emergency and requested for the declaration to apply to
the entirety of the corporate limits of the City of Wilmington; and
WHEREAS, the Wilmington City Council has determined that the revised restrictions imposed
by the April 13, 2020 New Hanover County state of emergency declaration are appropriate and
necessary to slow the rate of the spread of the virus in our area based on the current evidence,
cases, and projections.
THEREFORE BE IT RESOLVED:
THAT, pursuant to N.C.G.S. Sec. 166A-19.22(b)(2), the Wilmington City Council does hereby
consent to New Hanover County’s state of emergency declaration dated April 13, 2020, and
does hereby request for the declaration to apply to the entirety of the corporate limits of the City
of Wilmington; and
THAT, this Resolution becomes effective at 5:00 p.m. on Monday, April 13, 2020, and will
remain in effect until Wednesday, April 29, 2020, at 5:00 p.m., unless earlier amended or
rescinded; and
R5-3
THAT, nothing in this Resolution is intended to lessen or limit any previous orders of the state
that are already in effect and applicable to the City of Wilmington; and
THAT, to the extent that the additional restrictions in this Resolution do conflict with previous
applicable resolutions, the most restrictive provision shall apply.
Bill Saffo, Mayor
ATTEST: APPROVED AS TO FORM:
Penelope Spicer-Sidbury, City Clerk City Attorney
Adopted at a ________________ meeting
on ____________________ 2020
@pazz
Copy link
Author

pazz commented Jun 17, 2020

In [13]: with open('msg', 'rb') as f: 
    ...:     m = email.message_from_binary_file(f, _class=email.message.EmailMessage) 
    ...:                                                                                                            

In [14]: m.get_body()                                                                                               
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-0d3554e3ba7a> in <module>
----> 1 m.get_body()

/usr/lib/python3.8/email/message.py in get_body(self, preferencelist)
   1016         best_prio = len(preferencelist)
   1017         body = None
-> 1018         for prio, part in self._find_body(self, preferencelist):
   1019             if prio < best_prio:
   1020                 best_prio = prio

/usr/lib/python3.8/email/message.py in _find_body(self, part, preferencelist)
    987         if subtype != 'related':
    988             for subpart in part.iter_parts():
--> 989                 yield from self._find_body(subpart, preferencelist)
    990             return
    991         if 'related' in preferencelist:

/usr/lib/python3.8/email/message.py in _find_body(self, part, preferencelist)
    987         if subtype != 'related':
    988             for subpart in part.iter_parts():
--> 989                 yield from self._find_body(subpart, preferencelist)
    990             return
    991         if 'related' in preferencelist:

/usr/lib/python3.8/email/message.py in _find_body(self, part, preferencelist)
    976 
    977     def _find_body(self, part, preferencelist):
--> 978         if part.is_attachment():
    979             return
    980         maintype, subtype = part.get_content_type().split('/')

AttributeError: 'str' object has no attribute 'is_attachment'

@Hybbf
Copy link

Hybbf commented Jan 26, 2023

Hi pls i need help when my message go from inbox to spam after 15 min to 30 min any solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment