mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Bumping maxlines to 10^6 to support large mailboxes. Fixes #81.
This commit is contained in:
parent
9538996dea
commit
19cc19e2d6
1 changed files with 10 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
from imaplib import IMAP4, IMAP4_SSL
|
import imaplib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
@ -6,6 +6,13 @@ from django.conf import settings
|
||||||
from .base import EmailTransport, MessageParseError
|
from .base import EmailTransport, MessageParseError
|
||||||
|
|
||||||
|
|
||||||
|
# By default, imaplib will raise an exception if it encounters more
|
||||||
|
# than 10k bytes; sometimes users attempt to consume mailboxes that
|
||||||
|
# have a more, and modern computers are skookum-enough to handle just
|
||||||
|
# a *few* more messages without causing any sort of problem.
|
||||||
|
imaplib._MAXLINE = 1000000
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -28,11 +35,11 @@ class ImapTransport(EmailTransport):
|
||||||
self.archive = archive
|
self.archive = archive
|
||||||
self.folder = folder
|
self.folder = folder
|
||||||
if ssl:
|
if ssl:
|
||||||
self.transport = IMAP4_SSL
|
self.transport = imaplib.IMAP4_SSL
|
||||||
if not self.port:
|
if not self.port:
|
||||||
self.port = 993
|
self.port = 993
|
||||||
else:
|
else:
|
||||||
self.transport = IMAP4
|
self.transport = imaplib.IMAP4
|
||||||
if not self.port:
|
if not self.port:
|
||||||
self.port = 143
|
self.port = 143
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue