Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fabianfreyer
Copy link
Contributor

(bitte beim Mergen squashen...)

@@ -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: ")
Copy link
Member

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: ")
Copy link
Member

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: ")
Copy link
Member

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:
Copy link
Member

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)
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants