Closed elielam closed 6 years ago
Try to set DBHOST
in postfixadmin
service as mail_mariadb
postfixadmin:
image: hardware/postfixadmin
container_name: postfixadmin
restart: always
depends_on:
- mailserver
- mail_mariadb
networks:
- utilities_network
- mail_network
domainname: ${SERVER_DOMAIN}
hostname: mail
environment:
- PUID=${USERID}
- PGID=${GROUPID}
- TZ=${TIMEZONE}
- DBPASS="password"
- DBHOST=mail_mariadb
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:dashboard.mail.${SERVER_DOMAIN}
- traefik.port=8888
- traefik.docker.network=utilities_network
- traefik.backend=Postfixadmin
You can check it here: https://github.com/hardware/postfixadmin/blob/920d734fca0b8e8603cef1972106d61f00f04b4c/bin/run.sh#L45-L50
Ok ty, you were right the link between postfix and db is now established.
Now the message had change:
I had already deal with this error but i don't remember how i fix it ..
I've found this ticket, but don't understand what was the problem.
You should also sync the configs on the mail_mariadb
service with the postfixadmin
mail_mariadb:
# ...
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- PUID=${USERID}
- PGID=${GROUPID}
- TZ=${TIMEZONE}
- MYSQL_DATABASE=postfix
- MYSQL_USER=postfix
- MYSQL_PASSWORD=password
postfixadmin:
# ...
environment:
- PUID=${USERID}
- PGID=${GROUPID}
- TZ=${TIMEZONE}
- DBPASS="password"
The default database and user are called postfix
, have you changed it? If so, you may need to set DBUSER
and DBNAME
on postfixadmin
service.
Another problem could be that quotation marks that you are using on the password, may I suggest a simpler password for tests? (without the quotes or special characters) as it may being bad interpreted by docker (you may need to escape some character).
All information describe in docker-compose are right for mail_mariadb i can connect to mysql with user
postfix
and pass
password
and i found the postfix db
When i reach mariadb from postfixadmin
I removed DBUSER and DBNAME variables in docker-compose file because after mount docker container it seem not take this variables in count.
Try to get the content of the /postfixadmin/config.local.php
docker exec postfixadmin cat /postfixadmin/config.local.php
It may help, maybe something is being set wrong there...
Take a closer look at the $CONF['database_...']
variables.
--
Can you USE postfix
database and select it content? (have you permissions to use it, are postfix
the owner?)
You were right thank you very much.
I add DBUSER and DBNAME variables to docker-compose.yml and it's work fine here it's my sample I don't either need to manually change config.inc.php file anymore.
postfixadmin:
image: hardware/postfixadmin
container_name: postfixadmin
restart: always
depends_on:
- mailserver
- mail_mariadb
networks:
- utilities_network
- mail_network
domainname: ${SERVER_DOMAIN}
hostname: mail
environment:
- PUID=${USERID}
- PGID=${GROUPID}
- TZ=${TIMEZONE}
- DBPASS=password
- DBHOST=mail_mariadb
- DBUSER=postfix
- DBNAME=postfix
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:dashboard.mail.${SERVER_DOMAIN}
- traefik.port=8888
- traefik.docker.network=utilities_network
- traefik.backend=Postfixadmin
...
mail_mariadb:
image: mariadb:10.2
container_name: mail_mariadb
restart: always
networks:
- mail_network
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- PUID=${USERID}
- PGID=${GROUPID}
- TZ=${TIMEZONE}
- MYSQL_DATABASE=postfix
- MYSQL_USER=postfix
- MYSQL_PASSWORD=password
volumes:
- /srv/appdata/utilities/mail/mysql/db:/var/lib/mysql
labels:
- traefik.enable=false
Ty again for your time.
I don't either need to manually change config.inc.php file anymore.
You shouldn't do that, it will only bring you problems.
I think you are new using docker right? I'm no expert either, but you may take a read about how the data are persisted on it. You will see that the files inside the container are lost each time the container is (re)created.
If you want to persist some kind of data/changes you will need a bind mount ou a volume mount.
Ty again for your time.
No problem, glad to help 😃
[]'s
Yes I discover docker by the installation of my server.
I understand, especially with the use of docker-compose that it is not good to modify files manually after mounting the container.
I will read more about it thanks.
Classification
Reproducibility
Docker information
$ docker info
Portainer network view
$ docker inspect network utilities_network
$ docker inspect network utilities_mail_network
The network db_network serves me to access my different databases via adminer.
Description
I am currently experiencing a problem with the configuration of Postfix and Mariadb. Even after modifying the config.inc.php file postfix seems not be able to reach db.
docker-compose.yml mariadb conf
config.inc.php
Debugging information
Postfix Web server seems not have any trouble
Configuration (docker-compose.yml, traefik.toml...etc)
docker-compose.yml
Sorry for my bad english you can reply in french if you want. thank you in advance.