From: Maximilian Friedersdorff Date: Fri, 14 Sep 2018 08:47:38 +0000 (+0100) Subject: Read imap server from creds file also X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=d705d79226faf418866f674ac75a52b1affce452;p=max%2Femail_syndication.git Read imap server from creds file also --- diff --git a/syndicate.py b/syndicate.py index ea9b331..b98efa3 100644 --- a/syndicate.py +++ b/syndicate.py @@ -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: