Passbolt is not sending any email

I’m using passbolt docker(2.0.0-rc2). I started the container with the following variables:
-e “EMAIL_DEFAULT_FROM=passbolt@blub.de
-e “EMAIL_TRANSPORT_DEFAULT_HOST=send.one.com
-e “EMAIL_TRANSPORT_DEFAULT_PORT=465”
-e “EMAIL_TRANSPORT_DEFAULT_TLS=true”
-e “EMAIL_TRANSPORT_DEFAULT_USERNAME=passbolt@blub.de
-e “EMAIL_TRANSPORT_DEFAULT_PASSWORD=blubblub”
-e “APP_FULL_BASE_URL=https://myWebsite.de/passbolt” \

./bin/cake EmailQueue.preview is showing me a lot of emails. Headers:

From: passbolt@blub.de
Return-Path: passbolt@blub.de
To: myEmail@hotmail.com
Date: Sat, 31 Mar 2018 10:10:53 +0000
Subject: Welcome to passbolt, Samuel!
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

./bin/cake EmailQueue.sender is telling me nothing

The logs:
cli-debug.log:
2018-03-31 10:10:53 Notice: Notice (8): Trying to get property ‘url’ of non-object in [/var/www/passbolt/src/Template/Email/html/AN/user_register_self.ctp, line 22]
cli-error.log:
2018-03-30 16:16:56 Warning: Warning (2): array_keys() expects parameter 1 to be array, null given in [/var/www/passbolt/plugins/PassboltTestData/src/Shell/Task/DataTask.php, line 41]
error.log:
2018-03-31 10:02:00 Error: [Cake\Routing\Exception\MissingRouteException] A route matching “/settings.json” could not be found.
Request URL: /settings.json?api-version=v2

The smtp settings are working with other programs.

Hi Sam,

In passbolt v2 we have introduced a new tool to help debug the email configuration.

You can run the command below:
bin/cake passbolt send_test_email

It will give you more details about what is going wrong with your configuration.

Keep us posted with your findings.

Cheers,

Hi @kevin,
the output:

Warning Error: array_keys() expects parameter 1 to be array, null given in [/var/www/passbolt/plugins/PassboltTestData/src/Shell/Task/DataTask.php, line 41]

 ____                  __          ____  
/ __ \____  _____ ____/ /_  ____  / / /_ 

/ // / __ `/ / / __ / __ / / _/
/ / // ( |
) /
/ / /
/ / / /
/
/ _
,
/
//./_//__/

Open source password manager for teams

Debug email shell

Email configuration

Host: send.one.com
Port: 465
Username: passbolt@blub.de
Password: *********
TLS: true

Warning Error: key() expects parameter 1 to be array, string given in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 112]

2018-03-31 11:17:22 Warning: Warning (2): key() expects parameter 1 to be array, string given in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 112]

Warning Error: key() expects parameter 1 to be array, string given in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 113]

2018-03-31 11:17:22 Warning: Warning (2): key() expects parameter 1 to be array, string given in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 113]

Notice Error: String offset cast occurred in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 113]

2018-03-31 11:17:22 Notice: Notice (8): String offset cast occurred in [/var/www/passbolt/src/Shell/Task/SendTestEmailTask.php, line 113]

Sending email from: (p )
Sending email to: doesnotexist@passboltdummydomain.com

Trace

A test email could not be sent.
Error: SMTP timeout.

thanks for the fast reply

It looks like your configuration is not following the right format. Could you make sure that your Email section in passbolt.php looks like this:

'Email' => [
        'default' => [
            // Defines the default name and email of the sender of the emails.
            'from' => ['passbolt@your_organization.com' => 'Passbolt'],
            //'charset' => 'utf-8',
            //'headerCharset' => 'utf-8',
        ],

‘from’ should be an array containing the email as a key, and the name of the sender as a value.

ok. I don’t even have a “passbolt.php” only a “passbolt.default.php”. I have an “app.php” with the following email-configs:

‘EmailTransport’ => [
‘default’ => [
‘className’ => env(‘EMAIL_TRANSPORT_DEFAULT_CLASS_NAME’, ‘Smtp’),
// The following keys are used in SMTP transports
‘host’ => env(‘EMAIL_TRANSPORT_DEFAULT_HOST’, ‘localhost’),
‘port’ => env(‘EMAIL_TRANSPORT_DEFAULT_PORT’, 25),
‘timeout’ => env(‘EMAIL_TRANSPORT_DEFAULT_TIMEOUT’, 30),
‘username’ => env(‘EMAIL_TRANSPORT_DEFAULT_USERNAME’, null),
‘password’ => env(‘EMAIL_TRANSPORT_DEFAULT_PASSWORD’, null),
‘client’ => env(‘EMAIL_TRANSPORT_DEFAULT_CLIENT’, null),
‘tls’ => env(‘EMAIL_TRANSPORT_DEFAULT_TLS’, null),
‘url’ => env(‘EMAIL_TRANSPORT_DEFAULT_URL’, null),
],
‘Debug’ => [
‘className’ => ‘Debug’
],
],

/**
 * Email delivery profiles
 *
 * Delivery profiles allow you to predefine various properties about email
 * messages from your application and give the settings a name. This saves
 * duplication across your application and makes maintenance and development
 * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
 * for more information.
 */
'Email' => [
    'default' => [
        'transport' => env('EMAIL_DEFAULT_TRANSPORT', 'default'),
        'from' => env('EMAIL_DEFAULT_FROM', 'you@localhost'),
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    ],
],

passbolt.php is indeed not present in the case of a docker container environment.

For the rest, I have digged a little:

The error messages that you see in your console when you do a send_test_email do not prevent the email to be sent (it’s still a bug in our code which happens while using the docker container, which we’ll fix).

The send_test_email command returns A test email could not be sent. Error: SMTP timeout.. So it looks like your smtp server can’t be reached from inside the docker container for some reason (network issue, firewall, etc…). To debug this, you could probably open a console inside your container and try to connect to your smtp server with telnet.

Let me know how it goes.

Thanks for digging. I could solve the problem!

Hi @Sam,
Could you share the solution with the community.
Thanks a lot

I had to change the port from 465 to 587. I don’t really know why, but I think it has nothing to do with passbolt.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.