diff options
-rw-r--r-- | climl_imap_bridge.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/climl_imap_bridge.py b/climl_imap_bridge.py new file mode 100644 index 0000000..8549a43 --- /dev/null +++ b/climl_imap_bridge.py @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +import os +import subprocess +import confparser +import imapclient + +def monitor_mailbox(server, port, user, password, conf): + if conf.ssl: + imapserv = imaplib.IMAP4_SSL(server, port) + else: + imapserv = imaplib.IMAP4(server, port) + if conf.starttls: + imapserv.starttls() + +def main(): + confpath = os.path.expanduser('~') + '/temp/conf.cfg' + conf = confparser.read_conf(confpath) + print('Read conf:', conf) + password_command = conf.get('imap.password_command', None) + if password_command: + password = subprocess.check_output(password_command, shell=True) + print('got pasword:', password) + + + +main() # dev mode for now |