Default PHP Mail Function Not Working in 9.5.2

Looking for assistance with a recent issue that has affected a couple of my ConcreteCMS websites. I recently upgraded them to Version 9.5.2 and after this the default PHP mail function is not working. When someone submits a form on the website, it just hangs up. If i try to send a test email it also hangs up. The website is hosted at SiteGround and from their support, they said that the application was generating so many php scripts that it locked up. More technical information coming in next post. Would really like some assistance to get this resolved. Thank you.

From SiteGround technical support

Hello Darrell,

I checked the matter, and the locking up of the contact form appears to be due to the way sendmail is being used. I managed to attach myself to the PHP process and noticed the following:

[pid  1557] 1781192611.325004 (+     0.000085) execve("/usr/sbin/sendmail", ["/usr/sbin/sendmail", "-bs"], 0x55ebc40427e0 /* 57 vars */) = 0
[pid  1557] 1781192611.325353 (+     0.000349) arch_prctl(ARCH_SET_FS, 0x41cd98) = 0
[pid  1557] 1781192611.325406 (+     0.000052) set_tid_address(0x41ced0) = 1557
[pid  1557] 1781192611.325459 (+     0.000052) writev(2, [{iov_base="", iov_len=0}, {iov_base="/usr/sbin/sendmail", iov_len=18}], 2) = 18
[pid  1557] 1781192611.325516 (+     0.000057) writev(2, [{iov_base="", iov_len=0}, {iov_base=": unrecognized option: ", iov_len=23}], 2) = 23
[pid  1557] 1781192611.325566 (+     0.000049) writev(2, [{iov_base="", iov_len=0}, {iov_base="b", iov_len=1}], 2) = 1
[pid  1557] 1781192611.325615 (+     0.000049) writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2) = 1
[pid  1557] 1781192611.325663 (+     0.000048) writev(2, [{iov_base="", iov_len=0}, {iov_base="/usr/sbin/sendmail", iov_len=18}], 2) = 18
[pid  1557] 1781192611.325716 (+     0.000052) writev(2, [{iov_base="", iov_len=0}, {iov_base=": option requires an argument: ", iov_len=31}], 2) = 31
[pid  1557] 1781192611.325765 (+     0.000049) writev(2, [{iov_base="", iov_len=0}, {iov_base="s", iov_len=1}], 2) = 1
[pid  1557] 1781192611.325816 (+     0.000050) writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2) = 1
[pid  1557] 1781192611.325867 (+     0.000051) getuid() = 517
[pid  1557] 1781192611.325913 (+     0.000045) open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid  1557] 1781192611.325961 (+     0.000048) fcntl(6, F_SETFD, FD_CLOEXEC) = 0
[pid  1557] 1781192611.326006 (+     0.000044) brk(NULL) = 0xe128000
[pid  1557] 1781192611.326053 (+     0.000046) brk(0xe12a000) = 0xe12a000
[pid  1557] 1781192611.326097 (+     0.000044) mmap(0xe128000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xe128000
[pid  1557] 1781192611.326154 (+     0.000056) mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff407e82000
[pid  1557] 1781192611.326204 (+     0.000050) fcntl(6, F_SETFD, FD_CLOEXEC) = 0
[pid  1557] 1781192611.326251 (+     0.000046) mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff407e81000
[pid  1557] 1781192611.326298 (+     0.000047) read(6, "root:x:0:0:Super User:/root:/usr/bin/bash\nbin:x:1:1:bin:/bin:/usr/bin/nologin\ndaemon:x:2:2:daemon:/bin:/usr/bin/nologin\nadm:x:3:4:adm:/var/adm:/usr/bin/nologin\nlp:x:4:7:lp:/var/spool/lpd:/usr/bin/nologin\nsync:x:5:0:sync:/bin:/bin/sync\nshutdown:x:6:0:shutdown:/bin:/bin/shutdown\nhalt:x:7:0:halt:/bin:/bin/halt\nmail:x:8:12:mail:/var/spool/mail:/usr/bin/nologin\noperator:x:11:0:operator:/root:/usr/bin/nologin\ngames:x:12:100:games:/usr/games:/usr/bin/nologin\nftp:x:14:50:FTP User:/var/ftp:/usr/bin/nologin\ntss:x:59:59:Account used for TPM access:/:/usr/bin/nologin\ndbus:x:81:81:System message bus:/:/usr/bin/nologin\npolkitd:x:114:114:User for polkitd:/:/usr/bin/nologin\nmemcached:x:189:189:memcached daemon:/:/usr/bin/nologin\nsystemd-network:x:192:192:systemd Network Management:/:/usr/bin/nologin\nsystemd-resolve:x:193:193:systemd Resolver:/:/usr/bin/nologin\nuwsgi:x:194:194:uWSGI daemon user:/usr/share/doc/uwsgi:/usr/bin/nologin\nvalkey:x:195:195:valkey daemon:/:/usr/bin/nologin\nunbound:x:196:196:Unbound DNS resolver:/var/l", 1024) = 1024
[pid  1557] 1781192611.326357 (+     0.000058) read(6, "ib/unbound:/usr/bin/nologin\nsystemd-timesync:x:197:197:systemd Time Synchronization:/:/usr/bin/nologin\nsystemd-oom:x:198:198:systemd Userspace OOM Killer:/:/usr/bin/nologin\nsystemd-coredump:x:199:199:systemd Core Dumper:/:/usr/bin/nologin\nnobody:x:65534:65534:Kernel Overflow User:/:/usr/bin/nologin\nu18-ajpe3jawjlsj:x:517:517:Customer:/home/customer:/bin/bash\n", 1024) = 361
[pid  1557] 1781192611.326405 (+     0.000048) close(6) = 0
[pid  1557] 1781192611.326448 (+     0.000042) munmap(0x7ff407e82000, 4096) = 0
[pid  1557] 1781192611.326504 (+     0.000056) uname({sysname="Linux", nodename="c44211.sgvps.net", ...}) = 0
[pid  1557] 1781192611.326552 (+     0.000048) mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff407e7d000
[pid  1557] 1781192611.326604 (+     0.000052) read(0,

Checking the calls, I noticed your site tries using sendmail -bs. However “-bs” flags are not supported by mini_sendmail, which is what we are using on our servers. As such, it is suggested that you review your application and configure it to use SMTP with a real email account, which should allow the contact form to function normally.

I would like to explain that we are not familiar with the setup of your sites. At this point I can only speculate the the updated ConcreteCMS defaults to sendmail -bs for email sending, but you should review the configuration across the sites. Any affected sites should either attempt their outbound messages set to use sendmail -t, or use SMTP with an actual email account.

Lastly, I would also like to mention something that happened after the timeout that I logged via strace in my previous reply - I noticed the following system call being recorded just before the end of the output:

1781192718.977521 (+     0.000069) writev(2, [{iov_base="/usr/sbin/sendmail: unexpected response 501 to RCPT TO command | ", iov_len=65}, {iov_base="501 SERVER_NAME=www.brandtackle.com: recipient address must contain a domain  ", iov_len=78}], 2) = -1 EPIPE (Broken pipe)

In addition to the sendmail -bs matter, this last entry suggests that the application is not sending the “To” headers properly, which is also something that your developer or you will need to review and address.

This continues to be a problem for me in version 9.5.2. My forms are failing to send out notification emails. The current workaround is to use SMTP mail as suggested above.

If you set ‘SMTP’ to Default and send a test email from the dashboard do you get an error:

Pasted Graphic

I did with three sites, so I removed the the ‘proc_open’ function from the options list in cPanel and all is good now. CMS 9.5.2, PHP 8.5.8.

No, the email test worked fine straight away. However, my client’s server is running PHP 8.1

So could be a PHP 8 issue?

Try updating PHP?