import os
from imap_connect import run as run_imap
from exchange_connect import run as run_ews
mode = os.environ.get('mode')
if mode == 'IMAP':
    run_imap()
elif mode == 'EWS':
    run_ews()
else:
    raise ValueError("Invalid mode specified. Use 'IMAP' or 'EWS'.")