Unable to access my passbolt server from new machine

Server’s OS: Ubuntu 22.10
Passbolt: Docker install (Passbolt Help | Docker passbolt installation - I used this to install)
Postfix (How To Install and Configure Postfix on Ubuntu 20.04 | DigitalOcean - I used this to install postfix)

On my server I run postfix as an SMTP server to my passbolt server.
And I have 2 issues with it. On my main computer where I did the passbolt setup I can access my passwords. I can send test email from web interface and I receive them. But When I want to login from a new machine I enter the email that I logged in with on my main PC, I accept the “I accept the terms” and I click on the next button and it says “Check your mailbox!” but the email never arrives. I already spent so much time seeking the answer but I did not found it.

My other problem is that I can’t access it with my phone. The web interface has https but with self assigned certificate. When I scan the qr code an error comes up it saying “something was wrong”, then I try to add my account manually with user ID, Account URL (I think that is the web interface’s URL (for me it is: https:/192.168.0.3)), and with the Private key but then it stuck on an infinite loop of sign in.

So what can I do?

Hi @Gyro Welcome to the forum!

Regarding your mobile access, did you install your self-signed cert to your device first? Instructions here.

Regarding the mail server, how have you verified that smtp is working on it aside from attempting with passbolt?

I did not installed the ssc to my mobile because I might have overlooked that step. And after I installed the cert on my phone it still does not work.

I tested with s-nail that Digital Ocean used in the link, and it worked, I can see those s-nail test emails.

I’d refer you back to the post instructions to help us know more details About the Installation Issues category

Please post a healthcheck, thanks.

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

Open source password manager for teams
-------------------------------------------------------------------------------
 Healthcheck shell
-------------------------------------------------------------------------------

 Environment

 [PASS] PHP version 7.4.33.
 [PASS] PCRE compiled with unicode support.
 [PASS] The temporary directory and its content are writable and not executable.
 [PASS] The logs directory and its content are writable.
 [PASS] GD or Imagick extension is installed.
 [PASS] Intl extension is installed.
 [PASS] Mbstring extension is installed.

 Config files

 [PASS] The application config file is present
 [WARN] The passbolt config file is missing in /etc/passbolt/
 [HELP] Copy /etc/passbolt/passbolt.default.php to /etc/passbolt/passbolt.php
 [HELP] The passbolt config file is not required if passbolt is configured with environment variables

 Core config

 [PASS] Debug mode is off.
 [PASS] Cache is working.
 [PASS] Unique value set for security.salt
 [PASS] Full base url is set to https://192.168.0.3
 [PASS] App.fullBaseUrl validation OK.
 [PASS] /healthcheck/status is reachable.

 SSL Certificate

 [FAIL] SSL peer certificate does not validate
 [FAIL] Hostname does not match when validating certificates.
 [WARN] Using a self-signed certificate
 [HELP] Check https://help.passbolt.com/faq/hosting/troubleshoot-ssl
 [HELP] cURL Error (60) SSL certificate problem: self signed certificate

 Database

 [PASS] The application is able to connect to the database
 [PASS] 30 tables found
 [PASS] Some default content is present
 [PASS] The database schema up to date.

 GPG Configuration

 [PASS] PHP GPG Module is installed and loaded.
 [PASS] The environment variable GNUPGHOME is set to /var/lib/passbolt/.gnupg.
 [PASS] The directory /var/lib/passbolt/.gnupg containing the keyring is writable by the webserver user.
 [FAIL] The server OpenPGP key is not set
 [HELP] Create a key, export it and add the fingerprint to /etc/passbolt/passbolt.php
 [HELP] See. https://www.passbolt.com/help/tech/install#toc_gpg
 [PASS] The public key file is defined in /etc/passbolt/passbolt.php and readable.
 [PASS] The private key file is defined in /etc/passbolt/passbolt.php and readable.
 [FAIL] The server key fingerprint doesn't match the one defined in /etc/passbolt/passbolt.php.
 [HELP] Double check the key fingerprint, example:
 [HELP] sudo su -s /bin/bash -c "gpg --list-keys --fingerprint --home /var/lib/passbolt/.gnupg" www-data | grep -i -B 2 'SERVER_KEY_EMAIL'
 [HELP] SERVER_KEY_EMAIL: The email you used when you generated the server key.
 [HELP] See. https://www.passbolt.com/help/tech/install#toc_gpg
 [FAIL] The server public key defined in the /etc/passbolt/passbolt.php (or environment variables) is not in the keyring
 [HELP] Import the private server key in the keyring of the webserver user.
 [HELP] you can try:
 [HELP] sudo su -s /bin/bash -c "gpg --home /var/lib/passbolt/.gnupg --import /etc/passbolt/gpg/serverkey_private.asc" www-data
 [FAIL] The server key does not have a valid email id.
 [HELP] Edit or generate another key with a valid email id.

 Application configuration

 [PASS] Using latest passbolt version (4.0.2).
 [PASS] Passbolt is configured to force SSL use.
 [PASS] App.fullBaseUrl is set to HTTPS.
 [PASS] Selenium API endpoints are disabled.
 [PASS] Search engine robots are told not to index content.
 [INFO] The Self Registration plugin is enabled.
 [INFO] Registration is closed, only administrators can add users.
 [PASS] The deprecated self registration public setting was not found in /etc/passbolt/passbolt.php.
 [WARN] Host availability checking is disabled.
 [HELP] Make sure this instance is not publicly available on the internet.
 [HELP] Or set the PASSBOLT_EMAIL_VALIDATE_MX environment variable to true.
 [HELP] Or set passbolt.email.validate.mx to true in /etc/passbolt/passbolt.php.
 [PASS] Serving the compiled version of the javascript app.
 [WARN] Some email notifications are disabled by the administrator.

 JWT Authentication

 [PASS] The JWT Authentication plugin is enabled
 [PASS] The /etc/passbolt/jwt/ directory is not writable.
 [PASS] A valid JWT key pair was found

 SMTP Settings

 [PASS] The SMTP Settings plugin is enabled.
 [PASS] SMTP Settings coherent. You may send a test email to validate them.
 [WARN] The SMTP Settings source is: env variables.
 [HELP] It is recommended to set the SMTP Settings in the database through the administration section.
 [WARN] The SMTP Settings plugin endpoints are enabled.
 [HELP] It is recommended to disable the plugin endpoints.
 [HELP] Set the PASSBOLT_SECURITY_SMTP_SETTINGS_ENDPOINTS_DISABLED environment variable to true.
 [HELP] Or set passbolt.security.smtpSettings.endpointsDisabled to true in /etc/passbolt/passbolt.php.

 [FAIL] 6 error(s) found. Hang in there!

