mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 18:40:13 +01:00
Using ssl is the default for imapfetch.py
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
20cda235fa
commit
90e06de835
@ -90,6 +90,7 @@ def main():
|
|||||||
default="/etc/piler/piler.conf")
|
default="/etc/piler/piler.conf")
|
||||||
parser.add_argument("-s", "--server", type=str, help="imap server")
|
parser.add_argument("-s", "--server", type=str, help="imap server")
|
||||||
parser.add_argument("-P", "--port", type=int, help="port number", default=143)
|
parser.add_argument("-P", "--port", type=int, help="port number", default=143)
|
||||||
|
parser.add_argument("--no_ssl", help="Do not use ssl/tls", action='store_true')
|
||||||
parser.add_argument("-u", "--user", type=str, help="imap user")
|
parser.add_argument("-u", "--user", type=str, help="imap user")
|
||||||
parser.add_argument("-p", "--password", type=str, help="imap password")
|
parser.add_argument("-p", "--password", type=str, help="imap password")
|
||||||
parser.add_argument("-x", "--skip-list", type=str, help="IMAP folders to skip",
|
parser.add_argument("-x", "--skip-list", type=str, help="IMAP folders to skip",
|
||||||
@ -116,12 +117,16 @@ def main():
|
|||||||
opts['verbose'] = args.verbose
|
opts['verbose'] = args.verbose
|
||||||
opts['search'] = 'ALL'
|
opts['search'] = 'ALL'
|
||||||
opts['counter'] = 0
|
opts['counter'] = 0
|
||||||
|
opts['use_ssl'] = True
|
||||||
opts['db'] = None
|
opts['db'] = None
|
||||||
opts['id'] = 0
|
opts['id'] = 0
|
||||||
|
|
||||||
if args.date:
|
if args.date:
|
||||||
opts['search'] = args.date
|
opts['search'] = args.date
|
||||||
|
|
||||||
|
if args.no_ssl:
|
||||||
|
opts['use_ssl'] = False
|
||||||
|
|
||||||
server = ''
|
server = ''
|
||||||
user = ''
|
user = ''
|
||||||
password = ''
|
password = ''
|
||||||
@ -152,7 +157,7 @@ def main():
|
|||||||
if opts['verbose']:
|
if opts['verbose']:
|
||||||
print("Skipped folder list: {}".format(opts['skip_folders']))
|
print("Skipped folder list: {}".format(opts['skip_folders']))
|
||||||
|
|
||||||
if args.port == 993:
|
if opts['use_ssl']:
|
||||||
conn = imaplib.IMAP4_SSL(server)
|
conn = imaplib.IMAP4_SSL(server)
|
||||||
else:
|
else:
|
||||||
conn = imaplib.IMAP4(server)
|
conn = imaplib.IMAP4(server)
|
||||||
|
Loading…
Reference in New Issue
Block a user