mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38: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
9
.idea/django-mailbox.iml
generated
Normal file
9
.idea/django-mailbox.iml
generated
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
5
.idea/encodings.xml
generated
Normal file
5
.idea/encodings.xml
generated
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
||||
5
.idea/misc.xml
generated
Normal file
5
.idea/misc.xml
generated
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.3 (C:/Python33/python.exe)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
|
||||
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/django-mailbox.iml" filepath="$PROJECT_DIR$/.idea/django-mailbox.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
5
.idea/scopes/scope_settings.xml
generated
Normal file
5
.idea/scopes/scope_settings.xml
generated
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
||||
7
.idea/vcs.xml
generated
Normal file
7
.idea/vcs.xml
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
|
@ -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