Setting up email in Mastodon using an external SMTP server

This is how I got Mastodon to use an external SMTP server to deliver outgoing mail.

I received lots of errors such as ”WARN: Net::SMTPFatalError: 550 Bad HELO – Host impersonating domain name [hingst.net]”, which resulted in zero emails being sent. I solved it by adding my server’s IP to a TXT record for my domain, looking something like,

Code:
v=spf1 a mx ip4:123.123.123.123 ~all


and then adding this to the .env.production file on my Mastodon server:

Code:
SMTP_SERVER=smtp.example.com
SMTP_PORT=465
SMTP_LOGIN=mastodon@example.com
SMTP_PASSWORD=long_password
SMTP_AUTH_METHOD=plain
SMTP_SSL=true
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_OPENSSL_VERIFY_MODE=none
SMTP_FROM_ADDRESS=mastodon@example.com
SMTP_DELIVERY_METHOD=smtp
SMTP_DOMAIN=localhost


After reloading the Mastodon services should work.

Code:
systemctl restart mastodon-sidekiq
systemctl reload mastodon-web
  • mastodon
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing a Mastodon on Ubuntu Focal Fossa

Update system packages​ apt update && apt upgrade -y   Install fail2ban so it...

Running multiple instances on a single server

In this tutorial, I am going to show you how to install more then one mastodon instances on a...

How to install glitch-soc version

In this tutorial I will show you how to install mastodon glitch version. Glitch-soc is based on...

Moving or leaving accounts

Exporting your information​   The data export page in settingsAt any time you want, you can...

Mobile & Desktop Apps

Thanks to Mastodon's open API, you can use it from any of these apps developed by third-party...

Powered by WHMCompleteSolution