Skip to content

Replace ssmtp with msmtp#1654

Merged
retlehs merged 6 commits into
masterfrom
msmtp
Apr 9, 2026
Merged

Replace ssmtp with msmtp#1654
retlehs merged 6 commits into
masterfrom
msmtp

Conversation

@retlehs
Copy link
Copy Markdown
Member

@retlehs retlehs commented Mar 22, 2026

Summary

  • Replace unmaintained ssmtp role with external roots.msmtp Galaxy role
  • msmtp auto-detects auth methods (PLAIN/LOGIN), fixing issues with providers like Proton Mail
  • Multi-account support via msmtp_accounts with per-account overrides
  • Existing mail_* group vars carry over unchanged — no breaking config changes

Details

  • msmtp-mta package provides /usr/sbin/sendmail symlink (fail2ban etc. unaffected)
  • /etc/msmtprc deployed with mode 0600 (credentials in file)
  • Logging defaults to syslog (safe for any calling user)
  • php_sendmail_path updated from /usr/sbin/ssmtp -t to /usr/bin/msmtp -t
  • mail_* group vars are mapped to msmtp_* role vars in server.yml

Migration

  • Users overriding old ssmtp_* variables must migrate to msmtp_* equivalents
  • Run ansible-galaxy install -r galaxy.yml to install the new roots.msmtp role

Docs updates: roots/docs#584

Closes #1482

Test plan

  • Provision a server and verify:
    • /usr/sbin/sendmail symlink exists and points to msmtp
    • /etc/msmtprc has mode 0600 and correct config
    • php -i | grep sendmail_path shows /usr/bin/msmtp -t
    • Test mail delivery works

🤖 Generated with Claude Code

ssmtp has been unmaintained for years. msmtp is an actively maintained
replacement with better auth method auto-detection and multi-account
support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs changed the title Replace ssmtp with msmtp (#1482) Replace ssmtp with msmtp Mar 22, 2026
@retlehs retlehs marked this pull request as draft March 22, 2026 04:00
Comment thread roles/msmtp/tasks/main.yml Outdated
Comment thread roles/msmtp/tasks/main.yml Outdated
retlehs and others added 2 commits April 4, 2026 11:12
The template already handles host/port parsing, so the duplicated
parsing and validation tasks were unnecessary overhead. Users need
to test their configuration regardless.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs self-assigned this Apr 4, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs requested a review from swalkinshaw April 4, 2026 16:16
@retlehs retlehs marked this pull request as ready for review April 4, 2026 16:16
retlehs and others added 2 commits April 4, 2026 11:55
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Role now defaults to Trellis mail_* variables directly, removing
the need for var mapping in server.yml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs merged commit d47306b into master Apr 9, 2026
2 checks passed
@retlehs retlehs deleted the msmtp branch April 9, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: switch from ssmtp to msmtp

2 participants