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
May 18 10:37:46 localhost journal: plesk sendmail[12628]: REJECT during call 'limit-out' handler -
Previously, the subscription was created on 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 <domain|mail-address> command now repairs the Outgoing Mail Control subsystem more reliably."
Fixed in:- Plesk Obsidian 13 October 2021 (Linux)
Resolution
Please consider updating your server so the newly created subscriptions are not affected.
For the already affected subscriptions, perform the following:
Automatic solution
-
Connect to the server via SSH.
-
Execute the command below to fix issues with the Outgoing mail limits database:
# plesk repair mail
Manual solution
-
Connect to the server via SSH.
-
Create a backup of the outgoing mail database:
# cp -a /var/lib/plesk/mail/outgoing/data.db{,.backup}
-
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