Hello i've been struggling for a while now. I will give all the details i can.
- OS: Ubuntu 20.04
- Server: DigitalOcean (Droplet)
- Domain Registrar: Namecheap
I hope i did not change up somethings with mail.domain.com and regular domain.com for some entries but i doubt so as emails are being sent.
I installed postfix. I have added spf & dkim but emails are not sent to gmail. But if i send the email to a trashmail like byom.de it arrives. Here's some screenshots.
Result:
So now to my logs if i send an email to some gmail. I used this command
cat /var/log/mail.log
This is the output of the logs:
status=bounced (host gmail-smtp-in.l.google.com[173.194.79.26] said: 550-5.7.26 This message does not have authentication information or fails to 550-5.7.26 pass authentication checks. To best protect our users from spam, the 550-5.7.26 message has been blocked. Please visit 550-5.7.26 https://support.google.com/mail/answer/81126#authentication for more 550 5.7.26 information. i8si2754707edc.19 - gsmtp (in reply to end of DATA command))
My DNS Records (This is from my namecheap panel):
Now for the rDNS i googled how to do it on Digitalocean and i followed the official docs, i cannot share the link else this post is seen as spam
Here is my reversedns/ptr record:
Now i found this website called mail-tester.com. I used and tested it. Here are my results: https://www.mail-tester.com/test-e0rrv0exa
You see that it tells me that i do not have spf configured even though that is not true. Same for dkim. Here is my results when i run sudo opendkim-testkey -d mydomain.com -s default -vvv
Im getting this output:
opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: checking key 'default._domainkey.mydomain.com'
opendkim-testkey: key secure
opendkim-testkey: key OK
The result of the mail checker in general is not really good but i just need to fix the issue that it does not send to gmail, and i pretty convinced it's because i missconfigured something.
Also i have configured the dkim to sign in and outcoming mails, here is the tutorial i used: https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf
EDIT AFTER COMMENTS: I have used the -r parameter to send an email and now it's correctly sending ([email protected]) and not [email protected]. But now i tested with mail tester and it's still telling me some things are incorrect.