1

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:

Image of inbox

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):

Image Of DNS & MX Records.

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:

Image of digitalocean with the ptr/reverse dns

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.

Results: https://www.mail-tester.com/test-9ma6t6tvt

1 Answer 1

0

You see that it tells me that i do not have spf configured

You indeed don't, for the domain that your mails are actually sent from.

  • Your MX record is at "example.com".
  • Your SPF record is at "example.com".
  • Your DKIM record is at "example.com".
  • But the actual domain in your message's From: field is... "mail.example.com".
  • And the actual domain in your message's SMTP Envelope-From is also "mail.example.com".

So you need to reconfigure your mail sending software (probably not Postfix, but the actual program that is generating the message) to use the correct domain in the "From" address.

5
  • Okay thanks already, im kind of confused now. Im sending the emails with postfix since mail is a command from postfix. So what would make more sense to change? Thanks already for your answer, i'ts my first time setting up a mailserver
    – Bremen
    Commented Jun 22, 2021 at 12:08
  • No, 'mail' is not a command from Postfix; it's a completely separate app. ('sendmail' comes with Postfix, but do not mix up the two: 'mail' is a user-facing app, whereas 'sendmail' is a system tool that apps like 'mail' use to actually submit the message into Postfix.) But it's possible that 'mail' might be submitting messages without any domain at all - and relying on Postfix to fill it in from $myorigin. Commented Jun 22, 2021 at 12:10
  • I see thank you. What should i re-configure in that case? For me it looks like either the dns records or something within postfix or user-facing app
    – Bremen
    Commented Jun 22, 2021 at 12:12
  • If your goal is to send mail from "example.com" then the DNS records are fine, you need to fix the actual message. Depending on which flavour of the 'mail' app you have, it might accept the -r option to set the "From" address. (Don't forget to check the 'myorigin' setting in Postfix itself.) Commented Jun 22, 2021 at 12:14
  • Thanks i have edited the thread, have a look if you wish :)
    – Bremen
    Commented Jun 22, 2021 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .