]> git.friedersdorff.com Git - max/email_syndication.git/commitdiff
Read imap server from creds file also
authorMaximilian Friedersdorff <max@friedersdorff.com>
Fri, 14 Sep 2018 08:47:38 +0000 (09:47 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Fri, 14 Sep 2018 08:47:38 +0000 (09:47 +0100)
syndicate.py

index ea9b3314c8e9f6b7aed7f53e633de000f7e5cf3d..b98efa345378d746d4e9adf7c89e6974273979a1 100644 (file)
@@ -31,7 +31,6 @@ def process_mailbox(M):
 
     return mails, n_failures
 
-M = imaplib.IMAP4_SSL('outlook.office365.com')
 mailboxes = ['Notifications/NPPC/Updates', 'Notifications/NPPC/Uptime', 'Notifications/NPPC/Icinga']
 credential_file = './account'
 
@@ -41,6 +40,8 @@ with open(credential_file) as f:
 
 creds = [line.rstrip('\n') for line in creds]
 
+M = imaplib.IMAP4_SSL(creds[2])
+
 try:
     M.login(creds[0], creds[1]) 
 except imaplib.IMAP4.error: