I am having trouble with failing to deliver mails with my setup.
Server 1 - example.com
+ Direct Admin IP: 111.111.111.111
, default domain (provided by hosting company: vps11111.company.com
Server 2 - dev.example.com
, IP: 222.222.222.222
, default domain (provided by hosting company: vps222222.company2.com
A Jira instance runs on dev.example.com
, I am sending an invitation email being logged in as [email protected]
to [email protected]
SMTP error from remote mail server after RCPT TO:<[email protected]>: host mx.poczta.onet.pl [213.180.147.146]: 554 5.7.1 <[email protected]>: Recipient address rejected: Spf check: fail
Test
Return-path: <[email protected]> Received: from dfault.return.serv2.dns ([222.222.222.222] helo=vps222222.company.com) by vps11111.company.com with esmtpa (Exim 4.82) (envelope-from <[email protected]>) id 1aILXy-00044d-K9 for [email protected]; Sun, 10 Jan 2016 20:21:02 +0100
I have set the TXT record on example.com Direct Admin of dev.example.com
to:
"v=spf1 a mx ip4:222.222.222.222 ~all"
A
records for mail, smtp and pop are left to 111.111.111.111 (jira setup to use [email protected]
address).
A
records for dev.example.com., ftp and www are set to 222.222.222.222.
I am confused about all this setup (my first time) and would appreciate any help.
The problem is that the email is sent with the envelope sender set to your gmail address. That means that the SPF record that is being checked is the record for gmail.com, not the one for your own domain.
You need to fix your setup so that you either use your own address as sender, or so that you send your emails through google's servers by logging in with your google account.