Standard set-up - Plesk running various websites, but using external email services ie. the MX records are Gmail or whatever.
With this set up and the default Postfix settings, SMTP will try to deliver email addressed to Plesk virtual domains to locally configured email accounts, in other words only to those set up in Plesk. If you're not using your webserver to store email, then trying to send via you'll get the following error in /var/log/mail.log :
SMTP Error: The following recipients failed: email@example.com: <firstname.lastname@example.org>: Recipient address rejected: User unknown in virtual mailbox table
Note: I had to "ln -s /usr/local/psa/var/log/maillog mail.log" to get email logging into the /var/log/mail.log file.
To get the external routing working :
Remove $mydomain from mydestination variable.
# was mydestination = localhost.$mydomain, localhost, localhost.localdomain
mydestination = localhost, localhost.localdomain, my_web_server.com
Comment out the line :
#virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
Postfix mail service will now deliver email externally (ie. use MX records) for virtual domains.
You can also just comment out these 3 lines from /etc/postfix/main.cf to get Postfix to deliver mail externally only.
#virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains #virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual` #virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox`
There may be more than one virtual_mailbox_domains line as Plesk likes to add copies of it in there!