PHP sends no mail since last php 8.0/8.1 update

k1l0b1t

Verified User
Joined
May 10, 2020
Messages
525
Location
Belgium
Hello
I've noticed mail send with mail() does not send anymore since I updated php a few days ago. Anyone a clue what the cause can be?

Normal (smtp) mail works fine.
 
@smtalk some digging around made me see something funny:
sendmail got purged when I compiled php 8 yesterday, it's a directory now in /usr/sbin/sendmail/ with a link to /etc/exim in it. Going to /etc/exim I saw two files: one I made a while back, and a symlink that was created yesterday when I compiled php, redirecting back to /etc/exim (so an infinite loop)

1659965564812.png
 
it already fixed in custombuild. trying rebuild exim_conf again
 
Yes, the link is created on PHP update time. You may execute:
Code:
ln -nsf /usr/sbin/exim /usr/sbin/sendmail

Or simply re-build php. Sorry for the bug introduced.
 
Yes, the link is created on PHP update time. You may execute:
Code:
ln -sf /usr/sbin/exim /usr/sbin/sendmail

Or simply re-build php. Sorry for the bug introduced.
Can you push a php update to custombuild?

Fix this on a lot of servers one by one... its a real pain...

Thanks
Regards
 
If someone uses ansible, here is a playbook to fix this (centos7/almalinux8)

Code:
- hosts: all
  tasks:

    - stat:
       path: /usr/local/directadmin/directadmin
      register: directadmin

    - stat:
       path: /usr/sbin/exim
      register: eximfile

    - name: Validacion de directadmin
      fail:
       msg="Este playbook solo es para directadmin"
      when: directadmin.stat.exists == False

    - name: Validacion de eximfile
      fail:
       msg="No existe exim"
      when: eximfile.stat.exists == False

    - name: Reparamos sendmail 1/2
      file:
        src: /usr/sbin/exim
        dest: /usr/sbin/sendmail
        owner: root
        group: root
        state: link

    - name: Reparamos sendmail 2/2
      file:
        src: /usr/sbin/exim
        dest: /sbin/sendmail
        owner: root
        group: root
        state: link
 
Yes, the link is created on PHP update time. You may execute:
Code:
ln -sf /usr/sbin/exim /usr/sbin/sendmail

Or simply re-build php. Sorry for the bug introduced.
had to remove the symlink first on my debian11 box, but it works again now. Thanks.
 
Ran into the same issue on my servers after customers complaining that they were unable to send email. Can this symlink action be done on all servers, even those that are not updated yet?

I now have 40 servers with a mixture of sendmail symlinks to:
/usr/sbin/sendmail -> exim
/usr/sbin/sendmail -> /etc/alternatives/mta
/usr/sbin/sendmail -> /etc/exim
/usr/sbin/sendmail -> /usr/sbin/exim

This is a pretty big bug introduced, some more info would be welcome.
 
Last edited:
Ran into the same issue on my servers after customers complaining that they were unable to send email. Can this symlink action be done on all servers, even those that are not updated yet?

I now have 40 servers with a mixture of sendmail symlinks to:
/usr/sbin/sendmail -> exim
/usr/sbin/sendmail -> /etc/alternatives/mta
/usr/sbin/sendmail -> /etc/exim
/usr/sbin/sendmail -> /usr/sbin/exim

This is a pretty big bug introduced, some more info would be welcome.
Mentioned fix:
Code:
ln -nsf /usr/sbin/exim /usr/sbin/sendmail

Can be executed on every server with any version of CustomBuild, it's safe to do this.
 
Mentioned fix:
Code:
ln -nsf /usr/sbin/exim /usr/sbin/sendmail

Can be executed on every server with any version of CustomBuild, it's safe to do this.
Thanks for the hint, i can use this error to make a MASS command issue on WPDA for WordPress, send same command to multiple servers :)
 
Yes, the link is created on PHP update time. You may execute:
Code:
ln -nsf /usr/sbin/exim /usr/sbin/sendmail

Or simply re-build php. Sorry for the bug introduced.
Thanks, the command fixed the problem.
 
Mentioned fix:
Code:
ln -nsf /usr/sbin/exim /usr/sbin/sendmail

Can be executed on every server with any version of CustomBuild, it's safe to do this.
If the bug has been introduced by a directadmin(as custombuild its a integral part of directadmin) update to hundreds or thousands of servers, where only who was looking for information at forum will (eventually) find the fix for the problem, why not fix the problem in the same way?, thought custombuild pushing a automatic update, you have to think in the users who not know they are affected by this yet.
 
If I didn't stumble on this thread and test whether we were affected or not, I would not have known this was broken. I was just thinking something was going on with our visitors and no one was signing up for our newsletter anymore. I am sure many people are in the same situation and trying to figure out what is going on with their server.
 
It fixes it automatically with exim_conf, exim, php rebuild etc. We're considering bundling CustomBuild with DirectAdmin in the near future and having gradual rollout to prevent issues like this in the future. @BillyS - did you have automatic updates enabled?
 
Back
Top