-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support unauthenticated mail submission #1
base: master
Are you sure you want to change the base?
Conversation
@@ -116,9 +116,6 @@ def make_mail(sender, recipient, subject, body, attachments): | |||
if input("Abort? [y/N] ").lower() == "y": | |||
sys.exit(0) | |||
|
|||
username = args.username or input("Username: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this around and add a comment "(leave blank for unauthenticated login)"
@@ -116,9 +116,6 @@ def make_mail(sender, recipient, subject, body, attachments): | |||
if input("Abort? [y/N] ").lower() == "y": | |||
sys.exit(0) | |||
|
|||
username = args.username or input("Username: ") | |||
password = getpass("Password: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ask for the password here, if the username is truthy.
@@ -129,7 +126,9 @@ def make_mail(sender, recipient, subject, body, attachments): | |||
s.set_debuglevel(args.debug) | |||
s.starttls(context=context) | |||
s.ehlo() | |||
s.login(user=username, password=password) | |||
if args.username: | |||
password = getpass("Password: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for the password here is than not needed anymore.
@@ -129,7 +126,9 @@ def make_mail(sender, recipient, subject, body, attachments): | |||
s.set_debuglevel(args.debug) | |||
s.starttls(context=context) | |||
s.ehlo() | |||
s.login(user=username, password=password) | |||
if args.username: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be just if username
then.
s.login(user=username, password=password) | ||
if args.username: | ||
password = getpass("Password: ") | ||
s.login(user=args.username, password=password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito args.username
to just username
then.
(bitte beim Mergen squashen...)