extract-msg 0.48.1__tar.gz → 0.48.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {extract_msg-0.48.1 → extract_msg-0.48.2}/CHANGELOG.md +3 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/PKG-INFO +3 -3
- {extract_msg-0.48.1 → extract_msg-0.48.2}/README.rst +2 -2
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/__init__.py +2 -2
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/message_base.py +30 -10
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/PKG-INFO +3 -3
- {extract_msg-0.48.1 → extract_msg-0.48.2}/setup.cfg +1 -1
- {extract_msg-0.48.1 → extract_msg-0.48.2}/LICENSE.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/MANIFEST.in +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/__main__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/_rtf/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/_rtf/create_doc.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/_rtf/inject_rtf.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/_rtf/token.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/_rtf/tokenize_rtf.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/attachment.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/attachment_base.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/broken_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/custom_handler.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/lnk_obj_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/outlook_image_dib.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/emb_msg_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/signed_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/unsupported_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/web_att.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/constants/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/constants/ps.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/constants/re.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/constants/st.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/data/logging-config/logging-nt.json +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/data/logging-config/logging-posix.json +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_mac_ce.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_mac_cyrillic.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_mac_greek.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_mac_iceland.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_mac_turkish.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_win874_dec.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/_dt/_win950_dec.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/encoding/utils.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/enums.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/exceptions.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/appointment.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/calendar.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/calendar_base.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/contact.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/journal.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_cancellation.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_exception.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_forward.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_related.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_request.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/meeting_response.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/message.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/message_signed.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/message_signed_base.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/msg.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/post.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/sticky_note.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/task.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/msg_classes/task_request.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/null_date.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/ole_writer.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/open_msg.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/properties/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/properties/named.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/properties/prop.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/properties/properties_store.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/py.typed +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/recipient.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/__init__.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/_helpers.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/business_card.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/cfoas.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/contact_link_entry.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/dev_mode_a.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/dv_target_device.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/entry_id.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/misc_id.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/mon_stream.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/odt.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/ole_pres.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/ole_stream_struct.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/recurrence_pattern.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/report_tag.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/system_time.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/time_zone_definition.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/time_zone_struct.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/toc_entry.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/structures/tz_rule.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/utils.py +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/SOURCES.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/dependency_links.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/entry_points.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/requires.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg.egg-info/top_level.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/requirements.txt +0 -0
- {extract_msg-0.48.1 → extract_msg-0.48.2}/setup.py +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
**v0.48.2**
|
|
2
|
+
* Fixed bugs with `MessageBase.asEmailMessage()`. Numerous improvements to how it handles the data.
|
|
3
|
+
|
|
1
4
|
**v0.48.1**
|
|
2
5
|
* Added an option (`-s`, `--stdin`) to the command line to take an MSG file from stdin. This allows the user to pipe the MSG data from another program directly instead of having to write a middleman that uses the `extract-msg` library directly or having to write the file to the disk first.
|
|
3
6
|
* Changed main function to allow for manual argument list to be passed to it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: extract_msg
|
|
3
|
-
Version: 0.48.
|
|
3
|
+
Version: 0.48.2
|
|
4
4
|
Summary: Extracts emails and attachments saved in Microsoft Outlook's .msg files
|
|
5
5
|
Home-page: https://github.com/TeamMsgExtractor/msg-extractor
|
|
6
6
|
Download-URL: https://github.com/TeamMsgExtractor/msg-extractor/archives/master
|
|
@@ -278,8 +278,8 @@ your access to the newest major version of extract-msg.
|
|
|
278
278
|
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
|
|
279
279
|
:target: LICENSE.txt
|
|
280
280
|
|
|
281
|
-
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.
|
|
282
|
-
:target: https://pypi.org/project/extract-msg/0.48.
|
|
281
|
+
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.2-blue.svg
|
|
282
|
+
:target: https://pypi.org/project/extract-msg/0.48.2/
|
|
283
283
|
|
|
284
284
|
.. |PyPI2| image:: https://img.shields.io/badge/python-3.8+-brightgreen.svg
|
|
285
285
|
:target: https://www.python.org/downloads/release/python-3810/
|
|
@@ -260,8 +260,8 @@ your access to the newest major version of extract-msg.
|
|
|
260
260
|
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
|
|
261
261
|
:target: LICENSE.txt
|
|
262
262
|
|
|
263
|
-
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.
|
|
264
|
-
:target: https://pypi.org/project/extract-msg/0.48.
|
|
263
|
+
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.2-blue.svg
|
|
264
|
+
:target: https://pypi.org/project/extract-msg/0.48.2/
|
|
265
265
|
|
|
266
266
|
.. |PyPI2| image:: https://img.shields.io/badge/python-3.8+-brightgreen.svg
|
|
267
267
|
:target: https://www.python.org/downloads/release/python-3810/
|
|
@@ -27,8 +27,8 @@ https://github.com/TeamMsgExtractor/msg-extractor
|
|
|
27
27
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
28
28
|
|
|
29
29
|
__author__ = 'Destiny Peterson & Matthew Walker'
|
|
30
|
-
__date__ = '2024-03-
|
|
31
|
-
__version__ = '0.48.
|
|
30
|
+
__date__ = '2024-03-09'
|
|
31
|
+
__version__ = '0.48.2'
|
|
32
32
|
|
|
33
33
|
__all__ = [
|
|
34
34
|
# Modules:
|
|
@@ -24,7 +24,10 @@ import RTFDE
|
|
|
24
24
|
import RTFDE.exceptions
|
|
25
25
|
|
|
26
26
|
from email import policy
|
|
27
|
+
from email.charset import Charset, QP
|
|
27
28
|
from email.message import EmailMessage
|
|
29
|
+
from email.mime.multipart import MIMEMultipart
|
|
30
|
+
from email.mime.text import MIMEText
|
|
28
31
|
from email.parser import HeaderParser
|
|
29
32
|
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Type, Union
|
|
30
33
|
|
|
@@ -151,13 +154,24 @@ class MessageBase(MSGFile):
|
|
|
151
154
|
|
|
152
155
|
# Copy the headers.
|
|
153
156
|
for key, value in self.header.items():
|
|
154
|
-
|
|
157
|
+
if key.lower() != 'content-type':
|
|
158
|
+
ret[key] = value.replace('\r\n', '').replace('\n', '')
|
|
159
|
+
|
|
160
|
+
ret['Content-Type'] = 'multipart/mixed'
|
|
155
161
|
|
|
156
162
|
# Attach the body to the EmailMessage instance.
|
|
163
|
+
msgMain = MIMEMultipart('related')
|
|
164
|
+
ret.attach(msgMain)
|
|
165
|
+
bodyParts = MIMEMultipart('alternative')
|
|
166
|
+
msgMain.attach(bodyParts)
|
|
167
|
+
|
|
168
|
+
c = Charset('utf-8')
|
|
169
|
+
c.body_encoding = QP
|
|
170
|
+
|
|
171
|
+
if self.body:
|
|
172
|
+
bodyParts.attach(MIMEText(self.body, 'plain', c))
|
|
157
173
|
if self.htmlBody:
|
|
158
|
-
|
|
159
|
-
elif self.body:
|
|
160
|
-
ret.set_content(self.body, cte = 'quoted-printable')
|
|
174
|
+
bodyParts.attach(MIMEText(self.htmlBody.decode('utf-8'), 'html', c))
|
|
161
175
|
|
|
162
176
|
# Process attachments.
|
|
163
177
|
for att in self.attachments:
|
|
@@ -167,7 +181,7 @@ class MessageBase(MSGFile):
|
|
|
167
181
|
filename = att.getFilename()
|
|
168
182
|
if filename.lower().endswith('.msg'):
|
|
169
183
|
filename = filename[:-4] + '.eml'
|
|
170
|
-
|
|
184
|
+
msgMain.add_attachment(
|
|
171
185
|
att.data.asEmailMessage(),
|
|
172
186
|
filename = filename,
|
|
173
187
|
cid = att.contentId)
|
|
@@ -183,11 +197,17 @@ class MessageBase(MSGFile):
|
|
|
183
197
|
raise ConversionError(f'Could not find a suitable method to attach attachment data type "{att.dataType}".')
|
|
184
198
|
mime = att.mimetype or 'application/octet-stream'
|
|
185
199
|
mainType, subType = mime.split('/')[0], mime.split('/')[-1]
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
# Need to do this manually instead of using add_attachment.
|
|
201
|
+
attachment = EmailMessage()
|
|
202
|
+
attachment.set_content(data,
|
|
203
|
+
maintype = mainType,
|
|
204
|
+
subtype = subType,
|
|
205
|
+
cid = att.contentId)
|
|
206
|
+
# This is just a very basic check.
|
|
207
|
+
attachment['Content-Disposition'] = f'{"inline" if att.hidden else "attachment"}; filename="{att.getFilename()}"'
|
|
208
|
+
|
|
209
|
+
# Add the attachment.
|
|
210
|
+
msgMain.attach(attachment)
|
|
191
211
|
|
|
192
212
|
return ret
|
|
193
213
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: extract-msg
|
|
3
|
-
Version: 0.48.
|
|
3
|
+
Version: 0.48.2
|
|
4
4
|
Summary: Extracts emails and attachments saved in Microsoft Outlook's .msg files
|
|
5
5
|
Home-page: https://github.com/TeamMsgExtractor/msg-extractor
|
|
6
6
|
Download-URL: https://github.com/TeamMsgExtractor/msg-extractor/archives/master
|
|
@@ -278,8 +278,8 @@ your access to the newest major version of extract-msg.
|
|
|
278
278
|
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
|
|
279
279
|
:target: LICENSE.txt
|
|
280
280
|
|
|
281
|
-
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.
|
|
282
|
-
:target: https://pypi.org/project/extract-msg/0.48.
|
|
281
|
+
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.48.2-blue.svg
|
|
282
|
+
:target: https://pypi.org/project/extract-msg/0.48.2/
|
|
283
283
|
|
|
284
284
|
.. |PyPI2| image:: https://img.shields.io/badge/python-3.8+-brightgreen.svg
|
|
285
285
|
:target: https://www.python.org/downloads/release/python-3810/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/attachments/custom_att_handler/lnk_obj_att.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{extract_msg-0.48.1 → extract_msg-0.48.2}/extract_msg/data/logging-config/logging-posix.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|