Sendgrid API and Two Factor Authentication
I use google compute engine and use SendGrid to handle email. Exim configuration has worked for ages, then I noticed I could not send emails. For a day I was confused (it happens), then I realized SendGrid is pushing Two Factor Authentication (which I did) so this part of my exim configuration (below) was no longer working. Sure enough when I turned off 2 factor, I could send emails again.
begin authenticators
sendgrid_login:
driver = plaintext
public_name = LOGIN
client_send = : YourSendGridUsername : YourSendGridPassword
So being a good admin, I created a Sendgrid API Key. The problem I am having is there are no clear instructions in terms of how to use exim4 and the SendGrid API Key. I tried creating an environment variable for the key (using export), then using:
client_send = : YourSendGridUsername : MY_SENDGRID_ENV_VARIABLE
But that didnt work.
So I tried
client_send = : YourSendGridUsername : TheActualKeyItself
That didnt work. When I go to the mail queue, and try to deliver the mail, I can see that authentication is failing. What am I missing?
-
Some additional trial and error, finally got this one. If this is wrong please let me know, but it does work. sendgrid_login: driver = plaintext public_name = LOGIN client_send = : apikey : TheActualKeyItself What's interesting is I found a post elsewhere that said substitute your userID for apikey (which is what I tried), I also tried using the ApiKeyID, which didnt work either. Just simply "apikey" as the user did the trick. The only question I do have is around security of this approach. I also noticed "export" was not permanent as an environmental variable - which I found is normal after much reading. 0 -
Hello, Some additional trial and error, finally got this one. If this is wrong please let me know, but it does work. sendgrid_login: driver = plaintext public_name = LOGIN client_send = : apikey : TheActualKeyItself
I'm glad you were able to get this working. We suggest the same configuration here:0
Please sign in to leave a comment.
Comments
2 comments