Skip to content

Commit

Permalink
+MailAttachment.__str__, fix MailMessage.text,html
Browse files Browse the repository at this point in the history
  • Loading branch information
ikvk committed Jan 10, 2025
1 parent 33da329 commit 329fe0f
Show file tree
Hide file tree
Showing 99 changed files with 137 additions and 114 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ High level lib for work with email by IMAP:
.. image:: https://img.shields.io/pypi/dm/imap_tools.svg?style=social

=============== ================================================================================================
Python version 3.5+
Python version 3.8+
License Apache-2.0
PyPI https://pypi.python.org/pypi/imap_tools/
RFC `IMAP4.1 <https://tools.ietf.org/html/rfc3501>`_,
Expand Down
7 changes: 7 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.9.0
=====
* Added: __str__ to MailAttachment
* Fixed: MailMessage.text parser - text with inline attachments case
* Fixed: MailMessage.html parser - html with inline attachments case
* Dropped: support py3.3,py3.4,py3.5,py3.6,py3.7

1.8.0
=====
* Added: BaseMailBox.numbers_to_uids - Get message uids by message numbers
Expand Down
2 changes: 1 addition & 1 deletion imap_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from .utils import EmailAddress
from .errors import *

__version__ = '1.8.0'
__version__ = '1.9.0'
3 changes: 3 additions & 0 deletions imap_tools/consts.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import re
import sys

SHORT_MONTH_NAMES = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')

UID_PATTERN = re.compile(r'(^|\s+|\W)UID\s+(?P<uid>\d+)')

CODECS_OFFICIAL_REPLACEMENT_CHAR = '�'

PYTHON_VERSION_MINOR = int(sys.version_info.minor)


