Giter Site home page Giter Site logo

arugifa / simplelogin-postfix-docker Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 27.0 30 KB

The missing Docker image for SimpleLogin Postfix

Home Page: https://hub.docker.com/r/arugifa/simplelogin-postfix

License: GNU General Public License v3.0

Dockerfile 24.73% Python 67.34% Shell 7.93%

simplelogin-postfix-docker's Introduction

Docker Image for SimpleLogin Postfix

No official Postfix image, tailor-made for SimpleLogin, currently exists.

Let's fix that, by providing to the community something very lightweight, secure* (with Let's Encrypt support) and simple to use 💖

Compatibility: this image has been tested in a production environment with SimpleLogin 3.1.0

* if a TLS certificate cannot be automatically generated when starting the container, Postfix will run without TLS activated, until the next attempt (happens every hour)

Can be configured with the following environment variables:

Setting Description
ALIASES_DEFAULT_DOMAIN Default domain to use for your aliases.
DB_HOST Where is hosted your SimpleLogin PostgreSQL database.
DB_USER User to connect to the database.
DB_PASSWORD User's password to connect to the database.
DB_NAME Name of the database.
EMAIL_HANDLER_HOST Where is hosted your SimpleLogin email handler instance.
LETSENCRYPT_EMAIL Email address used by Let's Encrypt, to send you expiry notices*.
POSTFIX_FQDN Fully Qualified Domain Name of your Postfix instance (i.e., the MX server address you configured in your DNS zone for your ALIASES_DEFAULT_DOMAIN).
RELAY_HOST If your Postfix instance's IP address is blacklisted (e.g., because it is not a static address), you must use your Internet Service Provider's mail server as a relay, to be able to send emails to the outer world.

* automatic renewal is managed with Certbot and shouldn't fail, unless you have reached Let's Encrypt rate limits

Used by and made for Kloügle, the Google alternative automated with Terraform.

Troubleshooting

If you don't receive emails from SimpleLogin, have a look to Postfix logs:

docker logs -f <POSTFIX_CONTAINER>

If Postfix doesn't seem to use TLS, have a look to Certbot logs:

docker exec -ti <POSTFIX_CONTAINER> cat /var/log/letsencrypt/letsencrypt.log

simplelogin-postfix-docker's People

Contributors

arugifa avatar metabaron1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

simplelogin-postfix-docker's Issues

Cert renewal job fails

The certbot -n renew fails with

Currently, the renew verb is capable of either renewing all installed certificates that are due to be renewed or renewing a single certificate specified by its name. If you would like to renew specific certificates by their domains, use the certonly command instead. The renew verb may provide other options for selecting certificates to renew in the future.

The problem is in cli.ini, where 'domain' should really be 'domains' certbot/certbot#4774 (comment)

Also, because I saw hourly failures trying to email to root in the log, I was curious why that was happening so I set up a root alias in simplelogin and it was the cron job. Because cron will email any output, success or error to root and because certbot -n is too chatty, it would email me hourly that

Cert not yet due for renewal

From cert bot docs https://certbot.eff.org/docs/using.html:

If you’re sure that this command executes successfully without human intervention, you can add the command to crontab (since certificates are only renewed when they’re determined to be near expiry, the command can run on a regular basis, like every week or every day). In that case, you are likely to want to use the -q or --quiet quiet flag to silence all output except errors.

I can create a pull request this evening to address these fixes if you want me to.

Let's Encrypt SSL certifcates

Question

The docker container seems to want to request an SSL certificate from Let's Encrypt, but it is not entirely clear to me what these are used for and which domain I should request them for. Are these certificates for your "email" domain or the domain from which you serve the web interface?

Example

If your standard emails are send from example.com and your Simplelogin app runs on app.example.com (like described in the SL documentation). Is this certificate meant for example.com or app.example.com?

relayhost Postfix parameter

Hi Arugifa
It may be usefull to have relayhost. So here is a pull request. There should be absolutly no change to current deployment if RELAY_HOST variable parameter is not set in docker-compose.
This is my first pull request to Github, and also never used Python, so not sure if I have done everything correctly ;)

TLS issues (+ fixes)

Hello,

First of all, thanks for the great image!
With a few tweaks i got it working perfectly.

At first i had trouble sending encrypted mails.
To get TLS working properly i had to add these lines to the main.cf file:

  • smtp_tls_security_level = may
  • smtp_tls_loglevel = 1

I also added the ca-certification package together with this main.cf line, to get rid of 'untrusted TLS' log lines

  • smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

This isn't really an issue, but i still wanted to write it down somewhere so people could find it if they run into the same problems.

Clarification of steup instructions

I was following the documentation to set up SimpleLogin on my Raspberry Pi but, since it's just a test and I'm planning to install it on my home server along with other apps, I liked your idea to containerize postfix too.
So I opted for your postfix docker image, but I got stuck following the instructions inside the README (probably because I'm not so expert in these self-hosting things), here are my questions:

  1. What should I put as DB_HOST? The name of the PostgreSQL container? Or maybe the path to its volume?
  2. What do you mean as EMAIL_HANDLER_HOST? Is it the container with SimpleLogin app installed? Because I was following the official README, and I haven't already created it since it's written after postfix installation
  3. In the RELAY_HOST field, I should put the SMTP server of my real email? Or what?

Thank you in advance and sorry if the questions are dumb :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.