• 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

Issue Email can't be sent to domain on the same server (but with external MX)

Leigh Jepson

New Pleskian
Hi All,

I'm currently using Plesk Onyx on Cloudlinux - out of the box (server was only set up and had data migrated from an 11.5 box in the last few weeks).

One of our clients can't send email through webmail to another domain, coming up with address not found error. The recipient domain is set up on the same server, but only has DNS set up, no web hosting or mail.

Because the recipient domain doesn't have mail set up, I can't disable it as per the KB article i've found.

Sending an email through a mail client doesn't have the same issue.

Ideas?

Leigh
 
Do you want to say that customer is trying to send email to a domain which does not have email setup? means no email address is created for that website yet?? Or that website has email addresses but on another server???
 
Yes, all of those apply.

Two different clients on the same Plesk server. The first uses email on the server, the second only has DNS set up. The first sends an email to the second (who has mail hosted externally) via webmail, and there is no DNS lookup to see where the second has email - instead just getting a user not found message. Doesn't happen with mail sent through SMTP.

Leigh
 
Webmail is using the OS vendor's PHP installation. If this is not set to SMTP-auth, it will probably look for the DNS resolution of the destination domain only. Maybe a workaround for the issue is to enter SMTP-auth data into the php.ini file of the OS vendor's PHP on the host you are on, e.g.

SMTP = smtp.example.com
smtp_port = 25
username = [email protected]
password = yourmailpassord
sendmail_from = [email protected]

Then the PHP mail() function will connect to the local SMTP server, authenticate just as if it was an external mail client software, submit the mail, and then DNS resolution will be performed through the SMPT server software. That will see the MX record pointing to an external server, thus the mail will not be delivered locally.

Your next question that you did not yet ask: "Where do I find the php.ini file"? --> It depends on your OS. Probaly in /etc/php.ini, but not sure. To find the php.ini file of the OS vendor PHP installation, set any domain or subscription to the PHP vendor PHP version, then open a phpinfo() file (or create one with this content:
<?php phpinfo(); ?>). It will display the correct path and location.

Remember to restart Apache after you have made the change to the php.ini file, because else the change may not be applied.
 
Webmail / plesk is set up as default out of the box - if it looked at DNS only, then it would work (as the server is authoritative for both domains). As it is, it's just giving it to postfix and postfix is saying 'i don't have this user'.

I could redirect all mail via PHP to a different SMTP server, but that's not fixing the problem.

This means that postfix obviously believes that it's handling mail for the destination domain. Where is this? I'm assuming that it's an SQL lookup?

Regards,
Leigh
 
If that was the case, why is mail that you submit to the server by SMTP delivered correctly to an external server?
 
Just had contact back from the customer - they are having the issue when using SMTP also. So, it does mean that for some reason Postfix does believe that it's handling mail for this particular domain.

Where is that set up? I'm assuming in a table in `psa` somewhere?

Regards,
Leigh
 
Always good to read that the initial issue description is not what is actually happening ...
Sending an email through a mail client doesn't have the same issue.

You can't deactivate "Activate mail service on this domain" in the e-mail settings of the destination?
 
Normally, hosted mail services like Office 365 provide a generic e-mail domain address where you can send mails to the recipients' mailbox without using their domain name, for example
[email protected]
The workaround for the issue is to enable the mail service on the local destination domain, but then forward all incoming mail to that generic address that the mail service provider has for the customer's account. Could that be a solution for your case?
 
No, we can't do that - they don't use Office 365.

Is it not possible to manually tell postfix that it doesn't deal with email for a particular domain?

Wonder if it's worth activating, then deactivating the mail for the domain - will that reset the postfix config?
 
Office 365 was just one example out of thousands. Your customer will most likely has a generic address with the external provider.

I am unaware of a fix for your issue and do not think that toggling mail will lead to the solution. I'll need to test this setup, but no time for it at the moment. Have you considered to open a ticket with Plesk support?
 
The other client is actually using one of our other mail platforms (provided by a third party), and I don't want to start making kludges if i can fix it properly.

Will have to raise a support ticket with Plesk themselves!

Thanks for your input though - it is appreciated!

Leigh
 
Back
Top