Email passwords being lost again.

:frowning:

I have never actually managed to make good use of the email module - but i have wrestled with smtp errors a few times and managed to get email notifications working. All good - until it stops working again, presumably its the upgrades?

At the most basic levelā€¦

My situation now is that If i go to

Admin>Email Settings>Outgoing Mail Configuration and then set the password before clicking ā€œSend Test Emailā€, it works.
But if i click ā€œSend Test Emailā€ a second time it fails with the error ā€œSMTP Error: Could not authenticateā€

Attempting to set the password and saving the Email settings also results in the same error.

Basically the ā€œsend Test Emailā€ only works immediately after setting the password.

i am slowly losing hope :frowning:

Maybe this can help you: https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/18311-where-is-smtp-credentials-stored

Iā€™ve experienced the same problem and I ended up having a static SMTP credential for the outbound email as it would always fail to authenticate otherwise.

Hi,

By setting ā€˜static SMTP credentialā€™ do you mean setting

    $this->Password = 'password';

in the SugarPHPMailer.php file?

That seems to have worked

@Bungle, on which SuiteCRM version are you?

Version 7.10.4
Sugar Version 6.5.25 (Build 344)

Can you please try to check if, despite that error, the account gets properly set up, and works well?

I am just trying to get a better idea of where the bug is.

Unfortunately it only works if i set the password in SugarPHPMailer.

The test email in Admin>Email Settings is only sent immediately after setting the password box. The second time i click ā€˜send test emailā€™ it fails, even though i have not saved the page.

However, in ā€˜Admin>Outgoing Emailā€™ the test email works indefinitely - until the settings are saved.

ahh!

Setting the password in ā€˜Admin>Outbound Emailā€™ updates the ā€˜mail_smtppassā€™ for the ā€˜systemā€™ type account in the ā€˜outbound_emailā€™ table; to the correct value - and my workflows send email. All good.

However, setting the password in ā€˜Admin>Email Settingsā€™ updates the same field in the table, but with an incorrect value - email stops working.

This may explain why my email stopped working - it wasnā€™t the upgrade, email password changed and i most likely tried to update the password in Admin>Email Settings.

The error must be in the code that writes the password in the ā€˜Admin>Email Settingsā€™ page?

Hello. Iā€™ve been trying to reproduce your Issues in my test installation of 7.10.4, but I canā€™t.

I tried the one about sending the test email twice, but it works well both times.

I tried changing the password from the Admin / Email settings screen, but it changes the password correctly for meā€¦

?

Very strange, i havenā€™t customised any code - perhaps my instance hasnā€™t upgraded properly at some point?

For the moment i have a workaround, though not sure how secure it is to have the password in SugarPHPMailer?

You and me both on this one.

Setting the password as static should be relatively safe as long as no one has access to your codes. And who would look into a SugarPHPMailer file?

This just occurred recently for us.

Both of you, please donā€™t give up on getting to a reproducible version of this bug. We need to be 100% relentless with Email bugs, squash all of them one by one until we drive up the quality in this module. This is much needed and my main concern at the moment.

i donā€™t want to give up, i just donā€™t have the skill set to find the root of the problem. But i am more than happy to help if i can.

The help file mentions 4 types of email accounts, and one of those is outgoing email accounts. It then goes on to say that you set the default email settings in Admin>Email Settings.

However there is also a system type email account listed in Admin>Outgoing Email.

This is duplicating the way you can set the default settings and is confusing, and its also making it harder to locate the problem.

Getting rid of the Admin>Email Settings page would be the best option - leaving just one page (outgoing Email) where you setup a ā€˜systemā€™ type account for default settings.

Now i need to find out why the personal email has stopped working too, its just saying loading in the mail settings page - then crashes the system with a proxy error? The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /crm/index.php.

:frowning:

On the plus side, weā€™ve narrowed it down to the authentication problem. Iā€™ve also noticed that multiple credentials are stored on the ā€œoutbound_emailā€. The problem might lie on the queries that fetch the credentials to be used for the SMTP.

Thanks to both of you.

@iamreb, what do you mean about the outbound_emails table? Do you get more than one row for a single account? If you can paste (obfuscated) contents of your table, I would appreciate it.

After todayā€™s upgrade to 7.10.5 the Admin>Email Setting page does not save the record at all; no error message in log file (previously i had incorrect password being saved)

As a result i now now have an error message which is appearing on every single view, which on a mobile device takes up a LOT of screen space.
: ā€œNote: To send record assignment notifications, an SMTP server must be configured in Email Settings.ā€.

On the plus side, the emails are still being sent; which i assume is because the outbound_email table is no longer being update with the incorrect password.

This post solved the problem for me https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/19163-email-sending-settings#66312 .

After resetting the static password in sugarPHPMailer iā€™m back to where i was before the upgrade

Hello,

Yes upon checking there are duplicates in the ā€œoutbound_emailā€ per ā€œuser_idā€

Did you pay attention to the ā€œdeletedā€ column? If ā€œdeleted=1ā€ they wonā€™t be used.