mail
mail copied to clipboard
SMTP settings via url
This PR allows the SMTP-settings to be configured via a url, e.g.
Mail.defaults do
delivery_method :smtp, url: 'smtps://user%40gmail.com:[email protected]'
end
The Travis-builds seemed to fail for reasons unrelated to the code. Fixing this failed so I setup separate builds reachable via the ✅ at https://gitlab.com/eval/mail/tree/smtp-url.
The included smtp-delivery examples for gmail and fastmail were successfully tested.
Draft-status removed - feedback welcome!
Nice @eval ! - Please rebase this onto latest master, include a changelog and I'll include it in 2.9
Hi @mikel, I updated the PR. I made the following changes:
- url-attributes now take precedence, so it's similar to how one would configure the database in Rails.
- I used different default-settings in case of
smtp
for localhost and non-localhost.
This to make targeting a test-setup (e.g. mailcatcher) convenient, but also to require starttls by default for non-localhosts.
I tested the setup using mailcatcher and fastmail.
Updated docs&code to bring in line with the new acceptable values for enable_starttls
.
Sorry, but I am not sufficiently familiar with this part of the code to do a review. Please select someone else.