question

NicolasChevalier-0757 avatar image
0 Votes"
NicolasChevalier-0757 asked ryanchill commented

Using Sendgrid and Azure : 550, b'Unauthenticated senders not allowed'

Hi

I am trying to send a password reset email to users.
When trying the App locally, the user can select to reset a pwd if forgotten , input his email into a field and submit, in order to receive an email with a link to reset the password.
Checking into Sendgrid, I can see the activity log that the email has been processed and delivered. So it seems working. The sender is my business email address

However, when trying to do the same passing via azure, on https://XXXXXX.azurewebsites.net/en/password_reset/, I get the following :

SMTPSenderRefused at /en/password_reset/
(550, b'Unauthenticated senders not allowed', 'nicolas@XXXXX.com')

in the log I get the following as well:

raise SMTPSenderRefused(code, resp, from_addr)

Any help would be appreciated,
merci
Nicolas

azure-webapps
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

In your code block @NicolasChevalier-0757, are you authenticated against the SendGrid SMTP server? It sounds like you're having same issue as this StackOverflow post.


0 Votes 0 ·

It seems I am as it works with my app on the local server, and do not work with the same app on Azure
on top of the verified single sender authentication, I also now have done a verified domain authentication

the email sender is the same as in my code, I do not think I need to do anything on the code about the domain authentication. So far, even with the Domain, still not working

I posted more details on stackoverflow if it helps.

https://stackoverflow.com/questions/69751730/using-sendgrid-and-azure-550-bunauthenticated-senders-not-allowed?noredirect=1#comment123312350_69751730

0 Votes 0 ·

1 Answer

NicolasChevalier-0757 avatar image
1 Vote"
NicolasChevalier-0757 answered ryanchill commented

This is solved. I found the solution, it was easy but needed someone else eyes .
In SendGrid, I named my API key ‘test’, and thought in Azure I should name it the same. However, no, I should have named it the same as in my code: SENDGRID_API_KEY
For someone with experience a standard approach, but not obvious. Hope this can help other users…

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Glad to hear you were able to get it resolved @NicolasChevalier-0757!

1 Vote 1 ·