• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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