And I don’t know why I don’t have an /etc/passbolt folder

root@jczeppeli:/etc# ls | grep "^p"
pam.conf
pam.d
passwd
passwd-
perl
php
pihole
pki
pm
polkit-1
pollinate
postfix
ppp
profile
profile.d
protocols
python3
python3.10

Since you are on Docker maybe the docker troubleshooting page will help. Looks like you skipped a couple steps before the healthcheck was run

For the ls | grep "^p" did you run that on the host or in the docker container? It makes sense to not have an /etc/passbolt on the host

The Healthcheck with every command in Passbolt Help | Troubleshoot Docker until the ./bin/cake passbolt healthcheck command:

root@jczeppeli:~$ docker exec -ti root_passbolt_1 bash
root@f6dcfffe29e5:/usr/share/php/passbolt# su -s /bin/bash www-data
www-data@f6dcfffe29e5:/usr/share/php/passbolt$ export PASSBOLT_GPG_SERVER_KEY_FINGERPRINT="$(gpg \
  --home $GNUPGHOME\
  --list-keys \
  ${PASSBOLT_KEY_EMAIL:-root@jczeppeli.home} | \
  grep -Ev "^(pub|sub|uid|^$)" | tr -d ' ')"
www-data@f6dcfffe29e5:/usr/share/php/passbolt$ source /etc/environment
www-data@f6dcfffe29e5:/usr/share/php/passbolt$ ./bin/cake passbolt healthcheck

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
-------------------------------------------------------------------------------
 Healthcheck shell
