Describe the issue or problem
After updating OJS from 3.3.0-17 to 3.4.0-6 I can no longer send emails. With the same configuration I have never had problems with ojs 3.3.x
Any suggest? Thank you Steps I took leading up to the issue
For example:
Go to Users&role
Choose an user
Click on “email”
Send a test email to an user
In apache log I see this error: "Got error ‘PHP message: Connection to “*****smtp.com:25025” timed out.’,
What application are you using?
OJS 3.4.0-6
PHP 8.1
Ubuntu 22.04
Additional information config.inc.php mail configuration:
; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = smtp
; Path to the sendmail, -bs argument is for using SMTP protocol
sendmail_path = “/usr/sbin/sendmail -bs”
; Use SMTP for sending mail instead of mail()
smtp = On
; SMTP server settings
smtp_server = *****smtp.com
smtp_port = 25025
Thanks @rcgillis for the advice. In the meantime I did some troubleshooting and I read in the documentation that the email management library changed between 3.3 (phpmailer?) and 3.4 (laravel?). I used the exact same configuration which works correctly with 3.3 but not on 3.4.
I tried with telnet and the connection to the SMTP server on port 25025 is successful. Since everything worked correctly with 3.3 I think there is something in the library, but I don’t know if there are more detailed logs than the Apache ones, perhaps a debug variable to set, to have more detailed smtp log.
Thank you
Starting with OJS 3.4.0, we use Laravel’s Mailables toolkit, which in turn relies on Synfony’s mailer for SMTP delivery. You could look into lib/pkp/lib/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php in the start function, where I think at a glance the connection to the server is established. Going one step deeper into the code, lib/pkp/lib/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php should be where the socket is implemented.
Regards,
Alec Smecher
Public Knowledge Project Team
Unfortunately I wasn’t able to go any further in resolving the problem, so I solved it by changing the smtp service. Using google workspace’s smtp-relay service everything works perfectly. Thank you