Send email to Gmail mailbox issue

Everything setup but still send mail issues:

Diagnostic-Code: smtp; 550-5.7.26 This mail has been blocked because the sender
is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate
with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results:
550-5.7.26 DKIM = did not pass 550-5.7.26 SPF

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.4
Webmin version 2.105
Virtualmin version 7.10.0 Pro
Related packages SUGGESTED

Where are your dns records hosted ? Looking at the error you don’t have a published dkim record. If webmin is hosting your dns this record would be added automatically if not you will need to add the record to your dns provider’s dns portal for the domain in question

DNS is hosted at domain provider but i dupliated the DNS record from webmin

v=spf1 a mx a:domainname.com ip4:serverip ip4:serverip ip6:2a01:239:21d:9000::1 ?all

What about the dmarc record ?

With my registrar the dmarc record won’t work if you leave the quotes that break it up in. Carefully take them and spaces out. Some registrars do some don’t.

dmarc record created with virtualmin. Should i add this also in the dns from the domain provider?

Yes. DMARC, DKIM and SPF should all be added.

Personally I like having glue records to the virtualmin server, and let it act as a nameserver, this way all updates and all records are live and managed by virtualmin and you dont have to worry about doubling them in an interface.

When all added, try testing here.

You do have Virtualmin DNS off on the virtual server, you don’t wont a different dns for internal and external.
image

note the original error mentioned the solution of spf OR dkim — I point this out in case creating only the SPF dns entry, wherever your DNS is hosted – at your hosting provider OR on your Virtualmin system, would be easy and quick compared to getting DKIM set up properly.

I say this as someone who has very little experience setting up DKIM while having a lot of DNS experience :slight_smile:

and in general, somewhere Google said that if your domain is sending the Google systems under 5000 msgs in a day, you need EITHER spf or dkim (not both) … if over 5k/day, they consider you a bulk sender and at that level, you need all three – spf and dkim and dmarc.

Dont’t you mean or both.

I meant – for low volume mail flow, Google only REQUIRES only one or the other – is that better wording?

No problem, just when you say “not both” it sounds like you can’t have both.
Really you should have both if your setup is correct. This is to stop spammers forging your domain.