From d3a766ffd63da6372ea9b5beb408df266eceba9d Mon Sep 17 00:00:00 2001 From: dmippoltiov Date: Mon, 21 Apr 2014 17:40:40 +0400 Subject: [PATCH] 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 --- .../messages/test_UnicodeDecodeError.eml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 django_mailbox/tests/messages/test_UnicodeDecodeError.eml diff --git a/django_mailbox/tests/messages/test_UnicodeDecodeError.eml b/django_mailbox/tests/messages/test_UnicodeDecodeError.eml new file mode 100644 index 0000000..f699a20 --- /dev/null +++ b/django_mailbox/tests/messages/test_UnicodeDecodeError.eml @@ -0,0 +1,67 @@ +Received: from mxfront40.mail.yandex.net ([127.0.0.1]) + by mxfront40.mail.yandex.net with LMTP id 1kYaj2Z0 + for ; Mon, 21 Apr 2014 17:01:46 +0400 +Received: from f284.i.mail.ru (f284.i.mail.ru [217.69.138.184]) + by mxfront40.mail.yandex.net (nwsmtp/Yandex) with ESMTPS id 5ybtvC8EjR-1k5qERXS; + Mon, 21 Apr 2014 17:01:46 +0400 + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (Client certificate not present) +X-Yandex-Front: mxfront40.mail.yandex.net +X-Yandex-TimeMark: 1398085306 +X-Yandex-Uniq: 048ae9ee-4930-499b-803d-4e7c7dd64da5 +Authentication-Results: mxfront40.mail.yandex.net; spf=pass (mxfront40.mail.yandex.net: domain of mail.ru designates 217.69.138.184 as permitted sender) smtp.mail=mr.test32@mail.ru; dkim=pass header.i=@mail.ru +X-Yandex-Spam: 1 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; + h=Content-Type:Message-ID:Reply-To:Date:Mime-Version:Subject:To:From; bh=oJMg2fPrmKvsyMXib8I9eF7JpnqtQmXIK5Ve6pwFXSI=; + b=VG3S4nAtfFv+yQMf1Ubtb4y29mTOQL73foRmudvkAdAaPhRjFb+84OspikmmFKbK+jRfanFWkXjQWa9B72uK7d8F4NsO3e9a+MffXcMtsz9AgmFe72Af7sQrXiqkwmUGeG/TQtPjR5E/gi3IHFrHFQD+apER59c8AlqEoQLvrRg=; +Received: from mail by f284.i.mail.ru with local (envelope-from ) + id 1WcDr0-0006oa-11 + for mr.test32@yandex.ru; Mon, 21 Apr 2014 17:01:46 +0400 +Received: from [144.206.32.69] by e.mail.ru with HTTP; + Mon, 21 Apr 2014 17:01:45 +0400 +From: =?UTF-8?B?dGVzdCB0ZXN0?= +To: mr.test32@yandex.ru +Subject: Óçíàé êàê çàðàáàòûâàòü îò 1000$ â íåäåëþ! + +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +X-Spam_score: 7.1 +X-Spam_score_int: 71 +X-Spam_bar: +++++++ +X-Spam_report: Spam detection software, running on the system , has + identified this incoming email as possible spam. The original message + has been attached to this so you can view it (if it isn't spam) or label + similar future email. If you have any questions, see + The administrator of that system for details. + + Content preview: [...] + + Content analysis details: (7.1 points, 2.0 required) + + pts rule name description + ---- ---------------------- -------------------------------------------------- + 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net + [Blocked - see ] + 1.4 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT + [201.216.250.71 listed in bb.barracudacentral.org] + 0.0 HTML_EXTRA_CLOSE BODY: HTML contains far too many close tags + 0.0 HTML_MESSAGE BODY: HTML included in message + 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% + [score: 0.5000] + 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts + 1.2 HTML_IMAGE_ONLY_04 BODY: HTML: images with 0-400 bytes of words + 1.5 SUBJ_ILLEGAL_CHARS Subject: has too many raw illegal characters + 0.0 SUBJECT_NEEDS_ENCODING SUBJECT_NEEDS_ENCODING + 0.0 HTML_SHORT_LINK_IMG_1 HTML is very short with a linked image + 0.0 T_REMOTE_IMAGE Message contains an external image + + + + +

+ +

+ +