Hello!

I have procrastinated configuring the e-mail server for my instance. I am looking into it and it is not entirely clear to me how I should go about it.

I see that some docker-compose files have the following block added:

 postfix:
     image: mwader/postfix-relay
     environment:
       - POSTFIX_myhostname=${domain}
     restart: "always"

But I don’t understand whether this is supposed to work out-of-the box (which it did not for me when I tried), or if I need to set up the postfix server as one usually would and the postfix-relay somehow makes the connection between docker container and the already configured server. Is there a guide for complete beginners? I could not find one in the lemmy docs and I have never configured an e-mail server before. I am reading through the postfix documentation and already got some basics but there is a lot, and I am not sure that I am moving efficiently towards the end goal 😅

  • SalamanderOPA
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 years ago

    It has been 10 months since I posted this, but I have gotten back to it.

    After some troubleshooting, I eventually found out that my mistake was that I was using the wrong hostname in the lemmy.hjson config file.

    I was setting the hostname in the config file to ‘mander.xyz:25’, but it should have been “postfix:25”

    So, my e-mail configuration in the lemmy.hjson file now says:

    email: {
      # Hostname and port of the smtp server
      smtp_server: "postfix:25"
      # Address to send emails from, eg noreply@your-instance.com
      smtp_from_address: "Mander <noreply@mander.xyz>"
      # Whether or not smtp connections should use tls. Can be none, tls, or starttls
      tls_type: "none"
    }
    
    

    And the block in docker-compose.yml is:

    
      postfix:
        image: mwader/postfix-relay
        environment:
          - POSTFIX_myhostname=mander.xyz
          - POSTFIX_inet_protocols=ipv4
        restart: "always"
    
    

    And this works. I am still having some problems with my DKIM signature, but the e-mails at least get sent to the spam folder.