Symptoms
-
Unable to create a mail account for an existing domain or plesk repair mail utility fails with one of the following errors:
Error: mailmng-outgoing failed: ERROR:outgoing:mails.domain_id may not be NULL
Error: mailmng-outgoing failed: ERROR:outgoing:domains.subscription_id may not be NULL
Error: mailmng-outgoing failed: ERROR:outgoing:mail_aliases.mail_id may not be NULL
Cause
Inconsistency in the Plesk database and/or the external SQLite database controlling outgoing mail limits.
Resolution
Note: The solution described in this article requires root access, if it's not available please contact the hosting service provider
-
Connect to the server via SSH
-
In case there is any customization in the Mail Server configuration files, back them up:
For Postfix:
# cp -rp /etc/postfix{,.old}
For Qmail:
# cp -rp /var/qmail/control{,.old}
-
# plesk db dump psa apsc > psa_apsc_backup.sql
-
Repair any Plesk database inconsistency:
# plesk repair db -y
-
Repair any mail inconsistencies:
# plesk repair mail -y
-
If the issue persists, back up the outgoing mail limits database:
# mv /var/lib/plesk/mail/outgoing/data.db{,_bk}
-
Repair outgoing limits configuration:
On RHEL/CentOS based systems:
# /usr/lib64/plesk-9.0/remote_mail_restore/mail_outgoing_restore
On Debian/Ubuntu based systems:
# /usr/lib/plesk-9.0/remote_mail_restore/mail_outgoing_restore