Kavita now with self hosted email messaging

So the latest news is the Nightly version of Kavita uses email addresses for user accounts. And the developers have kindly included the default of using their email service to deliver invite emails etc. However they’ve also release a new docker container Kavitaemail which allows you to use your own SMTP settings. So I’ve updated my Kavita stack to have the email container in there as well. I’ve modified it based on some advice from Andrew in the Discord chat, so that we don’t expose the port. We just make the two containers talk to each other directly. Below is the Stack config I used to make this work. You have to run it once, then shut down the stack and then go edit the appsettings.json file in the kavitaemail container to have your SMTP settings. You ONLY need to set those settings, ignore the rest. Once you’ve saved that file. Fire up the stack again and go the the Admin Dashboard (General Tab) and enter http://kavita-email:5003 into the SMTP URL and hit save. Test it and then send a test email.

version: '3.9'
services:
  kavita:
    image: kizaing/kavita:nightly
    environment:
      TZ: "America/Chicago"   
    volumes:
      - /srv/dev-disk-by-label-3TB2/Media5/Ubooquity:/manga:ro

      - kavita:/kavita/config
    ports:
      - "5000:5000"
    networks:
            - default
            - kavita-email
    restart: unless-stopped
  
  kavita-email:
    image: kizaing/kavitaemail:latest
    volumes:
       - kavitaemailconfig:/app/config
    networks:
       - kavita-email
    restart: unless-stopped

volumes:
  kavita:
  services:
  kavitaemailconfig:
 
networks:
  kavita-email:

There’s been an update already… Chris, aka kizaing, updated the kavitaemail image to use Environment variables in the setup so that you don’t have to stop the container/stack and manually update the appsettings.json file. However, if you leave a space after the = sign it will break the setting and then the emails won’t work. If you do that, you must delete the volume or the appsettings.json file and recreate because an updated run of the Stack will not update the appsettings.json file. I personally use/prefer docker volumes for my persisting data, so that makes the process of fixing things fairly easy. You can edit the name of your kavitaemail docker volume from “kavitaemailconfig” to “kavitaemailconfig2” and then you can delete the original volume.
The example of my stack is below. Just exchange the important bits with your information. And you still need to got to Kavita’s settings and add the http://kavita-email:5003 to the SMTP URL box.

version: '3.9'
services:
  kavita:
    image: kizaing/kavita:nightly
    environment:
      TZ: "America/Chicago"   
    volumes:
      - /srv/dev-disk-by-label-3TB2/Media5/Ubooquity:/manga:ro

      - kavita:/kavita/config
    ports:
      - "5000:5000"
    networks:
            - default
            - kavita-email
    restart: unless-stopped
  
  kavita-email:
    image: kizaing/kavitaemail:latest
    environment:
      - SMTP_HOST=mail.smtp.com
      - SMTP_PORT=587
      - SMTP_USER=username
      - SMTP_PASS=password
      - SEND_ADDR=youremail@example.com
      - DISP_NAME=Kavita Email
    volumes:
       - kavitaemailconfig:/app/config
    networks:
       - kavita-email
    restart: unless-stopped

volumes:
  kavita:
  services:
  kavitaemailconfig:
 
networks:
  kavita-email: