• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved PHP and Plesk sending mails

Denis Gomes Franco

Regular Pleskian
Hi,
I'm setting up my Plesk server and some domains that I'm hosting are using external mailbox services. When Plesk (or a PHP script such as a Wordpress site from another domain) tries to send an email to one of these domains, that message is routed locally and thus never reaches inbox. I understand this is the default behavior, eg, if the mailbox is locally hosted, why should the message go out on the internet ;)

So, is there any way to make Plesk (or Postfix?) always query MX records instead of just delivering mail locally? I remember years ago seeing something like that on Cpanel that would fix this specific problem.
 
Solution: Disable the mail service for the domain (Login => Domains => "Mail settings" => uncheck "Activate mail service on this domain"). Once you've done that, Plesk will not consider the domain as a local domain and will use DNS to route the mail to the MX servers.
 
I just had the same issue, this does not work. Even if you disable the mailservice, subsciption by subsciption or in general setting, this does not work, plesk will try to use virtual_relay anyway.

You have to disable the plesk virtual relay in main.cf if you use postfix :

here are the lines I commented :

I replalced :
#mydestination = localhost.ovh, localhost, localhost.localdomain
by
mydestination =

but this did not work. then, I commented :

#virtual_transport = plesk_virtual

but this did not work either, and finally, I commented :

#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

and now, mails are sent only toward external relays.

maybe commenting only the 3 latest lines will work. Hope this will be fixed by plesk because this is a very old issue !
 
I just tried with the 3 lines comented, and it works :
#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

plesk will not try to user it own relay. Mails are going out to external relays
 
lucky you, it did not work for me on 2 plesks, one with subsription, and other with only domain managment :( Maybe I should try to re activate mail service in main setings, and desactivate one by one the mail option for each domain / subscription, but this is quite painful :(
 
Back
Top