Symptoms
-
Unable to create a mailbox for a Plesk domain or subdomain with one of the following errors after
plesk repair mail
command-line utility was executed:mailmng-outgoing failed: ERROR:__main__:NOT NULL constraint failed: mails.domain_id
mailmng-outgoing failed: ERROR:__main__:NOT NULL
-
Restoring outgoing mail limits database fails:
# /usr/lib/plesk-9.0/remote_mail_restore/mail_outgoing_restore
Error: UNIQUE constraint failed: vhost_ids.guid
Cause
Product issue:
- #PPPM-11954 “It is now possible to create a mailbox on a subdomain after the plesk repair utility fixed the subdomain.”
Fixed in:- Plesk Obsidian 23 June 2020 (Linux)
Resolution
Please consider updating your server:
Investigate the reason why these steps are necessary on servers > 18.0.28
If Plesk Obsidian 18.0.28 or later is already installed, but the issue persists, run bootstrapper script task for the installed Plesk version:
For example, for Plesk Obsidian 18.0.33:
# /usr/local/psa/bootstrapper/pp18.0.33-bootstrapper/bootstrapper.sh rerun
If Plesk Update can not be installed, the following workarounds are available:
Create record for the domain in mailmng database via mailmng CLI utility:
-
Connect to the server via SSH
-
Run the following command for the affected domain:
# /usr/local/psa/admin/bin/mailmng-outgoing –add-subscription –main-domain-name=example.com
Create record for the domain in mailmng database via SQLite
-
Connect to the server via SSH
-
Back up the outgoing mail database:
# cp /var/lib/plesk/mail/outgoing/data.db{,_bk}
-
Log in to the database and check that the record does not exist for the domain:
# sqlite3 /var/lib/plesk/mail/outgoing/data.db
select * from domains where name like ‘%example.com%’;
-
Create the record and exit the database:
insert into domains(id,name,subscription_id,out_limit) values (4, ‘example.com’, 3, 50);
.quit
Disable “Outgoing Mail Control”
- Login to Plesk
- Disable “Outgoing Mail Control” feature in Tools & Settings > Mail Server Settings > by unticking Switch on limitations on outgoing email messages
- Click OK