Issue Sending Email from a subdomain - Relay Access Denied

MHC_1

Regular Pleskian
Server operating system version
Almoa Linux 9
Plesk version and microupdate number
18.0.74
We have just moved a set of accounts from WHM to Plesk. On WHM they all worked perfectly.

On Plesk, there is an issue that sending Script based emails (eg from PHP Script ; not from a mail client) from a subdomain to any 3rd party email account is failing because the subdomain is trying to send via the parent domain (a separate account on Plesk) . Both domains have working SPF records.

Maillog:

Dec 3 09:32:22 server postfix/smtpd[4138345]: connect from localhost.localdomain[::1]
Dec 3 09:32:23 server postfix/smtpd[4138345]: NOQUEUE: reject: RCPT from localhost.localdomain[::1]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<admin.domain.co.uk>

SPF admin.domain.co.uk:

v=spf1 +a +mx +ip4:server_ip +a:domain.co.uk +include:domain.co.uk -all

SPF domain.co.uk:
v=spf1 +a +mx +ip4:server_ip +a:admin.domain.co.uk +include:admin.domain.co.uk -all

We have run

# plesk repair mail

Which has returned no errors or issues on any mail accounts.

What do we need to do to enable a subdomain to send emails outside the server and set as coming from the parent domain?
 
We have also moved the two domains on to the same subscription on Plesk but this doesn't appear to make a difference.

Here is also the core output from PHPMailer (only Debug level 2):


2025-12-03 12:06:29 SERVER -> CLIENT: 220 server.co.uk ESMTP Postfix
2025-12-03 12:06:29 CLIENT -> SERVER: EHLO admin.domain.co.uk
2025-12-03 12:06:29 SERVER -> CLIENT: 250-server.co.uk250-PIPELINING250-SIZE 25067520250-ETRN250-STARTTLS250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 CHUNKING
2025-12-03 12:06:29 CLIENT -> SERVER: MAIL FROM:<[email protected]>
2025-12-03 12:06:29 SERVER -> CLIENT: 250 2.1.0 Ok
2025-12-03 12:06:29 CLIENT -> SERVER: RCPT TO:<[email protected]>
2025-12-03 12:06:29 SERVER -> CLIENT: 554 5.7.1 <[email protected]>: Relay access denied
2025-12-03 12:06:29 SMTP ERROR: RCPT TO command failed: 554 5.7.1 <[email protected]>: Relay access denied
2025-12-03 12:06:29 CLIENT -> SERVER: RCPT TO:<[email protected]>
2025-12-03 12:06:29 SERVER -> CLIENT: 554 5.7.1 <[email protected]>: Relay access denied
2025-12-03 12:06:29 SMTP ERROR: RCPT TO command failed: 554 5.7.1 <[email protected]>: Relay access denied
2025-12-03 12:06:29 CLIENT -> SERVER: RSET
2025-12-03 12:06:29 SERVER -> CLIENT: 250 2.0.0 Ok
SMTP Error: The following recipients failed: --- : <-@-->: Relay access ---: <-@-->: Relay access denied
2025-12-03 12:06:29 CLIENT -> SERVER: RSET
2025-12-03 12:06:29 SERVER -> CLIENT: 250 2.0.0 Ok
2025-12-03 12:06:29 CLIENT -> SERVER: QUIT
2025-12-03 12:06:29 SERVER -> CLIENT: 221 2.0.0 Bye
 
Anyone able to advise on this topic? Web searching brings up nothing that's applicable in this case
 
I face the same issue on windows hosting, Asp.Net Core EF Core and plesk panel. Both main domain and subdomain are on the same server, main domain can send emails and they are delivered. However, emails sent from subdomain never reach to the target, although they seem to be sent from main domain smtp server.

I tried signing messages with DKIM through plesk panel and using custom dkim generator, also activated smtp for subdomain (without using main domain smtp) but it didn't work!
 
Hello,

By default Plesk require authentication when relaying even using localhost. You can add 127.0.0.1 and ::1 in Tools&Settings -> Mail Server settings -> White list to disable this requirement. Alternately - switch script to using sendmail or add authentication.

Thanks,
 
It turned out that the PMG service has blocked the subdomain! After removing the domain from blocklist everything worked as expected.
 
Hello,

By default Plesk require authentication when relaying even using localhost. You can add 127.0.0.1 and ::1 in Tools&Settings -> Mail Server settings -> White list to disable this requirement. Alternately - switch script to using sendmail or add authentication.

Thanks,

All of these systems are already in place;
 
Back
Top