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:
parent
0f0628a742
commit
6a5606f1fa
8 changed files with 46 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue