Don't prompt for the IMAP password if in quiet mode or if not running
interactively (stdin is not a terminal).
This commit is contained in:
parent
89e6683334
commit
3d8a1bda89
|
@ -1310,6 +1310,8 @@ def _archive_imap(mailbox_name, final_archive_name):
|
||||||
try:
|
try:
|
||||||
imap_username, imap_password = imap_username.split(':', 1)
|
imap_username, imap_password = imap_username.split(':', 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
if (not os.isatty(sys.stdin.fileno())) or options.quiet:
|
||||||
|
unexpected_error("No imap password specified")
|
||||||
imap_password = getpass.getpass()
|
imap_password = getpass.getpass()
|
||||||
|
|
||||||
if mailbox_name[:5] == 'imaps':
|
if mailbox_name[:5] == 'imaps':
|
||||||
|
|
Loading…
Reference in New Issue