Mail Gets Delivered Through the plesk_virtual Service

By default, when you create an account in Plesk, local mail delivery gets enabled for it. No matter how many times you tell it to route mail according to the DNS MX record, it will still stubbornly deliver mail for the domain locally.

As a result, the postfix log file (/usr/local/psa/var/log/maillog) shows entries like this:

postfix/pipe[19101]: 4986B18E20FE: to=<[email protected]>, relay=plesk_virtual, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered via plesk_virtual service)

You can’t fix this mess through the web UI.

Run this on the server console:

/usr/local/psa/bin/mail -off domain.com

No need to restart anything. It’ll just start working.

If you need to disable local delivery for all domains, run this loop:

for domain in $(echo "select name from domains;" |mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa);
do
   /usr/local/psa/bin/mail --off $domain;
done