zokradonh / kopano-docker

Unofficial Kopano Docker images for all Kopano services.
MIT License
59 stars 37 forks source link

how to find "setup.sh" from mailserver-docker to setup DKIM #337

Closed theoneandonly-vector closed 4 years ago

theoneandonly-vector commented 4 years ago

I want to setup dkim, but I have no clue how to achieve it as I can't find "setup.sh" from: https://github.com/tomav/docker-mailserver/

fbartels commented 4 years ago

Hi @theoneandonly-vector,

the script is in the root dir of that repository (here https://github.com/tomav/docker-mailserver/blob/master/setup.sh). I cannot say though, if it will work out of the box when running the script inside of this project.

theoneandonly-vector commented 4 years ago

this command doesn't run into an error, also the other commands seem to work fine for me (debug show logs / login etc..) but where are the DKIM-keys be saved (Can't find them in the directory as the original project states) -> this is not an issue on the original project, because when I run it there, it works as expected.

fbartels commented 4 years ago

I don't have any experience with the setup script of docker-mailserver. Please post the full command you are executing and the response from the script. Since its a bash script it could be helpful to call it with bash -x.

theoneandonly-vector commented 4 years ago
bash -x ./mailsetup.sh config dkim
+ CRI=
+ '[' -z '' ']'
++ command -v docker
+ '[' '!' -z /usr/bin/docker ']'
+ CRI=docker
++ docker ps --no-trunc '--format={{.Image}} {{.Names}} {{.Command}}'
++ grep 'supervisord -c /etc/supervisor/supervisord.conf'
+ INFO='tvial/docker-mailserver:stable kopano_mail "supervisord -c /etc/supervisor/supervisord.conf"'
++ echo tvial/docker-mailserver:stable kopano_mail '"supervisord' -c '/etc/supervisor/supervisord.conf"'
++ awk '{print $1}'
+ IMAGE_NAME=tvial/docker-mailserver:stable
++ echo tvial/docker-mailserver:stable kopano_mail '"supervisord' -c '/etc/supervisor/supervisord.conf"'
++ awk '{print $2}'
+ CONTAINER_NAME=kopano_mail
++ pwd
+ DEFAULT_CONFIG_PATH=/opt/kopano-docker/config
+ USE_CONTAINER=false
+ '[' -z tvial/docker-mailserver:stable ']'
+ '[' -t 1 ']'
+ USE_TTY=-ti
+ getopts :c:i:p: OPT
+ '[' '!' -n '' ']'
+ _update_config_path
+ '[' '!' -z kopano_mail ']'
++ docker inspect kopano_mail '--format={{range .Mounts}}{{ println .Source .Destination}}{{end}}'
++ grep '/tmp/docker-mailserver$'
+ VOLUME='/var/lib/docker/volumes/kopano_mtaconfig/_data /tmp/docker-mailserver'
+ '[' '!' -z '/var/lib/docker/volumes/kopano_mtaconfig/_data /tmp/docker-mailserver' ']'
++ echo /var/lib/docker/volumes/kopano_mtaconfig/_data /tmp/docker-mailserver
++ awk '{print $1}'
+ CONFIG_PATH=/var/lib/docker/volumes/kopano_mtaconfig/_data
+ '[' '!' -n /var/lib/docker/volumes/kopano_mtaconfig/_data ']'
+ shift 0
+ case $1 in
+ shift
+ case $1 in
+ _docker_image generate-dkim-config
+ '[' false = true ']'
+ _docker_image_exists tvial/docker-mailserver:stable
+ docker history -q tvial/docker-mailserver:stable
+ return 0
+ docker run --rm -v /var/lib/docker/volumes/kopano_mtaconfig/_data:/tmp/docker-mailserver -ti tvial/docker-mailserver:stable generate-dkim-config
fbartels commented 4 years ago

The description at https://github.com/tomav/docker-mailserver#generate-dkim-keys speaks of the result being stored in config/opendkim/keys/domain.tld/mail.txt. In their example compose this is the bind mount location for /tmp/docker-mailserver (see https://github.com/tomav/docker-mailserver/blob/master/docker-compose.yml.dist#L17). So I would guess you can find the information when you exec into the mail container and look in /tmp/docker-mailserver/opendkim/keys/domain.tld/mail.txt.

theoneandonly-vector commented 4 years ago

there's no "key"-folder there.

theoneandonly-vector commented 4 years ago

let's close this one:

  1. login to the mail-docker
  2. run: generate-dkim-config generate-dkim-domain neutronix.ch
  3. exit docker (mail) pasting the content of config/opendkim/keys/domain.tld/mail.txt in your mail.tld.hosts zone.