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

now working in 3.3.3

python 3 only
This commit is contained in:
greendee 2014-04-24 15:06:07 +04:00
parent 0f0628a742
commit 6a5606f1fa
8 changed files with 46 additions and 4 deletions

View file

@ -12,7 +12,9 @@ import uuid
try:
import urllib.parse as urlparse
from urllib.parse import unquote
except ImportError:
from urllib import unquote
import urlparse
from django.conf import settings
@ -130,11 +132,11 @@ class Mailbox(models.Model):
@property
def username(self):
return urllib.unquote(self._protocol_info.username)
return unquote(self._protocol_info.username)
@property
def password(self):
return urllib.unquote(self._protocol_info.password)
return unquote(self._protocol_info.password)
@property
def location(self):

View file

@ -29,9 +29,9 @@ class ImapTransport(object):
for key in inbox[0].split():
try:
typ, msg_contents = self.server.fetch(key, '(RFC822)')
message = email.message_from_string(msg_contents[0][1])
message = email.message_from_bytes(msg_contents[0][1])
yield message
except email.Errors.MessageParseError:
except email.errors.MessageParseError:
continue
self.server.store(key, "+FLAGS", "\\Deleted")
self.server.expunge()