Skip to content

Commit

Permalink
Revert "fix: apply workaround for clients that send mail from auth=<>…
Browse files Browse the repository at this point in the history
…, but only when not using authentication"

This reverts commit 76e6162.
  • Loading branch information
YoRyan committed Jan 14, 2024
1 parent 76e6162 commit ee40be5
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/mailrise/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,6 @@ async def handle_DATA(self, server: SMTP, session: Session, envelope: Envelope)

return '250 OK'

# pylint: disable=invalid-name,unused-argument
async def handle_EHLO(self, _server: SMTP, session: Session, _envelope: Envelope,
hostname: str, responses: list[str]) -> list[str]:
"""This hook is called during ``EHLO``."""
if not self.config.authenticator:
# Workaround for SMTP clients that send MAIL FROM AUTH=<>
# It only works if we're not using SMTP authentication.
# https://github.com/aio-libs/aiosmtpd/issues/299#issuecomment-1427487291
session.host_name = hostname # type: ignore
return [r for r in responses if not r.startswith("250-AUTH")]


def _parsemessage(msg: StdlibEmailMessage, envelope: Envelope) -> r.EmailMessage:
"""Parses an email message into an `EmailNotification`.
Expand Down

0 comments on commit ee40be5

Please sign in to comment.