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

Response 501: 5.5.4 Invalid Domain Name #205

Open
LuckyLub opened this issue Oct 24, 2023 · 1 comment
Open

Response 501: 5.5.4 Invalid Domain Name #205

LuckyLub opened this issue Oct 24, 2023 · 1 comment

Comments

@LuckyLub
Copy link

LuckyLub commented Oct 24, 2023

When using an MS Outlook account and trying to send message from my local machine, I get the following error:

SMTPHeloError(response.code, response.message)
aiosmtplib.errors.SMTPHeloError: (501, '5.5.4 Invalid domain name [AS4P189CA0060.EURP189.PROD.OUTLOOK.COM 2023-10-24T06:56:46.567Z 08DBD2CBA8497480]')

After some digging I found out that apparently the outlook server is quite strict on what domain names it accepts. There currently is no way to specify this domain name in fastapi-mail. The package which is used for making the connetion to the SMTP server is aiosmtplib, which if not provided with a local hostname, uses the socket.getfqdn() as default. Unfortunately, in my case this raises the above mentioned error, since this function results in "mylaptopname.". This does not comply with the FQDN rules MS follows.

Therefore I have made a pull request, allowing to specify the local hostname. #204

@sabuhish
Copy link
Owner

Hello, thanks for digging into it, and solving the issue. Pls refer to the PR I have left a comment there.

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