Skip Navigation
Lemmy Support @lemmy.ml
AbnormalHumanBeing @lemmy.abnormalbeings.space

[SOLVED] Lemmy sending e-mails doesn't work, and so far, guides and searches have not helped me

EDIT: Solved, check [email protected]'s comment below.

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:

 undefined
    
  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:

 undefined
    
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:

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

You're viewing a single thread.

3 comments