-------------------------------------------------------------------------------

 Environment

 [PASS] PHP version 7.4.33.
 [PASS] PCRE compiled with unicode support.
 [PASS] The temporary directory and its content are writable and not executable.
 [PASS] The logs directory and its content are writable.
 [PASS] GD or Imagick extension is installed.
 [PASS] Intl extension is installed.
 [PASS] Mbstring extension is installed.

 Config files

 [PASS] The application config file is present
 [WARN] The passbolt config file is missing in /etc/passbolt/
 [HELP] Copy /etc/passbolt/passbolt.default.php to /etc/passbolt/passbolt.php
 [HELP] The passbolt config file is not required if passbolt is configured with environment variables

 Core config

 [PASS] Debug mode is off.
 [PASS] Cache is working.
 [PASS] Unique value set for security.salt
 [PASS] Full base url is set to https://192.168.0.3
 [PASS] App.fullBaseUrl validation OK.
 [PASS] /healthcheck/status is reachable.

 SSL Certificate

 [FAIL] SSL peer certificate does not validate
 [FAIL] Hostname does not match when validating certificates.
 [WARN] Using a self-signed certificate
 [HELP] Check https://help.passbolt.com/faq/hosting/troubleshoot-ssl
 [HELP] cURL Error (60) SSL certificate problem: self signed certificate

 Database

 [PASS] The application is able to connect to the database
 [PASS] 30 tables found
 [PASS] Some default content is present
 [PASS] The database schema up to date.

 GPG Configuration

 [PASS] PHP GPG Module is installed and loaded.
 [PASS] The environment variable GNUPGHOME is set to /var/lib/passbolt/.gnupg.
 [PASS] The directory /var/lib/passbolt/.gnupg containing the keyring is writable by the webserver user.
 [PASS] The server OpenPGP key is not the default one
 [PASS] The public key file is defined in /etc/passbolt/passbolt.php and readable.
 [PASS] The private key file is defined in /etc/passbolt/passbolt.php and readable.
 [PASS] The server key fingerprint matches the one defined in /etc/passbolt/passbolt.php.
 [PASS] The server public key defined in the /etc/passbolt/passbolt.php (or environment variables) is in the keyring.
 [PASS] There is a valid email id defined for the server key.
 [PASS] The public key can be used to encrypt a message.
 [PASS] The private key can be used to sign a message.
 [PASS] The public and private keys can be used to encrypt and sign a message.
 [PASS] The private key can be used to decrypt a message.
 [PASS] The private key can be used to decrypt and verify a message.
 [PASS] The public key can be used to verify a signature.
 [PASS] The server public key format is Gopengpg compatible.
 [PASS] The server private key format is Gopengpg compatible.

 Application configuration

 [PASS] Using latest passbolt version (4.0.2).
 [PASS] Passbolt is configured to force SSL use.
 [PASS] App.fullBaseUrl is set to HTTPS.
 [PASS] Selenium API endpoints are disabled.
 [PASS] Search engine robots are told not to index content.
 [INFO] The Self Registration plugin is enabled.
 [INFO] Registration is closed, only administrators can add users.
 [PASS] The deprecated self registration public setting was not found in /etc/passbolt/passbolt.php.
 [WARN] Host availability checking is disabled.
 [HELP] Make sure this instance is not publicly available on the internet.
 [HELP] Or set the PASSBOLT_EMAIL_VALIDATE_MX environment variable to true.
 [HELP] Or set passbolt.email.validate.mx to true in /etc/passbolt/passbolt.php.
 [PASS] Serving the compiled version of the javascript app.
 [WARN] Some email notifications are disabled by the administrator.

 JWT Authentication

 [PASS] The JWT Authentication plugin is enabled
 [PASS] The /etc/passbolt/jwt/ directory is not writable.
 [PASS] A valid JWT key pair was found

 SMTP Settings

 [PASS] The SMTP Settings plugin is enabled.
 [PASS] SMTP Settings coherent. You may send a test email to validate them.
 [WARN] The SMTP Settings source is: env variables.
 [HELP] It is recommended to set the SMTP Settings in the database through the administration section.
 [WARN] The SMTP Settings plugin endpoints are enabled.
 [HELP] It is recommended to disable the plugin endpoints.
 [HELP] Set the PASSBOLT_SECURITY_SMTP_SETTINGS_ENDPOINTS_DISABLED environment variable to true.
 [HELP] Or set passbolt.security.smtpSettings.endpointsDisabled to true in /etc/passbolt/passbolt.php.

 [FAIL] 2 error(s) found. Hang in there!

It was on the host. And there is an /etc/passbolt folder inside the container

