Hello Ahmad,
Thank you for the additional details. The fact that this happened after restoring the database on another server is an important clue.
Regarding the SMTP issue, this may be related to the server GPG keys. Some sensitive settings stored in the database are encrypted with the Passbolt server GPG key. If the database was restored on a new server without restoring the original server GPG keys, the new server may not be able to decrypt the previously stored SMTP settings.
This could explain why the SMTP settings cannot be saved.
If you no longer have access to the old server and cannot recover the original GPG keys, then the old encrypted SMTP settings cannot be decrypted anymore. In that case, a possible solution would be to remove the encrypted SMTP related entries from the organization_settings table, then log into Passbolt again, accept the new server key, and reconfigure the SMTP from the UI.
IMPORTANT : Before doing anything in the database please make a full database backup :
Replace /path/to/backup.sql by the path and name of your choice
docker compose -f docker-compose-ce.yaml exec db bash -c \
'mariadb-dump -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}' \
> /path/to/backup.sql
To proceed with this solution you will need to make sure that the SMTP configuration entry is not empty, to do so, you can type the following command line :
docker compose -f docker-compose-ce.yaml exec db bash -c 'mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e "SELECT * from organization_settings where property = '\''smtp'\''\G"'
The output will be your encrypted SMTP configuration that your server cannot decrypt.
We need to delete the encrypted SMTP settings for you to be able to fill the new ones in the Passbolt configuration menu.
Here is the command line to delete the encrypted configuration :
docker compose -f docker-compose-ce.yaml exec db bash -c 'mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e "DELETE from organization_settings where property = '\''smtp'\'';"'
Check again with the ‘SELECT’ command shown before to make sure the ‘DELETE’ command properly removed the old entry.
If successfully removed, you will be able to go back to the Passbolt UI settings and add new SMTP settings. These new settings will be encrypted with the new GPG server key and saved in the database.
To avoid any future similar issues please make sure to backup your database regularly and your server GPG keys.
Extra documentation that can be helpful in the future :
https://www.passbolt.com/docs/hosting/backup/from-docker/
https://www.passbolt.com/docs/hosting/migrate/server/ce/docker/
I hope this clarifies the situation and helps you resolve the issue. Please don’t hesitate to ask if you have any questions about my message.
Best regards,
Sara