Symptoms
IP address cannot be deleted via Tools & Settings > IP Addresses > 203.0.113.2 > Remove:
Error: The IP address
203.0.113.2is already used for hosting.There are no domains assigned to this IP address
Previously, there were domains on this IP address, but they were switched to Forwarding or No Hosting hosting type in Domains > example.com > Hosting Settings
In Tools & Settings > Mail Server Settings > Outgoing mail mode is set to Send from domain IP addresses
Cause
Bug with ID #PPPM-8945, which will be fixed in future updates.
Resolution
Until the bug is fixed, the following workaround can be applied to switch mail to another IP address:
Connect to the server via SSH.
Create a list with the subscriptions assigned to the old IP address (replace
OLDIPADDRESSvalue with the actual IP address that needs to be removed):# OLDIPADDRESS="203.0.113.2"; plesk db -Nse "SELECT d.name FROM DomainServices ds INNER JOIN IpAddressesCollections ipac ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id JOIN IP_Addresses ip on ipac.ipaddressid=ip.id WHERE (ds.type = 'web' OR ds.type = 'mail') and ipac.ipAddressId = (select id from IP_Addresses where ip_address='$OLDIPADDRESS') GROUP BY d.name ASC" > subscriptions.list
Assign the affected subscriptions to a new IP address (replace
<new-ip-address>with one of the existing IP addresses in Plesk.):# cat subscriptions.list | xargs -i plesk bin subscription -u {} -ip <new-ip-address> -mail-service-ip <new-ip-address>