magepal / magento2-gmail-smtp-app

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
https://www.magepal.com
319 stars 148 forks source link

Module not reading correct password from configuration #155

Closed mthorzen closed 4 years ago

mthorzen commented 4 years ago

Magento version #:

2.3.3 (PHP: 7.2.24)

Edition (EE, CE, OS, etc):

CE

Expected behavior:

I save my password in the configuration and it is used by the module to send emails using SMTP when i press send test email.

Actual behavior:

I save my password, even after flushing cache and cache storage, the module finds another password, I recognize the password from some other place I've been using it. I am not sure where, it is not the password of my magento user. I have tried to delete the config row in core_config_data table, when I save my config it does save a new value each time. However, everytime it picks it up it retrieves the wrong password. If I press send test email entering the password without pressing save configuration, it works.

mthorzen commented 4 years ago

I have also tried the fixes for PHP 7 written in another issue https://github.com/magepal/magento2-gmail-smtp-app/issues/7#issuecomment-190306689 The array clone fix is already present in my Magento version and the other fix with looping through the data to set the _source did not help.

srenon commented 4 years ago

Check your config.php and env.php to see if the password is stored there

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-config-mgmt-export.html

mthorzen commented 4 years ago

I can only find one password in those two files, the database connection password. I tried searching (grepping) the magento directory for the password that I do get in the module and I cannot find anything. Seems like it comes from the database.

mthorzen commented 4 years ago

@srenon Thanks for your answers but my problem persists, is there anything else I could try?

srenon commented 4 years ago

This should not require more than a 10 minutes debugging

  1. Set a breakpoint and check the password at https://github.com/magepal/magento2-gmail-smtp-app/blob/master/Model/TwoDotThree/Smtp.php#L153

  2. check your core config data table to see how many entries for the password

  3. check what value is for returned for that password config value using https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-config-mgmt-set.html