feat(mailer): send email through plain SMTP #51
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!51
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/47-smtp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #47.
Adds plain SMTP as a second mailer next to Mailgun, as approved in D7. Like Mailgun, it's set with env vars only:
SMTP_HOSTMAIL_FROM.SMTP_TLSstarttls(default),tls(implicit TLS), ornone. With TLS, the server's certificate and hostname are checked against the system's CAs.SMTP_PORTtls, 25 withnone.SMTP_USERNAME,SMTP_PASSWORDBoot fails with a clear message when
SMTP_HOSTandMAILGUN_*are both set, whenMAIL_FROMis missing with SMTP, or whenSMTP_TLS/SMTP_PORTis malformed. The README, the registration and email-channel messages, and the Mailer docs now name both mailers.Dependencies:
gen_smtp1.3.0 (approved), plus its own dependencyranch2.4.0 (ninenines, Cowboy's socket pool). Only gen_smtp's client is used.Checks
mix precommitis clean (820 tests). New runtime-config tests cover STARTTLS defaults with verification, implicit TLS with login and port,nonewith a custom port, and the four boot errors.config/runtime.exs:SMTP_TLS=nonedelivers. STARTTLS to a server with an untrusted certificate is refused (selfsigned_peer/tls_failed). With a test CA added to the system store, STARTTLS delivers over TLS.