itflow icon indicating copy to clipboard operation
itflow copied to clipboard

Application Hangs when sending Test Email

Open justnwaters opened this issue 1 year ago • 4 comments

Describe the bug When I attempt to test sending an email the entire website hangs. It's inaccessible from any device or location until the timeout is over.

Can you reproduce this on the demo at demo.itflow.org No it works fine in the test environment

Are you on the latest available version of ITFlow, with an up-to-date database structure? Yes

To Reproduce I'm using the latest cPanel with 8.1 I'm not sure if you have a script to test that I have every required plugin or maybe the auto install isn't compatible with cPanel.

Expected behavior Report a successful email sent and be able to check the receiving email box for the email.

Screenshots NA

Additional context NA

--

To privately discuss a security issue, please see https://github.com/itflow-org/itflow/security

justnwaters avatar Jun 04 '23 01:06 justnwaters

Hello & Welcome! :)

Thanks for taking the time to get in touch. We'll review this issue shortly.

Whilst you're waiting, please feel free to check out the forum.

github-actions[bot] avatar Jun 04 '23 01:06 github-actions[bot]

Hey!

Just for future reference: It's not a great idea to leave your valid mail credentials on the demo :) However that has assisted in troubleshooting as it rules out your hostname/username/password/encryption being incorrect.

You mentioned you're hosting this on cPanel, are you hosting this yourself? Some providers block outbound mail traffic.

Could you check your PHP error log please? When the mail send fails it should log the PHP Mailer error details there starting with "ITFlow - failed to send email".

Regarding the "freezing": we currently test & send mails in real time rather than putting them into a queue so I guess it blocks the thread until the connection times out (Which also makes me think this is a network issue). Perhaps we should adjust the timeout to like 10 seconds? (I think 5 mins is the default!).

wrongecho avatar Jun 04 '23 07:06 wrongecho

I've been messing with the PHP Mailer timeout value and this seems to have no effect on the server hanging if the encryption details are specified incorrectly. PHP Mailer says this is fixed but we're on the latest version and I'm still able to reproduce on Windows and Linux.

https://github.com/PHPMailer/PHPMailer/issues/604

wrongecho avatar Jun 13 '23 20:06 wrongecho

We're moving to a queue based mail system across the app, but this bug could still show up on the settings test page. I don't really have any ideas on how to fix it - seems like either an issue with PHP Mailer or PHP itself.

wrongecho avatar Jun 24 '23 20:06 wrongecho