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

Please accept lowercase 'helo' command, et al. #45

Closed
lechner opened this issue Mar 18, 2021 · 2 comments
Closed

Please accept lowercase 'helo' command, et al. #45

lechner opened this issue Mar 18, 2021 · 2 comments

Comments

@lechner
Copy link

lechner commented Mar 18, 2021

Hi,

Is it possible that msmtp accepts only upper-case SMTP commands?

send: 'ehlo lechner-desktop.us-core.com\r\n'
reply: b'500 Expected EHLO or HELO\r\n'
reply: retcode (500); Msg: b'Expected EHLO or HELO'
send: 'helo lechner-desktop.us-core.com\r\n'
Traceback (most recent call last):
  File "/lcl/lechner/keyring/key-expirations/./upcoming-expirations", line 174, in <module>
    send_reminder(recipient_mailbox, recipient_name, status, server_date, keyid, sender_name, sender_email)
  File "/lcl/lechner/keyring/key-expirations/./upcoming-expirations", line 74, in send_reminder
    s.send_message(message)
  File "/usr/lib/python3.9/smtplib.py", line 927, in send_message
    self.ehlo_or_helo_if_needed()
  File "/usr/lib/python3.9/smtplib.py", line 605, in ehlo_or_helo_if_needed
    (code, resp) = self.helo()
  File "/usr/lib/python3.9/smtplib.py", line 434, in helo
    (code, msg) = self.getreply()
  File "/usr/lib/python3.9/smtplib.py", line 398, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed

I cannot send mail with Python's smtplib in this program here. No workaround seems to exist. This thread about the issue says "RFC 821 defines that [the commands] can be any syntax, such as mAiL FroM". Thank you!

Kind regards
Felix Lechner

@marlam
Copy link
Owner

marlam commented Mar 18, 2021

This was already fixed last June in commit 7d2222c, and is included already in 1.8.12 (current is 1.8.15).

@marlam marlam closed this as completed Mar 18, 2021
@lechner
Copy link
Author

lechner commented Mar 18, 2021

Great, I tested the change and requested that it is included in Debian's upcoming bullseye release. Thanks for your help!

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

No branches or pull requests

2 participants