class MailMessageFlags:
"""
Expand Down
5 changes: 1 addition & 4 deletions imap_tools/mailbox.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re
import sys
import imaplib
import datetime
from collections import UserString
Expand All @@ -8,7 +7,7 @@
from .message import MailMessage
from .folder import MailBoxFolderManager
from .idle import IdleManager
from .consts import UID_PATTERN
from .consts import UID_PATTERN, PYTHON_VERSION_MINOR
from .utils import clean_uids, check_command_status, chunks, encode_folder, clean_flags, check_timeout_arg_support, \
chunks_crop
from .errors import MailboxStarttlsError, MailboxLoginError, MailboxLogoutError, MailboxNumbersError, \
Expand All @@ -21,8 +20,6 @@

Criteria = Union[AnyStr, UserString]

PYTHON_VERSION_MINOR = sys.version_info.minor


class BaseMailBox:
"""Working with the email box"""
Expand Down
13 changes: 9 additions & 4 deletions imap_tools/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,26 @@ def date(self) -> datetime.datetime:
@lru_cache()
def text(self) -> str:
"""Plain text of the mail message"""
results = []
for part in self.obj.walk():
if part.get_content_maintype() == 'multipart' or part.get_filename():
continue
if part.get_content_type() in ('text/plain', 'text/'):
return decode_value(part.get_payload(decode=True), part.get_content_charset())
return ''
results.append(decode_value(part.get_payload(decode=True), part.get_content_charset()))
return ''.join(results)

@property
@lru_cache()
def html(self) -> str:
"""HTML text of the mail message"""
results = []
for part in self.obj.walk():
if part.get_content_maintype() == 'multipart' or part.get_filename():
continue
if part.get_content_type() == 'text/html':
html = decode_value(part.get_payload(decode=True), part.get_content_charset())
return replace_html_ct_charset(html, 'utf-8')
return ''
results.append(replace_html_ct_charset(html, 'utf-8'))
return ''.join(results)

@property
@lru_cache()
Expand Down Expand Up @@ -233,6 +235,9 @@ class MailAttachment:
def __init__(self, part):
self.part = part

def __str__(self):
return '<{} | {} | {} | {}>'.format(self.filename, self.content_type, self.content_disposition, self.content_id)

@property
@lru_cache()
def filename(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion imap_tools/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
all: Optional[bool] = None, # noqa
uid: Optional[Union[str, Iterable[str], UidRange]] = None,
header: Optional[Union[Header, List[Header]]] = None,
gmail_label: Optional[Union[str, List[str]]] = None): # todo newline after drop 3.5
gmail_label: Optional[Union[str, List[str]]] = None):
self.converted_strings = converted_strings
for val in converted_strings:
if not any(isinstance(val, t) for t in (str, UserString)):
Expand Down
8 changes: 7 additions & 1 deletion imap_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ def replace_html_ct_charset(html: str, new_charset: str) -> str:
meta_ct_match = re.search(r'<\s*meta .*?content-type.*?>', html, re.IGNORECASE | re.DOTALL)
if meta_ct_match:
meta = meta_ct_match.group(0)
meta_new = re.sub(r'charset\s*=\s*[a-zA-Z0-9_:.+-]+', 'charset={}'.format(new_charset), meta, 1, re.IGNORECASE)
meta_new = re.sub(
pattern=r'charset\s*=\s*[a-zA-Z0-9_:.+-]+',
repl='charset={}'.format(new_charset),
string=meta,
count=1,
flags=re.IGNORECASE
)
html = html.replace(meta, meta_new)
return html

Expand Down
2 changes: 1 addition & 1 deletion tests/messages_data/address_quoted_newlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=('[email protected]', '[email protected]', '[email protected]'),
bcc=('[email protected]', '[email protected]', '[email protected]'),
reply_to=(),
date=datetime.datetime(2020, 11, 1, 14, 49, 7, tzinfo=datetime.timezone(datetime.timedelta(-1, 57600))),
date=datetime.datetime(2020, 11, 1, 14, 49, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=57600))),
date_str='Mon, 01 Nov 2020 14:49:07 -0800 (PST)',
text='Daily Data: D09.ZPH (Averaged data)\nEmail generated: 10/11/2020 00:04:03.765\nEmail sent: 10/11/2020 00:49:03.125',
html='',
Expand Down
2 changes: 1 addition & 1 deletion tests/messages_data/att_name_in_content_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2020, 11, 9, 14, 49, 7, tzinfo=datetime.timezone(datetime.timedelta(-1, 57600))),
date=datetime.datetime(2020, 11, 9, 14, 49, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=57600))),
date_str='Mon, 09 Nov 2020 14:49:07 -0800 (PST)',
text='Daily Data: D09.ZPH (Averaged data)\nEmail generated: 10/11/2020 00:04:03.765\nEmail sent: 10/11/2020 00:49:03.125',
html='',
Expand Down
4 changes: 2 additions & 2 deletions tests/messages_data/attachment_2_base64.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/messages_data/attachment_7bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2017, 10, 12, 9, 41, 56, tzinfo=datetime.timezone(datetime.timedelta(0, 18000))),
date=datetime.datetime(2017, 10, 12, 9, 41, 56, tzinfo=datetime.timezone(datetime.timedelta(seconds=18000))),
date_str='Thu, 12 Oct 2017 09:41:56 +0500',
text='\r\n',
text='\r\nНовый заказ №28922 http://group.company.ru/ru/order/28922/process/\r\nСоздал: \r\nКлиент Ковчег (Гусев Дмитрий)\r\n\r\nСегменты:\r\n\r\n- Москва - Тель-Авив, some-889, 15.03.2018, эконом: (15 взр.)\r\n\r\n- Тель-Авив - Москва, some-890, 22.03.2018, эконом: (15 взр.)',
html='\r\n\r\n <!DOCTYPE html PUBLIC \'-//W3C//DTD XHTML 1.0 Strict//EN\' \'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\'>\r\n <html xmlns=\'http://www.w3.org/1999/xhtml\' lang=\'ru-ru\'\r\n xml:lang=\'en-us\'>\r\n <head>\r\n <meta content="text/html; charset=utf-8" http-equiv="Content-Type">\r\n \r\n </head>\r\n\r\n <body id=\'body\'>\r\n \r\n \r\n \r\n <a href="http://group.company.ru/ru/order/28922/process/">\r\n \r\n Новый заказ №28922\r\n </a><br>\r\n\r\n \r\n Создал:\r\n \r\n Клиент Ковчег\r\n (Гусев Дмитрий)\r\n <br><br>\r\n \r\n Сегменты: <br>\r\n <ul>\r\n \r\n <li>Москва - Тель-Авив, some-889, 15.03.2018, эконом: (15 взр.)</li>\r\n \r\n <li>Тель-Авив - Москва, some-890, 22.03.2018, эконом: (15 взр.)</li>\r\n \r\n </ul><br>\r\n \r\n \r\n \r\n\r\n </body>\r\n </html>\r\n\r\n',
headers={'return-path': ('[email protected]',), 'received': ('from m101.comp.ru (LHLO m101.comp.ru) (192.168.99.101) by m101.comp.ru\r\n with LMTP; Thu, 12 Oct 2017 09:41:57 +0500 (YEKT)', 'from localhost (localhost [127.0.0.1])\r\n\tby m101.comp.ru (Postfix) with ESMTP id 555275B43;\r\n\tThu, 12 Oct 2017 09:41:57 +0500 (YEKT)', 'from m101.comp.ru ([127.0.0.1])\r\n\tby localhost (m101.comp.ru [127.0.0.1]) (amavisd-new, port 10032)\r\n\twith ESMTP id rY6SAtl4piy1; Thu, 12 Oct 2017 09:41:56 +0500 (YEKT)', 'from localhost (localhost [127.0.0.1])\r\n\tby m101.comp.ru (Postfix) with ESMTP id C8F0F5B4B;\r\n\tThu, 12 Oct 2017 09:41:56 +0500 (YEKT)', 'from m101.comp.ru ([127.0.0.1])\r\n\tby localhost (m101.comp.ru [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id kq2wE_i9_8EK; Thu, 12 Oct 2017 09:41:56 +0500 (YEKT)', 'from [192.168.104.80] (notebook26.hades.company [192.168.104.80])\r\n\tby m101.comp.ru (Postfix) with ESMTPSA id 9563A5B44\r\n\tfor <[email protected]>; Thu, 12 Oct 2017 09:41:56 +0500 (YEKT)'), 'x-spam-flag': ('NO',), 'x-spam-score': ('-2.898',), 'x-spam-level': ('',), 'x-spam-status': ('No, score=-2.898 required=6.6 tests=[ALL_TRUSTED=-1,\r\n\tBAYES_00=-1.9, HTML_MESSAGE=0.001, URIBL_BLOCKED=0.001]\r\n\tautolearn=ham autolearn_force=no',), 'x-virus-scanned': ('amavisd-new at m101.comp.ru',), 'references': ('<[email protected]>',), 'subject': ('=?UTF-8?B?0YHRgtCw0YLRg9GB?= ',), 'to': ('Jessica Schmidt <[email protected]>,\r\n\t=?iso-8859-1?Q?Rabea=2EBart=F6lke=40uni=2Ede?= <\udcd1\udc8f\udce4\udcbd\udca0Rabea.Bart\udcc3\udcb6[email protected]>',), 'from': ('[email protected]',), 'x-forwarded-message-id': ('<[email protected]>',), 'message-id': ('<[email protected]>',), 'date': ('Thu, 12 Oct 2017 09:41:56 +0500',), 'user-agent': ('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101\r\n Thunderbird/52.4.0',), 'mime-version': ('1.0',), 'in-reply-to': ('<[email protected]>',), 'content-type': ('multipart/mixed;\r\n boundary="------------BF90926EC9DF73443A6B8F28"',), 'content-language': ('ru',)},
attachments=[
Expand Down
6 changes: 3 additions & 3 deletions tests/messages_data/attachment_8bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
cc=('[email protected]', '[email protected]'),
bcc=('[email protected]',),
reply_to=(),
date=datetime.datetime(2019, 2, 7, 13, 18, 20, tzinfo=datetime.timezone(datetime.timedelta(0, 18000))),
date=datetime.datetime(2019, 2, 7, 13, 18, 20, tzinfo=datetime.timezone(datetime.timedelta(seconds=18000))),
date_str='Thu, 7 Feb 2019 13:18:20 +0500',
text='SCR\r\n\r\n/\r\nS19\r\n07FEB\r\nwat\r\n\r\n-- \r\nотдел расписания\r\nтел. (343) 072-00-00 (вн.18-59)\r\ne-mail: [email protected]\r\n\r\n',
html='<html>\r\n <head>\r\n\r\n <meta http-equiv="content-type" content="text/html; charset=utf-8">\r\n </head>\r\n <body text="#000000" bgcolor="#FFFFFF">\r\n <p>SCR<br>\r\n </p>\r\n <div class="moz-forward-container">/<br>\r\n S19<br>\r\n 07FEB<br>\r\n wat<br></div>\r\n <pre class="moz-signature" cols="72">-- \r\nотдел расписания\r\nтел. (343) 072-00-00 (вн.18-59)\r\ne-mail: <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a></pre>\r\n </body>\r\n</html>\r\n',
text='SCR\r\n\r\n/\r\nS19\r\n07FEB\r\nwat\r\n\r\n-- \r\nотдел расписания\r\nтел. (343) 072-00-00 (вн.18-59)\r\ne-mail: [email protected]\r\n\r\nДобрый\xa0день,\xa0уважаемые\xa0коллеги!\r\n\r\n\r\n\r\n\r\n-------- Перенаправленное сообщение --------\r\nТема: \tВвод рейсов ТЮМ, ЧЛБ, ОМС на Лето 2019\r\nДата: \tFri, 7 Dec 2018 08:23:21 +0500\r\nОт: \tПлёткина <[email protected]>\r\nКому: \tБелобородова О.Н. <[email protected]>\r\n\r\n\r\n\r\nДобрый\xa0день,\xa0уважаемые\xa0коллеги!\r\n\r\nПрошу ввести рейс на период летней навигации\r\n\r\n*ДМД-ТЮМ-ДМД \xa0 У6-341/342*\xa0 тип ВС А320\r\n\r\nВВ из ДМД 23:00 LT. ВВ из ТЮМ 06:45 LT\r\n\r\nисключение период с 25/05/19 по 13/10/19\r\n\r\nВВ из ДМД в 00:50 LT\r\n\r\nВВ из ТЮМ остается без изменения\r\n\r\n----------------------------------------\r\n\r\n*ДМД-ОМС-ДМД \xa0 У6-387/388*\xa0 тип ВС А321\r\n\r\nВВ из ДМД в 23:15. ВВ из ОМС 06:30 LT\r\n\r\n----------------------------------------\r\n\r\n*ДМД-ЧЛБ-ДМД \xa0 У6-610/609*\xa0 тип ВС А320\r\n\r\nВВ из ДМД в 23:30. ВВ из ЧЛБ 06:40 LT\r\n\r\n\r\n',
html='<html>\r\n <head>\r\n\r\n <meta http-equiv="content-type" content="text/html; charset=utf-8">\r\n </head>\r\n <body text="#000000" bgcolor="#FFFFFF">\r\n <p>SCR<br>\r\n </p>\r\n <div class="moz-forward-container">/<br>\r\n S19<br>\r\n 07FEB<br>\r\n wat<br></div>\r\n <pre class="moz-signature" cols="72">-- \r\nотдел расписания\r\nтел. (343) 072-00-00 (вн.18-59)\r\ne-mail: <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a></pre>\r\n </body>\r\n</html>\r\n<html>\r\n <head>\r\n\r\n <meta http-equiv="content-type" content="text/html; charset=utf-8">\r\n </head>\r\n <body smarttemplateinserted="true">\r\n <div id="smartTemplate4-template">Добрый\xa0день,\xa0уважаемые\xa0коллеги!\r\n <p>\xa0</p>\r\n </div>\r\n <br>\r\n <div class="moz-forward-container"><br>\r\n <br>\r\n -------- Перенаправленное сообщение --------\r\n <table class="moz-email-headers-table" cellspacing="0"\r\n cellpadding="0" border="0">\r\n <tbody>\r\n <tr>\r\n <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Тема: </th>\r\n <td>Ввод рейсов ТЮМ, ЧЛБ, ОМС на Лето 2019</td>\r\n </tr>\r\n <tr>\r\n <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Дата: </th>\r\n <td>Fri, 7 Dec 2018 08:23:21 +0500</td>\r\n </tr>\r\n <tr>\r\n <th valign="BASELINE" nowrap="nowrap" align="RIGHT">От: </th>\r\n <td>1 <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a></td>\r\n </tr>\r\n <tr>\r\n <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Кому: </th>\r\n <td>2 <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <br>\r\n <br>\r\n <meta http-equiv="content-type" content="text/html; charset=utf-8">\r\n <div id="smartTemplate4-template">Добрый\xa0день,\xa0уважаемые\xa0коллеги!\r\n <p>Прошу ввести рейс на период летней навигации <br>\r\n </p>\r\n <p>\xa0 тип ВС А320<br>\r\n </p>\r\n <p>ВВ из ДМД 23:00 LT. ВВ из ТЮМ 06:45 LT</p>\r\n <p>исключение период с 25/05/19 по 13/10/19 <br>\r\n </p>\r\n <p>ВВ из ДМД в 00:50 LT<br>\r\n </p>\r\n <p>ВВ из ТЮМ остается без изменения <br>\r\n </p>\r\n <p>----------------------------------------</p>\r\n <p>\xa0 тип ВС А321</p>\r\n <p>ВВ из ДМД в 23:15. ВВ из ОМС 06:30 LT <br>\r\n </p>\r\n <p>----------------------------------------</p>\r\n <p>\xa0 тип ВС А320</p>\r\n <p>ВВ из ДМД в 23:30. ВВ из ЧЛБ 06:40 LT </p>\r\n </div>\r\n <br>\r\n </div>\r\n </body>\r\n</html>\r\n',
headers={'return-path': ('[email protected]',), 'received': ('from m101.com.ru (LHLO m101.com.ru) (92.233.222.111) by m101.com.ru\r\n with LMTP; Thu, 7 Feb 2019 13:18:22 +0500 (YEKT)', 'from localhost (localhost [127.0.0.1])\r\n\tby m101.com.ru (Postfix) with ESMTP id 9A9181170B7;\r\n\tThu, 7 Feb 2019 13:18:22 +0500 (YEKT)', 'from m101.com.ru ([127.0.0.1])\r\n\tby localhost (m101.com.ru [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id Q3OLc4gNDjjO; Thu, 7 Feb 2019 13:18:22 +0500 (YEKT)', 'from [192.168.104.100] (kom-420-1.hades.company [192.168.104.100])\r\n\tby m101.com.ru (Postfix) with ESMTPSA id DC7BB1170A1;\r\n\tThu, 7 Feb 2019 13:18:21 +0500 (YEKT)'), 'x-virus-scanned': ('amavisd-new at m101.com.ru',), 'subject': ('S19 IZM A7-342',), 'references': ('<[email protected]>',), 'to': ('=?UTF-8?B?0KLQrtCc0JXQndCs?= <[email protected]>',), 'from': ('=?utf-8?B?0JrQsNGD0LrQuNC9INCS0LvQsNC00LjQvNC40YA=?= <[email protected]>',), 'cc': ('[email protected], [email protected]',), 'bcc': ('=?utf-8?b?0JrQvtC80LDQvdC00LAg0K/QvdC00LXQutGBLtCf0L7Rh9GC0Ys=?=\r\n\t<[email protected]>',), 'x-forwarded-message-id': ('<[email protected]>',), 'message-id': ('<[email protected]>',), 'date': ('Thu, 7 Feb 2019 13:18:20 +0500',), 'user-agent': ('Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101\r\n Thunderbird/60.5.0',), 'mime-version': ('1.0',), 'in-reply-to': ('<[email protected]>',), 'content-type': ('multipart/mixed;\r\n boundary="------------FFFBFD561B1FF33B4E5E7050"',), 'content-language': ('ru',)},
attachments=[
dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(0, 7200))),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))),
date_str='Mon, 6 Jun 2005 22:21:22 +0200',
text='This is the first part.\r\n',
html='',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(0, 7200))),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))),
date_str='Mon, 6 Jun 2005 22:21:22 +0200',
text='This is the first part.\r\n',
html='',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(0, 7200))),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))),
date_str='Mon, 6 Jun 2005 22:21:22 +0200',
text='This is the first part.\r\n',
text='This is the first part.\r\nJust attaching another PDF, here, to see what the message looks like,\r\nand to see if I can figure out what is going wrong here.\r\n',
html='',
headers={'mime-version': ('1.0 (Apple Message framework v730)',), 'content-type': ('multipart/mixed; boundary=Apple-Mail-13-196941151',), 'message-id': ('<[email protected]>',), 'from': ('[email protected]',), 'subject': ('testing',), 'date': ('Mon, 6 Jun 2005 22:21:22 +0200',), 'to': ('[email protected]',)},
attachments=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(0, 7200))),
date=datetime.datetime(2005, 6, 6, 22, 21, 22, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))),
date_str='Mon, 6 Jun 2005 22:21:22 +0200',
text='This is the first part.\r\n',
html='',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2003, 10, 23, 22, 40, 49, tzinfo=datetime.timezone(datetime.timedelta(-1, 61200))),
date=datetime.datetime(2003, 10, 23, 22, 40, 49, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=61200))),
date_str='23 Oct 2003 22:40:49 -0700',
text='',
html='',
Expand Down
2 changes: 1 addition & 1 deletion tests/messages_data/attachment_emails/attachment_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cc=(),
bcc=(),
reply_to=('[email protected]',),
date=datetime.datetime(2005, 5, 10, 11, 26, 39, tzinfo=datetime.timezone(datetime.timedelta(-1, 64800))),
date=datetime.datetime(2005, 5, 10, 11, 26, 39, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=64800))),
date_str='Tue, 10 May 2005 11:26:39 -0600',
text='Just attaching another PDF, here, to see what the message looks like,\r\nand to see if I can figure out what is going wrong here.\r\n',
html='',
Expand Down
Loading

0 comments on commit 329fe0f

Please sign in to comment.