imaplib.Debug = 5
die Daten vom IMAP-Server mitloggt. Im Debugger funktioniert das gut. Sobald ich mein Python-Programm kompiliere, bricht das Programm beim Holen von Header-Daten ab.
Hier ist der relevante Code:
Code: Alles auswählen
imap_connection = imaplib.IMAP4(host)
result, data = imap_connection.login(username, password)
if current_mail <= no_of_mails:
try:
result, header = imap_connection.fetch(str(current_mail), '(BODY.PEEK[HEADER])')
except imaplib.IMAP4.error:
print('fehler hier')
current_mail = current_mail + 1
In der Console sehe ich folgendes:
20.04.15 07:34:00,167 do_imap[96708]: 34:00.14 untagged_responses[FETCH] 0 += ["(b'1 (BODY[HEADER] {3228}', b'Return-Path: notification+zj4yoca92=oc@facebookmail.com\r\nReceived: from mx-out.facebook.com ([66.220.155.153]) by mx-ha.gmx.net\r\n (mxgmx011) with ESMTPS (Nemesis) id 0MVqRs-1XhYof1BYO-00X7ZO for\r\n <bwillius@gmx.de>; Sun, 05 Oct 2014 19:30:05 +0200\r\nReceived: from facebook.com (evjVJ+NWegstsctCHIQXcHFGb63UiKueMPzcEFFhrdgHDhYh30Fx/KtVvz82H6iq 10.224.41.39)\r\n by facebook.com with Thrift id 3e7812044cb511e48ef00002c9dfd1fa-e96e
20.04.15 07:34:00,182 do_imap[96708]: file:/var/folders/yb/l1kg95s932sgnw_8bl3dd67h0000gr/T/tmptkqlv0n4
20.04.15 07:34:00,182 do_imap[96708]: 34:00.14 untagged_responses[FETCH] 0 += ["(b'1 (BODY[HEADER] {3228}', b'Return-Path: notification+zj4yoca92=oc@facebookmail.com\r\nReceived: from mx-out.facebook.com ([66.220.155.153]) by mx-ha.gmx.net\r\n (mxgmx011) with ESMTPS (Nemesis) id 0MVqRs-1XhYof1BYO-00X7ZO for\r\n <bwillius@gmx.de>; Sun, 05 Oct 2014 19:30:05 +0200\r\nReceived: from facebook.com (evjVJ+NWegstsctCHIQXcHFGb63UiKueMPzcEFFhrdgHDhYh30Fx/KtVvz82H6iq 10.224.41.39)\r\n by facebook.com with Thrift id 3e7812044cb511e48ef00002c9dfd1fa-e96e
20.04.15 07:34:10,141 do_imap[96708]: do_imap Error
20.04.15 07:34:10,265 do_imap[96708]: ApplePersistence=NO
20.04.15 07:34:10,416 SIMBL Agent[98848]: warning: failed to get scripting definition from /Users/beatrixwillius/Documents/ Datei/Development/Mail Archiver/Projects/MainClasses Projects/imap/Builds - imap.xojo_binary_project/Mac OS X (Cocoa Intel)/imap.app/Contents/python/do_imap.app; it may not be scriptable.
Hat jemand eine Idee, was da schief läuft und wie ich das in den Griff bekomme? Ich kann meinem Kunden leider nicht Python und PyCharm installieren lassen.
Mit freundlichen Grüßen/Regards
Trixi Willius
http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals