Email not sending after upgrading to v2

So i recently upgraded to passbotl v2 community edition and than to the pro edition however my email does not work.
When i use the email troubleshoot programm it shows this:
[250] PIPELINING
[250] SIZE 124***************
[250] VRFY
[250] ETRN
[250] STARTTLS
[250] ENHANCEDSTATUSCODES
[250] 8BITMIME
[250] DSN

A test email could not be sent.
Error: SMTP Error: 503 5.5.1 Error: authentication not enabled

However it worked perfect on v1 so heres my config from v1:

class EmailConfig {

    public $default = array(
            'transport' => 'Smtp',
            'from' => array('vault@hostingforyou.nl' => 'Passbolt'),
            'host' => 'localhost',
            'port' => 25,
            'timeout' => 30,
            'tls' => false,
            'log' => true
    );

heres my config from v2:

‘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),
‘client’ => env(‘EMAIL_TRANSPORT_DEFAULT_CLIENT’, null),
‘tls’ => env(‘EMAIL_TRANSPORT_DEFAULT_TLS’, false),
‘url’ => env(‘EMAIL_TRANSPORT_DEFAULT_URL’, null),
],
‘Debug’ => [
‘className’ => ‘Debug’
],
],

What i have tried:
-leaving tls on null instead of false
-using username and password null
-deleting the options username and password

/**
 * 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', 'vault@hostingforyou.nl'),
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    ],

Checklist
[ x] I have read intro post: About the Installation Issues category
[ x] I have read the tutorials, help and searched for similar issues
[ x] I provide relevant information about my server (component names and versions, etc.)
[ ] I provide a copy of my logs and healthcheck
[ ]x I describe the steps I have taken to trouble shoot the problem
[ x] I describe the steps on how to reproduce the issue

i have the same problem, after upgrading to v2 community and then pro edition.

@lanaiscool,
Did you try to let the username and password fields empty ?

that doesnt work that gives me an error in the app.php if i do that and if leave the username and password on null it still tries to authenticate

So your setup is a SMTP server with no TLS and no authentication right? (so that I can try to reproduce)

yes it sends thru postfix without authentication than it goes to the outside of the passbolt server and gets send through our authenticated smtp servers and than delivered

However it isnt getting to postfix because passbolt is trying to authenticate when that is not neccecary

Could you check if work when you remove the following line in app.php

    'username' => env('EMAIL_TRANSPORT_DEFAULT_USERNAME', null),
    'password' => env('EMAIL_TRANSPORT_DEFAULT_PASSWORD', null),

Maybe username and password shouldn’t be set (instead of being set to null) e.g. left unset for it to work, or you have an environment variable set?

already tried removing them didnt work

this is my whole email config:

'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),
    'client' => env('EMAIL_TRANSPORT_DEFAULT_CLIENT', null),
    'tls' => env('EMAIL_TRANSPORT_DEFAULT_TLS', false),
    '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’, ‘vault@hostingforyou.nl’),
    //‘charset’ => ‘utf-8’,
    //‘headerCharset’ => ‘utf-8’,
    ],
    ],

What happens when you manually run
/var/www/pb/bin/cake EmailQueue.sender
or
./bin/cake passbolt send_test_email

My email config (we use Office 365, wasn’t my decision):
# grep -A 30 "EmailT" /var/www/pb/config/passbolt.php

'EmailTransport' => [
    'default' => [
        'host' => 'smtp-mail.outlook.com',
        'port' => 587,
        'username' => 'emailname@domain.com',
        'password' => 'email_password',
        // Is this a secure connection? true if yes, null if no.
        'tls' => true,
        'timeout' => 30,
        //'client' => null,
        //'url' => null,
    ],
],
'Email' => [
    'default' => [
        // Defines the default name and email of the sender of the emails.
        'from' => ['emailname@domain.com' => 'Passbolt'],
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    ],
],

My crontab
# crontab -l
* * * * * su -c "/var/www/pb/bin/cake EmailQueue.sender >> /var/log/passbolt.log 2>&1" -s /bin/bash www-data
(for later work)

gives me an error about authentication not being on postfix
i have made a discovery when i use send test email with a username that i set it still shows username 0

Username: 0
Password: *********

I fixed it it was a problem on my end
I only edited app.php but when i edited passbolt.php it started working

If i try to empty the queue with cake EmailQueue.sender it still does nothing

Is it working now? I don’t understand where you are at sorry.

So when i use the send_test_mail it works it sends a test mail succesfully
However my cronjob is not working and if i manually use mailqueue.sender it does nothing
So it wont empty the queue

It’s the first time i’m hearing about this. Could it be because you’ve hit the maximum number of retries? Can you try editing an email record in the database and lowering the number to 0?

sure thing what table should i edit?

do you want me to empty the email_queue in the database ?

No not empty the email queue, just edit the “send_tries” of one of the emails that are not sending.
If send tries is > 3 email will not be find to be sent.

@lanaiscool actually there is already a command for that:

./bin/cake EmailQueue.sender clear_locks