1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00
Commit graph

17 commits

Author SHA1 Message Date
Adam Dobrawy
1037ccfd59 Add tests for cyrilic attachment 2016-12-10 17:02:08 +01:00
Adam Dobrawy
e610f93341 Add test for message with long content (#109) 2016-08-03 10:11:20 -07:00
Adam Dobrawy
f32c0dd245 Fix parse UTF-8 filename - close #104 2016-06-30 15:43:08 +02:00
Adam Coddington
5b1ed1c66f Properly decode encoded filename headers. Fixes #96. 2016-05-14 23:37:49 -07:00
Adam Coddington
5134b38060 [#96] Adding example email having a koi8r-encoded filename. 2016-05-14 22:26:58 -07:00
antcorro
3c33a22c3e Fix for #82; Improper handling of badly-encoded documents.
* fix logging warning message

* decode as ascii on Decode error

* Add test case for #88 #82

* add test case bis for #88 #82
2016-04-04 12:28:11 -07:00
Antonio Corroppoli
0e6dcce0f5 Add test for message with not decoded attachment header 2015-08-18 17:55:07 +02:00
Adam Coddington
ff433a24f4 Always store payload parts having a Content-Disposition of 'attachment' as attachments, even if their Content-Type is text/plain. Fixes #52.
Squashed commit of the following:

commit 5bcbac33d6
Author: Adam Coddington <me@adamcoddington.net>
Date:   Tue Jul 7 23:05:15 2015 -0700

    Add handling for situations in which the message was deleted in another thread before processing.

commit 6183f68b39
Author: Adam Coddington <me@adamcoddington.net>
Date:   Tue Jul 7 22:58:15 2015 -0700

    Always store message as attachment if its content-disposition is marked as such.

commit 4c16494b1a
Author: Adam Coddington <me@adamcoddington.net>
Date:   Tue Jul 7 22:46:52 2015 -0700

    Adding a (hopefully) failing test case for #52.
2015-07-07 23:09:41 -07: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
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
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
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