improved initial email decoding function
This commit is contained in:
parent
f73ca3e0b0
commit
9cb0d58312
|
@ -277,8 +277,8 @@ class Mail():
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
def parseMail(self):
|
def parseMail(self):
|
||||||
try:
|
try:
|
||||||
self.imap.select()
|
self.imap.select(readonly=True)
|
||||||
typ, data = self.imap.search(None, 'ALL')
|
typ, data = self.imap.search(None, 'UNSEEN')
|
||||||
for num in data[0].split():
|
for num in data[0].split():
|
||||||
typ, data = self.imap.fetch(num, '(RFC822)')
|
typ, data = self.imap.fetch(num, '(RFC822)')
|
||||||
raw_mail = data[0][1]
|
raw_mail = data[0][1]
|
||||||
|
|
Loading…
Reference in New Issue