Ok, that healthcheck looks a better. The SSL issue is expected based on what you said about using self signed certs.

For the email issue can you check the database for any errors with email sending?
The query for that is select email, subject, error, created, sent from email_queue;

For mobile, since you are using an internal IP address, just to be 100% sure your phone is on the same network as the passbolt installation, correct?

The mail server tutorial doesn’t set up postfix for SMTP.

I should probably create a tutorial on postfix smtp configuration.

Yes the phone is on the same network.

But when I want to send a test email via CLI like in Troubleshoot Docker I get this:

www-data@f6dcfffe29e5:/usr/share/php/passbolt$ ./bin/cake passbolt send_test_email \
>   --recipient=gyro@jczeppeli.home

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
-------------------------------------------------------------------------------
 Debug email shell
-------------------------------------------------------------------------------
Email configuration
-------------------------------------------------------------------------------
Host: localhost
Port: 25
Username:
Password: *********
TLS: false
Sending email from: Passbolt <you@localhost.test>
Sending email to: gyro@jczeppeli.home
-------------------------------------------------------------------------------
Trace
Could not send the test email.
Error: stream_socket_client(): unable to connect to tcp:/localhost:25 (Cannot assign requested address)
www-data@f6dcfffe29e5:/usr/share/php/passbolt$ ./bin/cake passbolt send_test_email   --recipient=root@jczeppeli.home

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
-------------------------------------------------------------------------------
 Debug email shell
-------------------------------------------------------------------------------
Email configuration
-------------------------------------------------------------------------------
Host: localhost
Port: 25
Username:
Password: *********
TLS: false
Sending email from: Passbolt <you@localhost.test>
Sending email to: root@jczeppeli.home
-------------------------------------------------------------------------------
Trace
Could not send the test email.
Error: stream_socket_client(): unable to connect to tcp:/localhost:25 (Cannot assign requested address)

Try the ip address of the docker host. Localhost from the container is going to look for postfix in the container.

I am not really sure how to do that…

From Passbolt Help | Docker passbolt installation

These variables:
image

Specifically the EMAIL_TRANSPORT_DEFAULT_HOST

After I edited the docker-compose-ce.yaml file for the EMAIL_TRANSPORT_DEFAULT_HOST from localhost to the ip address of the host server now it shows this:

www-data@3786c68d834b:/usr/share/php/passbolt$ ./bin/cake passbolt send_test_email   --recipient=root@jczeppeli.home

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
-------------------------------------------------------------------------------
 Debug email shell
-------------------------------------------------------------------------------
Email configuration
-------------------------------------------------------------------------------
Host: 192.168.0.3
Port: 25
Username:
Password: *********
TLS: false
Sending email from: Passbolt <you@localhost.test>
Sending email to: root@jczeppeli.home
-------------------------------------------------------------------------------
Trace
[220] jczeppeli.home ESMTP Postfix (Ubuntu)
 EHLO localhost
[250] jczeppeli.home
[250] PIPELINING
[250] SIZE 10240000
[250] VRFY
[250] ETRN
[250] STARTTLS
[250] ENHANCEDSTATUSCODES
[250] 8BITMIME
[250] DSN
[250] SMTPUTF8
[250] CHUNKING
 MAIL FROM:<you@localhost.test>
[250] 2.1.0 Ok
 RCPT TO:<root@jczeppeli.home>
[250] 2.1.5 Ok
 DATA
[354] End data with <CR><LF>.<CR><LF>
 From: Passbolt <you@localhost.test>
To: root@jczeppeli.home
Date: Tue, 06 Jun 2023 16:07:17 +0000
Message-ID: <98e389d1216b44ca954614c4dc59fa72@3786c68d834b>
Subject: Passbolt test email
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Congratulations!
If you receive this email, it means that your passbolt smtp configuration is working fine.




.
[250] 2.0.0 Ok: queued as 1A01F18071E
 QUIT
The message has been successfully sent!

And after I wanted to log in with a new machine I could, but I had to wait a little bit for the email to arrive ( ~1-2mins ).

But the phone still inside an infinite loop of sign in after the certificate is installed…

Email is based on CRON and runs once a minute so this sounds right.

So then how could I connect my phone to my passbolt server?
I already installed the cert to my phone.

@Gyro First thing I would do is address the FAIL items in the healthcheck GPG section.