client.py: Add confirmation prompt before connecting to autoconfigured hosts

This commit is contained in:
s3lph 2022-01-12 03:54:27 +01:00
parent b1f7d993c9
commit 7c8a5a377b

View file

@ -603,6 +603,10 @@ def main():
if outgoing_server is None: if outgoing_server is None:
raise RuntimeError('No working SMTP server found through autoconfiguration. Please specify manually.') raise RuntimeError('No working SMTP server found through autoconfiguration. Please specify manually.')
print(f'Autoconfigured outgoing server: {outgoing_server}') print(f'Autoconfigured outgoing server: {outgoing_server}')
confirm = input('Please confirm: [Y/n] ')
if confirm.lower() not in ['', 'y', 'yes']:
print('Aborted')
exit(1)
with incoming_server: with incoming_server:
now = datetime.utcnow() now = datetime.utcnow()
done = False done = False