lejmr/iredmail-docker

How do I customise postfix/main.cf, dovecot/conf.d/10-ssl* and amavisd?

Opened this issue · 2 comments

I am a longtime iredmail user. I am attempting to move away from VMs to containers in my home network.

I need the ability to edit /etc/postfix/main.cf, ...dovecot/conf.d, ...amavisd.conf for for these edits to persist when rebuilding using docker-compose. It appears that amavisd is processed during container creation to insert an SQL password, so mounting an external copy of amavisd.conf does not work.

I've not tried, but I suspect I can create a Dockerfile based on this image that does some string replacements. Is there an official way to do this without such a hack?

One possibility may be cloning the git repository and placing the altered files in the mysql/static_files folder according to the file path from root. You will see this done already with some files in that folder. Then in the mysql folder with the Dockerfile run docker build -t somename . # don't forget that last period

This will put the files you need into the image. And since the static_files is one of the last steps all the other layers will be preserved and subsequent rebuilds of the image with changed files will happen very fast.

I needed to configure DKIM for several domains so I changed the /services/amavis.sh and and mount it. I add this line in this case
sed -i "s/dkim_key('DOMAIN'/dkim_key('*'/g" /etc/amavisd/amavisd.conf
right before the string replacement for HOSTNAME. I have to see how to do with the certificates but so far at least this part is working