Articles in this section

Unable to send emails with PHP scripts or Plesk notifications: /usr/sbin/sendmail No such file or directory

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Unable to send emails with PHP scripts in Plesk with the following error in the log file /var/log/plesk-php*-fpm/error.log:

    # egrep -Ri sendmail /var/log/plesk-php*-fpm/error.log
    WARNING: [pool example.com] child 29450 said into stderr: "sh: /usr/sbin/sendmail: No such file or directory"

  • Plesk notifications, like an activation email, are not sent and the following error is shown in the log file/var/log/plesk/panel.log file:

    CONFIG_TEXT: ERR [panel] Unable to send mail: Unknown error
    ERR [panel] Failed to send activation link due to: Unable to send mail: Unknown error

  • Tools and Settings > Mail Server Settings shows that the installed mail server is Qmail

The Plesk Qmail wrapper exists:

# ls -lha /usr/lib64/plesk-9.0/qmail-sendmail-wrapper
-rwsr-xr-x 1 root root 108K Apr 14 10:33 /usr/lib64/plesk-9.0/qmail-sendmail-wrapper

Cause

Sendmail symlinks to the Plesk Qmail wrapper are missing or invalid

- Sendmail does not point to the /etc/alternatives/mta

# ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 21 Jan 29 13:35 /usr/sbin/sendmail

- Sendmail symlink does not exist

# ls -lha /usr/sbin/sendmail
ls: cannot access /usr/sbin/sendmail: No such file or directory

Resolution

  1. Connect to the server via SSH

  2. Unlink symlinks:

    # unlink /etc/alternatives/mta
    # unlink /usr/sbin/sendmail

  3. Create correct symlinks:

    # ln -s /etc/alternatives/mta /usr/sbin/sendmail
    # ln -s /usr/lib64/plesk-9.0/qmail-sendmail-wrapper /etc/alternatives/mta

Was this article helpful?

Comments

1 comment
Date Votes
  • Hi Renan Poss Moreira,


    May I ask, how may I recreate the link when using Postfix?

    Would it be:

    unlink /usr/sbin/sendmail
    ln -s /usr/sbin/sendmail.postfix-wrapper /usr/sbin/sendmail

     

    Any service restart required? The CLI?

    0

Please sign in to leave a comment.