mikel / mail

A Really Ruby Mail Library
MIT License
3.6k stars 931 forks source link

Gmail SMTP relay issues after upgrading to 2.8.1 #1579

Closed hardyclervil closed 6 months ago

hardyclervil commented 1 year ago

Our team has recently been working on updating the mail gem from version 2.7.1 to 2.8.1. However, for unknown reasons, we're running into errors when performing SMTP relays to's Google's servers immediately after updating. Although the errors we've received have been pretty vague, it seems to be an authorization issue.

Our emails do appear to hit Google's SMTP server as it logs the attempts. However, there is very little information on why these attempts failed; we get a "Relay Authentication Failure" message in return. Even stranger is that we can successfully send emails via other SMTP relay providers such as Sendgrid and Mailgun.

Could any changes within 2.8.1 cause issues when relaying to Gmail?

ahorek commented 1 year ago

unfortunately, "Relay Authentication Failure" is too vague...

are you comparing it with the same settings & from the same server? It looks like your sender isn't allowed to use this gmail account. That could be one reason...

if the old version works, compare smtp logs. There's always a possibility the new version broke something, but in my opinion, this is more likely to be an issue with your settings on the server side.

eval commented 6 months ago

Changes v2.8.1. Please reopen if this is still an issue.