Skip to content

mail.attachment #23

@vmalguy

Description

@vmalguy

I thing their is an issue with mail.attachments.
It dont return any attachement.

This is my test case in ipython3

import mailparser

a="""Received: from EX3.local (172.16.2.3) by EX3.local (172.16.2.3) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2 via Mailbox
 Transport; Fri, 12 Jan 2018 12:48:13 +0100
Received: from [10.42.106.119] (10.10.254.33) by EX3.local (172.16.2.3)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Fri, 12
 Jan 2018 12:48:13 +0100
To: Vincent  <vincent@corp.com>
From: Simon  <simon@corp.com>
Subject: test eml attachment
Message-ID: <59d7aec3-408a-9a14-8bfe-187c9525dbb3@corp.com>
Date: Fri, 12 Jan 2018 12:46:42 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.4.0
Content-Type: multipart/mixed;
    boundary="------------55D5C868D71CE57DC948563F"
Content-Language: en-US
Return-Path: simon@corp.com
X-MS-Exchange-Organization-Network-Message-Id: 6a810f66-4b65-4a5f-da82-08d559b25c95
X-MS-Exchange-Organization-AuthSource: EX3.local
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 07
X-Originating-IP: [10.10.254.33]
X-ClientProxiedBy: ex2.local (172.16.2.2) To EX3.local (172.16.2.3)
X-MS-Exchange-Transport-EndToEndLatency: 00:00:00.2112587
X-MS-Exchange-Processed-By-BccFoldering: 15.01.1415.002
MIME-Version: 1.0

--------------55D5C868D71CE57DC948563F
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

test


--------------55D5C868D71CE57DC948563F
Content-Type: message/rfc822; name="Attached Message"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="Attached Message"

Received: from ex2.local (172.16.2.2) by EX3.local (172.16.2.3) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2 via Mailbox
 Transport; Fri, 12 Jan 2018 12:47:07 +0100
Received: from EX3.local (172.16.2.3) by EX2.local (172.16.2.2) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Fri, 12
 Jan 2018 12:47:07 +0100
Received: from EX3.local ([fe80::7806:9f98:c0b4:db47]) by EX3.local
 ([fe80::7806:9f98:c0b4:db47%13]) with mapi id 15.01.1415.002; Fri, 12 Jan
 2018 12:47:07 +0100
From: Vincent  <vincent@corp.com>
To: Simon  <simon@corp.com>
Subject: testing attachement
Thread-Topic: testing attachement
Thread-Index: AQHTi5sSajMVfq8xMUuQxsxmTSCh5A==
Date: Fri, 12 Jan 2018 12:47:07 +0100
Message-ID: <2A5A42E2-3703-4106-B333-F7BE6BE52BE7@corp.com>
Accept-Language: fr-FR, en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource: EX3.local
X-MS-Has-Attach:
X-MS-Exchange-Organization-Network-Message-Id: 77b61742-2589-475b-1765-08d559b2355c
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
x-mailer: Apple Mail (2.3445.5.20)
Content-Type: text/plain; charset="us-ascii"
Content-ID: <C1D546C88A6BC84FAF03EE9B754608FB@corp.com>
MIME-Version: 1.0

testing attachement

--------------55D5C868D71CE57DC948563F--
"""
mail = mailparser.parse_from_string(a)
mail.message_as_string
mail.attachments

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions