forked from mirror/django-mailbox
Major refactor of message attachment handling; no longer stores verbatim
message copy in database. Bumping version number to 2.1 * Walks through incoming message, write attachments to disk as they are found, and alters message body removing actual attachment body, and adding header 'X-Django-Mailbox-Interpolate-Attachment' referencing the ID of the stored attachment. * When calling ``get_email_object``, will walk through stored message, and 're-hydrate' the message by finding said headers, searching for the appropriate record in the MessageAttachments table, and rebuild the message object as closely as possible. Minor fixes: * Properly collect text/plain content from any part of the message; previously would only check the message's first level of payloads, now walks through all payloads, building a string of all text/plain content. * Remove use of deprecated `assertEquals` message.
This commit is contained in:
parent
548cc66c52
commit
5f289289ce
10 changed files with 525 additions and 126 deletions
|
|
@ -0,0 +1,28 @@
|
|||
X-sender: <sender@sendersdomain.com>
|
||||
X-receiver: <somerecipient@recipientdomain.com>
|
||||
From: "Senders Name" <sender@sendersdomain.com>
|
||||
To: "Recipient Name" <somerecipient@recipientdomain.com>
|
||||
Message-ID: <5bec11c119194c14999e592feb46e3cf@sendersdomain.com>
|
||||
Date: Sat, 24 Sep 2005 15:06:49 -0400
|
||||
Subject: Sample Multi-Part
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/alternative; boundary="----=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D"
|
||||
|
||||
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
|
||||
Content-type: text/plain; charset=iso-8859-1
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Sample Text Content
|
||||
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D
|
||||
Content-Type: multipart/alternative; boundary="----=_OtherPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB011C"
|
||||
|
||||
------=_OtherPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB011C
|
||||
Content-Type: text/plain; charset=iso-8859-1
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Multipart inside of multipart!
|
||||
------=_OtherPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB011C
|
||||
X-Django-Mailbox-Interpolate-Attachment: 9013
|
||||
|
||||
------=_OtherPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB011C--
|
||||
------=_NextPart_DC7E1BB5_1105_4DB3_BAE3_2A6208EB099D--
|
||||
Loading…
Add table
Add a link
Reference in a new issue