Articles in this section

Unable to send email via PHP on a Plesk server: Rejecting message: system user uid='XXXX' is not allowed to send mail

kb: bug kb: fixed Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Unable to send emails on a Plesk server via WordPress, PHP script, or webmail.

  • The following records appear in the /var/log/maillog log file:

    sendmail[12628]: handlers_stderr: ERROR:__main__:Rejecting message: system user uid='10000' is not allowed to send mail#012DATA REPLY:554:5.7.0 Your message could not be sent. The user johndoe is not allowed to send email.#012REJECT
    sendmail[12628]: REJECT during call 'limit-out' handler

  • The subscription was originally created on a service plan with disabled mail service, and then switched to another plan with enabled mail service.

Cause

Product issues:

  • #PPP-52477 "The plesk repair mail example.com command now repairs the Outgoing Mail Control subsystem more reliably."
    Fixed in:

Resolution

Please consider updating your server so the newly created subscriptions are not affected.

For the already affected subscriptions, perform the following:

Automatic solution
  1. Connect to the server via SSH.

  2. Execute the command below to fix issues with the Outgoing mail limits database:

    # plesk repair mail -y

Manual solution
  1. Connect to the server via SSH.

  2. Create a backup of the outgoing mail database:

    # cp -a /var/lib/plesk/mail/outgoing/data.db{,.backup}

  3. Add the missing system users into the database:

    # plesk db -Ne "SELECT login FROM sys_users" | while read login; do sqlite3 /var/lib/plesk/mail/outgoing/data.db "SELECT * FROM sysusers WHERE name = '$login'; " | grep -q '.'; [[ $? -ne 0 ]] && echo $login; done | while read login; do plesk db -Ne "SELECT d.name, su.login FROM domains d, hosting h, sys_users su WHERE d.id=h.dom_id AND h.sys_user_id=su.id AND su.login = '$login' AND webspace_id = 0"; done | while read domain sysuser; do echo "Fixing: $domain --> $sysuser"; plesk sbin mailmng-outgoing --add-subscription --main-domain-name="$domain"; plesk sbin mailmng-outgoing --add-sysuser --main-domain-name="$domain" --sysuser="$sysuser" ; done

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.