Adam Coddington
95f4d5c7ff
Be sure to pass the condition on through to the underlying transport.
2015-07-07 22:30:53 -07:00
Adam Coddington
988cb7504f
Adding a more-versatile condition-handling method for preventing integration tests from mashing on one another.
2015-07-07 22:22:15 -07:00
eupharis
1a04087159
add DJANGO_MAILBOX_ATTACHMENT_UPLOAD_TO setting
2015-06-22 17:28:23 -06:00
Adam Coddington
abad769fd6
Fixing test discovery, adding functionality allowing one to restict
...
message gathering (via the IMAP transport) to only messages matching a
specified subject.
Fixes #49 .
2015-04-12 12:11:49 -07:00
Adam Coddington
634f2f4b26
Adding basic integration tests.
2015-04-12 12:11:39 -07:00
Adam Dobrawy
835986c96a
Added random eml file name, removed getattr related to self.mailbox.from_email in Message.reply, fix docs - second round of pull requests
2015-03-18 09:56:52 +01:00
Adam Dobrawy
552e033655
Added test django_mailbox.tests.test_process_email.TestProcessEmail.test_message_reply
2015-03-15 00:42:57 +01:00
Adam Coddington
aa59199c9b
Interpret unknown encodings as ASCII. Fixes #34 .
2014-11-15 22:15:25 -08:00
Patrick Craston
2d82c00c5b
convert migrations to work with Django 1.7, add Django 1.7.1 to travis test matrix
2014-11-07 17:35:34 +00:00
Ariel Gerardo Ríos
826d0b1d88
Fix test methods for new accessors.
2014-09-01 15:31:29 -03:00
Alex Lovell-Troy
ec18a01880
Refactored the imap transport based on the tests
...
Testing the switch to uid-based IMAP calls required better testing
The better testing revealed some code that wasn't so pretty
I fixed the tests and the code
2014-05-29 23:41:11 -06:00
Adam Coddington
02567acdc2
Minor alterations to @yellowcap's pull request submission:
...
* Using a query parameter argument (rather than the entire query string)
to specify the folder into which e-mail messages should be archived.
* Duplicating the IMAP tests; this could probably be a bit more simply
done, but we'll at least be verifying both archived and non-archived
use cases.
* Simplifying some aspects of the documentation to include references
to this new feature.
2014-05-25 12:35:20 -07:00
Daniel
0e0c6cf170
Added email archiving option to IMAP transport
2014-05-23 09:17:14 +01:00
Adam Coddington
3b2d60a903
Actually fixing Python 3 support; verified both IMAP and POP3. Fixes #13 (seriously this time).
2014-04-25 16:45:35 -07:00
Adam Coddington
2b90f08250
Merge branch 'master' of github.com:coddingtonbear/django-mailbox
2014-04-24 15:49:18 -07:00
Adam Coddington
002e33bd95
Refactoring imports for Python3 support. Fixes #13 .
...
* Refactoring unicode payload handling of mis-encoded payloads.
* Uses six.moves.urllib to find proper urllib versions.
2014-04-24 15:44:45 -07:00
Adam Coddington
0f0628a742
Only expect additional space in Python 3.3+.
2014-04-22 17:13:41 -07:00
Adam Coddington
a2cf80ef99
Fixing header decoding such that it works properly under both Python 3.x and 2.x.
2014-04-22 17:06:17 -07:00
Adam Coddington
ef42c319e9
Updating yet another string for python3.
2014-04-22 16:24:16 -07:00
Adam Coddington
d871d41448
Fix test for Py3 support.
2014-04-22 16:06:34 -07:00
Adam Coddington
79e189fb22
Always decode headers into unicode objects before assigning to model; fixes #12 .
2014-04-22 15:49:49 -07:00
dmippoltiov
d3a766ffd6
Create test_UnicodeDecodeError.eml
...
this message raise error on get_mail:
Traceback:
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
87. return handler(request, *args, **kwargs)
File "/home/leha/django-site/proj/views.py" in get
140. messages = mailbox.get_new_mail()
File "/usr/local/lib/python2.7/site-packages/django_mailbox/models.py" in get_new_mail
285. msg = self.process_incoming_message(message)
File "/usr/local/lib/python2.7/site-packages/django_mailbox/models.py" in process_incoming_message
183. msg = self._process_message(message)
File "/usr/local/lib/python2.7/site-packages/django_mailbox/models.py" in _process_message
266. msg.save()
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in save
545. force_update=force_update, update_fields=update_fields)
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
573. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in _save_table
654. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert
687. using=using, raw=raw)
File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py" in _insert
232. return insert_query(self.model, objs, fields, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in insert_query
1511. return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
898. cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute
73. sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/operations.py" in last_executed_query
214. return cursor.query.decode('utf-8')
File "/usr/local/lib/python2.7/encodings/utf_8.py" in decode
16. return codecs.utf_8_decode(input, errors, True)
Exception Type: UnicodeDecodeError at /proj/new_mail/
Exception Value: 'utf8' codec can't decode byte 0xd3 in position 187: invalid continuation byte
2014-04-21 17:40:40 +04:00
Adam Coddington
88d122c421
Base64-encode message body when storing in DB.
...
* Since Django requires that the content stored in a TextField be unicode, we
need some way to encode the message safely. In situations before where
a single-byte non-7-bit-clean encoding were used, django-mailbox could
explode when writing the message copy to the database; this should ameliorate
that problem.
* Reverts earlier changesets' encoding normalization.
2013-07-26 22:13:29 -07:00
Adam Coddington
4c3af900c6
Remove unicode literals from tests for Python3.
2013-07-26 19:18:57 -07:00
Adam Coddington
adb17e7d67
Adding tests and minor code changes to ensure that we properly handle the distinction between bytes and text when dehydrating/rehydrating messages.
2013-07-26 19:13:35 -07:00
Adam Coddington
3ee4b43936
Cleaning up tests; moving test e-mail messages; fixing bugs relating to message encoding rehydration.
...
--HG--
rename : django_mailbox/tests/generic_message.eml => django_mailbox/tests/messages/generic_message.eml
rename : django_mailbox/tests/message_with_attachment.eml => django_mailbox/tests/messages/message_with_attachment.eml
rename : django_mailbox/tests/message_with_defective_attachment_association.eml => django_mailbox/tests/messages/message_with_defective_attachment_association.eml
rename : django_mailbox/tests/message_with_defective_attachment_association_result.eml => django_mailbox/tests/messages/message_with_defective_attachment_association_result.eml
rename : django_mailbox/tests/message_with_image_jpg_mimetype.eml => django_mailbox/tests/messages/message_with_image_jpg_mimetype.eml
rename : django_mailbox/tests/message_with_long_text_lines.eml => django_mailbox/tests/messages/message_with_long_text_lines.eml
rename : django_mailbox/tests/message_with_many_multiparts.eml => django_mailbox/tests/messages/message_with_many_multiparts.eml
rename : django_mailbox/tests/message_with_many_multiparts_stripped_html.eml => django_mailbox/tests/messages/message_with_many_multiparts_stripped_html.eml
rename : django_mailbox/tests/message_with_utf8_char.eml => django_mailbox/tests/messages/message_with_utf8_char.eml
rename : django_mailbox/tests/multipart_text.eml => django_mailbox/tests/messages/multipart_text.eml
2013-07-26 18:07:31 -07:00
Adam Coddington
2e6c23a6f0
Revamping encoding handling to normalize encodings to UTF-8 for storage; back into original encoding during rehydration.
2013-07-26 01:01:07 -07:00
Adam Coddington
f92e2a8448
Reorganizing tests.
2013-07-25 23:45:39 -07:00
Adam Coddington
b54855c3a2
Moving e-mail examples alongside other e-mail messages.
2013-08-03 18:00:53 -07:00
Travis
1fa21c87dc
Added testcases for bugfixes
2013-08-03 17:00:32 -05:00
Adam Coddington
198b994be8
Removing print statement.
2013-06-23 20:52:50 -07:00
Adam Coddington
78c9fc1987
Fixing header comparison.
2013-06-23 20:36:05 -07:00
Adam Coddington
5f289289ce
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.
2013-06-23 20:27:50 -07:00
Adam Coddington
364a3061c2
Adding Python3 support.
2013-06-22 15:42:50 -07:00
Adam Coddington
3ea8689ec0
Encode message body to bytes prior to reconstituting e-mail message object. Added additional test to ensure that messages can make it the full cycle.
2013-06-22 15:06:53 -07:00
Adam Coddington
9cdb2d9d1b
PEP-8 Cleanup.
2013-06-22 14:35:47 -07:00
Adam Coddington
8a34ac211c
Properly handle RFC2822 line continuations; resolves #4 .
2013-06-05 12:43:28 -07:00
Adam Coddington
2a90953283
Adding new settings allowing one to specify a list of mimetypes that are permitted to be stored in the message body of the e-mail message model.
2013-03-11 21:00:53 -07:00
Adam Coddington
ee6b4b3e1d
Delete attachments after they are no longer referenced by an e-mail message. Fixes #1 . Bumping version number to 1.8.3
2013-02-03 14:52:42 -08:00
Adam Coddington
afa82b861c
Adding get_text_body convenience method.
2013-01-20 14:27:15 -08:00
Adam Coddington
0eb63b44cf
Adding tests.
2013-01-19 00:26:58 -08:00