this post was submitted on 13 Mar 2025
2 points (100.0% liked)

techsupport

2719 readers
16 users here now

The Lemmy community will help you with your tech problems and questions about anything here. Do not be shy, we will try to help you.

If something works or if you find a solution to your problem let us know it will be greatly apreciated.

Rules: instance rules + stay on topic

Partnered communities:

You Should Know

Reddit

Software gore

Recommendations

founded 2 years ago
MODERATORS
 

EDIT: Solved, thanks to [email protected] pointing out here, that I was missing a proper domain for smtp_server. I thought I had tried that already, but I probably had some other settings borked up when I did.

cross-posted from: https://lemmy.abnormalbeings.space/post/94985

So, I am currently in the process of setting up a PeerTube and Lemmy instance, both on a dedicated Server running Debian 12. PeerTube seems to work properly by now, but the SMTP settings for Lemmy have been a bit of a headscratcher, and I wasn't able to find a solution.

To set up Lemmy, I followed the "from scratch" guide, and, besides the mail issue, it seems like everything else is working so far.

Note that I am currently in the process of learning-by-doing with this whole project. So, I would not rule out, that I may have overlooked something really obvious and stupid, sorry for taking your time, then.

My settings in /opt/lemmy/lemmy-server/lemmy.hjson:

  email: {
    # Hostname and port of the smtp server
    smtp_server: "localhost:587"
    # Login name for smtp server
    smtp_login: "lemmymail"
    # Password to login to the smtp server
    smtp_password: "REDACTED"
    # Address to send emails from, eg "[email protected]"
    smtp_from_address: "[email protected]"
    # Whether or not smtp connections should use tls. Can be none, tls, or starttls
    tls_type: "starttls"
  }

The error message I get, when trying both resetting a password, or applying as a new user:

WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: EmailSendFailed: Connection error: Connection error: invalid peer certificate: NotValidForName

"lemmymail" exists as a local user on the server.

# dovecot --version 2.3.19.1 (9b53102964)

If needed, I can provide additional info from dovecot and/or postfix configurations in the backend. Similar settings as above have worked for PeerTube. As a reference - these are working in production.yaml there:

Peertube smtp settings

# SMTP server to send emails
smtp:
  # smtp or sendmail
  transport: smtp
  # Path to sendmail command. Required if you use sendmail transport
  sendmail: null
  hostname: mail.abnormalbeings.space
  port: 587 # If you use StartTLS: 587
  username: '[email protected]'
  password: 'REDACTED'
  tls: false # If you use StartTLS: false
  disable_starttls: false
  ca_file: null # Used for self signed certificates
  from_address: '[email protected]'

Things I have tried:

  • Changing the user from and to a user with @abnormalbeings.space in the string
  • Changing the user to one I know works, as I use them for automatic PeerTube mail messages
  • Changing the hostname to a FQDN url instead of localhost (without https://)
  • Trying different ports (did not expect that to work)
  • changing tls_type to "none"
  • changing the Password to one containing no special characters (and back)
  • changing smtp_from_address to an actually existing user
  • restarting nginx, dovecot, postfix, lemmy-server and lemmy-ui for good measure after every change
no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here