Plesk

Unable to send email or create mailbox: Error: mailmng-outgoing failed: ERROR:outgoing:mails.domain_id may not be NULL

Symptoms

Cause

Plesk database inconsistency: wrong entries in psa.IpAddressesCollections table for the corresponding webspace.

Resolution

  1. Connect to the server via SSH;

  2. Create Plesk database backup;

  3. Access Plesk database;

  4. Get the ipCollectionId from the DomainServices that has mail service enabled:

    select ipCollectionId from DomainServices where type ='mail';
    +----------------+
    | ipCollectionId |
    +----------------+
    | 1 |
    | 3 |
    | 10 |
    | 12 |
    | 14 |
    | 17 |
    +----------------+

  5. Check the ID from IP_Addresses table:

    SELECT id from IP_Addresses;
    +----+
    | id |
    +----+
    | 1 |
    +----+

  6. Change the ipAddressId value to the ID shown in the previous step from the ipCollectionId ID's (step #4) on IpAddressesCollections table:

    UPDATE IpAddressesCollections SET ipAddressId='1' WHERE ipCollectionId in (1,3,10,12,14,17);

  7. Exit the database and run the following utility:

    # plesk repair mail -y

    If you see warning during repairing mail:

    We have found the database inconsistency. We strongly recommend that you run "plesk repair db" after the current command is finished or stopped. Once "plesk repair db" fixes the inconsistency, run "plesk repair mail" once again ............................................. [WARNING]

    It means that system found some inconsistency in Plesk database related to mail functionality, it requires to fix plesk database with command below and repair mail again:

    # plesk repair db

Exit mobile version