Email Server on Virtualmin

Sorry for this, but I’m a complete noob at an email server. I went into usermin webmail and sent myself a test message to my home email. Nothing ever showed up but it said it sent just fine.

So then I tried to send a test mail to my gmail account and it seemed to send fine, but then it got bounced back a minute later with this error:

gmail-smtp-in.l.google.com[2607:f8b0:4002:c06::1b] said: 550-5.7.1
[2600:6c5a:567f:f2b2:6e2b:59ff:fea5:344] Our system has detected that
550-5.7.1 this message does not meet IPv6 sending guidelines regarding PTR
550-5.7.1 records and authentication. Please review 550-5.7.1
https://support.google.com/mail/?p=IPv6AuthError for more information 550
5.7.1 . j128si7929454ybb.428 - gsmtp (in reply to end of DATA command)

Can anybody help me? I am totally clueless when it comes to email servers. Thanks in advance for any advice.

There are two things you need to help with email bouncing. One is to set up a rDNS for the IP so that it resolves back to a domain. You may have to request this from your provider. The other is to set up a text record in your DNS server for SPF (Sender Policy Framework). If you are using the BINDS DNS in Virtualmin then I believe it handles the SPF for you. However, with an external DNS server you will need to add this text record yourself. There are SPF generators on the net to help with creating the text record entry. Digital signing of emails will help as well but Virtualmin should handle this for you.

One more thing, make sure that the mail server has relaying turned off; this prevents spammers flooding your mail server which can get you blocked.

You also might need to generate a _DMARC record for dns too. I find spf on its own isnt enough.