We are in the process of migrating to a new VM, and have set up a test server there, and I cannot get my new test site to send mails.
- The test server is running the exact same Moodle version (3.6.7) with the same config and database dump as my old test server.
- config.php has "divertallemailsto" set on both servers.
- command-line "sendmail" works on both servers
- a php script with the command "mail" works on both servers
- sending messages to users or posting in a forum does not create e-Mails on the new test server, only on the old one
- if i create a forum post to trigger e-mails, and run the cron job with cron debugging set to true, i get this error:
* line 81 of /admin/cron.php: call to cron_run() post 105337: test debx mail 12:15 Processing user 16905 Sending <pre> </pre><pre> 2020-01-07 11:16:01 Connection: opening to localhost:25, timeout=300, options=array() 2020-01-07 11:16:01 Connection failed. Error #2: stream_socket_client(): unable to connect to localhost:25 (Connection refused) [/var/www/moodle/lib/phpmailer/src/SMTP.php line 319] 2020-01-07 11:16:01 SMTP ERROR: Failed to connect to server: Connection refused (111) 2020-01-07 11:16:01 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Error: lib/moodlelib.php email_to_user(): SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting </pre>++ Error calling message processor email ++
I ran out of ideas as to what could be the problem, any help would be appreciated