Hi I’ve noticed that mails I’m sending via the php mail() function are being rejected by a number of mailservers.
It looks like the servers in question have been configured to do “Sender Address Verification” as can be seen in this snippet from the postfix log on one I can access:
>>> START Sender address RESTRICTIONS <<<
generic_checks: name=reject_unknown_sender_domain
reject_unknown_address: 121810@us-imm-node1b.000webhost.io
ctable_locate: move existing entry key 121810@us-imm-node1b.000webhost.io
reject_unknown_mailhost: us-imm-node1b.000webhost.io
lookup us-imm-node1b.000webhost.io type MX flags 0
dns_query: us-imm-node1b.000webhost.io (MX): Host not found
lookup us-imm-node1b.000webhost.io type A flags 0
dns_query: us-imm-node1b.000webhost.io (A): Host not found
lookup us-imm-node1b.000webhost.io type AAAA flags 0
dns_query: us-imm-node1b.000webhost.io (AAAA): Host not found
NOQUEUE: reject: RCPT from us-imm-postlady1.000webhost.io[153.92.0.72]: 450 4.1.8 <121810@us-imm-node1b.000webhost.io>: Sender address rejected: Domain not found; from=<121810@us-imm-node1b.000webhost.io> to=<flying@c-hacker.co.uk> proto=ESMTP helo=<us-imm-postlady1.000webhost.io>
generic_checks: name=reject_unknown_sender_domain status=2
>>> END Sender address RESTRICTIONS <<<
As you can see the DNS lookup on the name of the sending mailserver “us-imm-node1b.000webhost.io” is failing and causing the message to be rejected as the originating mailserver is not to be trusted.
So my question is: Is there a way to send email via php mail() that come from a server that is DNS resolvable or is there a way to send mails from php using another smtp server?
Or am I out of luck and will have to move the site elsewhere?