passbolt / passbolt_api

Passbolt Community Edition (CE) API. The JSON API for the open source password manager for teams!
https://passbolt.com
GNU Affero General Public License v3.0
4.73k stars 311 forks source link

E-mail for invites only works after 're-saving' e-mail settings #519

Open SaturnusDJ opened 2 months ago

SaturnusDJ commented 2 months ago

Probably not a Docker related bug, but...

Docker image: passbolt/passbolt:4.9.1.1-ce Database image: mariadb:11.2.2

Overlap with https://github.com/passbolt/passbolt_api/issues/456

Using these variables for e-mail:

EMAIL_DEFAULT_FROM_NAME
EMAIL_DEFAULT_FROM
EMAIL_TRANSPORT_DEFAULT_HOST
EMAIL_TRANSPORT_DEFAULT_PORT
EMAIL_TRANSPORT_DEFAULT_USERNAME
EMAIL_TRANSPORT_DEFAULT_PASSWORD
EMAIL_TRANSPORT_DEFAULT_TLS

With this configuration the initial registration e-mail will go out successfully. (bin/cake passbolt register_user ...) Thus proving that e-mail works.

When I open the page to send a test e-mail, the Send test email button is greyed out, but all settings (from vars above) are shown. The Save settings button is greyed out too. Then when making a one character change anywhere, and undoing that again, the buttons becomes clickable.

And only after clicking the save button, the invitation e-mails can get send out.

All e-mails should work immediately (as the configuration is valid, and proved to be working), and not only after saving the settings that are already known to Passbolt.

Possible related error:

PHP Fatal error:  Uncaught TypeError: fwrite(): supplied resource is not a valid stream resource in /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php:287
      
Stack trace:
#0 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php(287): fwrite()
#1 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php(214): Cake\Console\ConsoleOutput->_write()
#2 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Log/Engine/ConsoleLog.php(101): Cake\Console\ConsoleOutput->write()
#3 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Log/Log.php(392): Cake\Log\Engine\ConsoleLog->log()
#4 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Error/ErrorLogger.php(78): Cake\Log\Log::write()
#5 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Error/ErrorTrap.php(171): Cake\Error\ErrorLogger->logError()
#6 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Error/ErrorTrap.php(142): Cake\Error\ErrorTrap->logError()
#7 [internal function]: Cake\Error\ErrorTrap->handleError()
#8 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Network/Socket.php(371): fwrite()
#9 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php(600): Cake\Network\Socket->write()
#10 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php(571): Cake\Mailer\Transport\SmtpTransport->_smtpSend()
#11 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php(155): Cake\Mailer\Transport\SmtpTransport->_disconnect()
#12 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php(97): Cake\Mailer\Transport\SmtpTransport->disconnect()
#13 [internal function]: Cake\Mailer\Transport\SmtpTransport->__destruct()
#14 {main}
  thrown in /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php on line 287
ishanvyas22 commented 1 month ago

Hey @SaturnusDJ, we have created an internal ticket (PB-35723) to investigate this problem. We will get back to you as soon as we have any update for you.