SMTP Config Woes

SMTP Config Woes

by Thomas Wiley -
Number of replies: 5

Good day All,

I had a successful Moodle 3.11 running and had to stand up a new server and installed Moodle 4.1. The site it running but I cannot get it to send e-mail through my AWS Simple Email Service account. I've tried sending test e-mails using the mailtest plugin as well as the test mail link in the server outbound config settings.  The relevant part of my ssl_error_log is below. I'm getting a timeout error, but this server has no activity so the timeout is because something isn't working.

Setup is:

- Redhat 8
- Apache 2.4
- PHP 8 (I also tried 7.4)
- MySQL 8

SSL_ERROR_LOG:

[Wed Dec 28 22:55:03.136896 2022] [proxy:debug] [pid 74882:tid 140136620730112] proxy_util.c(3006): AH02823: FCGI: connection established with Unix domain socket /run/php-fpm/www.sock (*)
[Wed Dec 28 22:55:03.137050 2022] [ssl:debug] [pid 74880:tid 140136629122816] ssl_engine_kernel.c(2266): [client 10.11.1.5:65255] AH02041: Protocol: TLSv1.3, Cipher: TLS_AES_128_GCM_SHA256 (128/128 bits)
[Wed Dec 28 22:55:03.137140 2022] [socache_shmcb:debug] [pid 74880:tid 140136629122816] mod_socache_shmcb.c(495): AH00831: socache_shmcb_store (0x63 -> subcache 3)
[Wed Dec 28 22:55:03.137164 2022] [socache_shmcb:debug] [pid 74880:tid 140136629122816] mod_socache_shmcb.c(849): AH00847: insert happened at idx=0, data=(0:32)
[Wed Dec 28 22:55:03.137170 2022] [socache_shmcb:debug] [pid 74880:tid 140136629122816] mod_socache_shmcb.c(854): AH00848: finished insert, subcache: idx_pos/idx_used=0/1, data_pos/data_used=0/200
[Wed Dec 28 22:55:03.137175 2022] [socache_shmcb:debug] [pid 74880:tid 140136629122816] mod_socache_shmcb.c(516): AH00834: leaving socache_shmcb_store successfully
[Wed Dec 28 22:55:23.156886 2022] [reqtimeout:info] [pid 74880:tid 140136629122816] [client 10.11.1.5:65255] AH01382: Request header read timeout
[Wed Dec 28 22:55:23.157089 2022] [ssl:debug] [pid 74880:tid 140136629122816] ssl_engine_io.c(1112): [client 10.11.1.5:65255] AH02001: Connection closed to child 5 with standard shutdown (server oms.gdit.com:443)
[Wed Dec 28 22:56:03.789500 2022] [proxy_fcgi:error] [pid 74882:tid 140136620730112] (70007)The timeout specified has expired: [client 10.11.1.5:65254] AH01075: Error dispatching request to : (polling), referer: https://oms.gdit.com/moodle/admin/testoutgoingmailconf.php
[Wed Dec 28 22:56:03.789557 2022] [proxy:debug] [pid 74882:tid 140136620730112] proxy_util.c(2368): AH00943: FCGI: has released connection for (*)

Any assistance or guidance is greatly appreciated.

Thank you,
Tom

Average of ratings: -
In reply to Thomas Wiley

Re: SMTP Config Woes

by Ken Task -
Picture of Particularly helpful Moodlers

I don't host on Amazon nor run your combo, so consider below so info for you to explore:

Debug references: mod_socache_shmcb.c
https://httpd.apache.org/docs/2.4/mod/mod_socache_shmcb.html

Is the mod for apache absolutely necessary?  Could comment out loading of it, restart apache, then TIA to see if error goes away.

Also check to see if the .so file related is really being found.

Plus:

moodle appears to be in a moodle directory from what you show in debug, but curl test to site / does get a Moodle Session cookie?

A curl test using /moodle/ begets HTTP/1.1 404 Not Found?!!!???

Is this a proxy issue?

'SoS', Ken


In reply to Ken Task

Re: SMTP Config Woes

by Thomas Wiley -
Thanks for looking Ken. I disabled mod_socache_shmcb, restarted and retried, same issue.

Our Moodle server is behind a load balancer and firewall restricted to U.S.-based IPs if you were trying to curl from outside the U.S.

Also, I can use openssl at the command line and send an SMTP e-mail on port 587. A tcpdump of port 587 shows no traffic on that port when I try to send from Moodle via test outgoing mail config though. I think that tells me it's at the application level.

Thanks again,
Tom
In reply to Thomas Wiley

Re: SMTP Config Woes

by Ken Task -
Picture of Particularly helpful Moodlers

Am in USA.

"behind a load balancer" ... so which node were you on when testing?  Would probably have to check from each node.

Is port 587 in the SMTP setup of Moodle?  If not, default is port 25.

From code/admin/cli/

php cfg.php |grep smtp

From command line of any of the nodes, is port 587 open to the node?

nmap -P0 -p 587 IPADDRESSOFSMTPSERVER

'SoS', Ken


Average of ratings:Useful (1)
In reply to Ken Task

Re: SMTP Config Woes

by Thomas Wiley -
Solved. I had TLS selected as the security type, but it was still sending out on port 25 (SMTP), which is blocked in our environment. Appended :587 at the end of the SMTP server URL and it worked.

Thanks all and Happy New Year!!!
Average of ratings:Useful (1)
In reply to Thomas Wiley

Re: SMTP Config Woes

by Ken Task -
Picture of Particularly helpful Moodlers

It's rare these days for any hosting provider to allow port 25 to be used with SMTP.  Many even go to greater lengths ... RackSpace as an example, actually list all of their IPv4 space in a blackhole service.   First time attempting to send via SMTP from a new RS install, failed ... even if all settings were correct.  Had to apply to blackhole service for a removal of the IP.

Guess am 'all' ... so welcome.  And the way to say thanks is to rate a response 'useful' but it's not required. smile

'Spirit of Sharing' (SoS),

Ken


Average of ratings:Useful (1)