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:CONFIG_TEXT: 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:
-
Connect to the server via SSH.
-
Execute the command below to fix issues with the Outgoing mail limits database:
# plesk repair mail
-
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
Comments
11 comments
I need to use this workaround for every new subscription. Plesk is up-to-date.
Are there any other solutions on this topic?
I don't think this issue has been fully fixed. I just encountered this issue my server with Plesk version 18.0.33.
Same here on several subscriptions....no clue where this problem comes from
I made a cronjob on all Plesk servers with the script from above, because it's happening over and over again
Hi there!
The bug mentioned in this article was fixed in Plesk Obsidian 18.0.28 but it might be possible that the consequences of this bug are present on newer Plesk versions.
Stefan Wolf If this issue is encountered on newer Plesk versions, apply the workaround available in this article. In case the issue persists after applying the workaround, please submit a ticket to Plesk Support to investigate this issue further.
I've opened a support request and got confirmation that this problem is known and worked on (#PPP-50568)
Hello Christoph Roethlisberger,
The issue you encountered is described in the following KB article: https://support.plesk.com/hc/en-us/articles/360016874959
After running the query above on a fresh plesk install with this sendmail outgoing permissions issue I'm seeing an error when enabling email on a domain using the plesk UI. Be sure to take seriously the instruction step to make a backup of the db file before proceeding!
Error: mailmng-outgoing failed: ERROR:__main__:UNIQUE constraint failed: domains.name
Hi Tony,
I tried to reproduce the issue but I could not. All good on my server.
Please try "plesk repair mail" via ssh or open a ticket with us if the issue persists.
How is rollback? It's just replace data.db file? am I must restart mail server ?
Greg G, hi! if u performed the backup then:
cp -a /var/lib/plesk/mail/outgoing/data.db.backup cp -a /var/lib/plesk/mail/outgoing/data.db
Please sign in to leave a comment.