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
 
Back
Top