All Mails are going to spam in gmail

**OS type and version: Ubuntu Linux 20.04.3
**Webmin version:1.981
**Virtualmin version:6.17-3
Related products version: RECOMMENDED

All Mails are going to spam in gmail. Please help.

See Need help about DKIM concept & setup - #2 by calport and Email sent successfully but nothing goes out or in - #3 by calport


@anuj9122, @calport,

While @calport does address some good points in his other post, there is also the issue that sometimes and IP address being used either…

  1. had a bad reputation when you got it (yes, IPs are recycled these days). in this case you’ll want to check to see if you’re IP is listed with any blacklists, and in the case of Gmail they actually use their own internal scoring system and have a “Postmaster” site which may help you identify what’s going on with their network specifically.

  1. has not been used for email for a while. in this case, you may need to be patient as the email provider starts to identify that you are not sending them spam. sadly not having a reputation is often viewed by ISPs the same way as having a bad reputation is. so you may need to ask users to mark as “not spam” which can also aid in getting the attention of the ISP who usually uses automated systems.

Yes answers / replys all OK.

Extra tests sites:
My Email Communications Security Assessment (MECSA) ( test there mailprovider and see your score.

Mailtest here

And see if your network hoster ASN ip range had bad reputation also

And here if you have high volume mail… IP and Domain Reputation Center || Cisco Talos Intelligence Group - Comprehensive Threat Intelligence

Just for the record, we use VirtualMin and host our own email servers.
I can confirm what most of the other posters have said, especially wrt to setting up SPF, DMARC & DKIM. Once its set up, it takes some time for your reputation score to build so initially, even with a perfect setup, a lot of your emails will still go to spam/junk.
However, once its working, you will see a significant improvement in emails actually reaching the recipient.

As a start, you check out your sender reputation here:

MXToolbox ( []) is a useful site to check your email server setups, especially when configuring DKIM etc

This is the report.

Please help me

All Mails are going to spam in gmail

That is your original post. Apart from Ubuntu there is no other information. Is this a new build, what did you do to install Virtualmin with default settings, have you changed default settings?, what have you enabled yourself? seems SPF and DKIM enabled but other half not. Come on folks, provide more information when you post and try to be helpful if you want to be helped. You might find that more people will reply.

Having said that, the posts above should point you in the direction of How to configure SPF, DKIM, DMARC + TLS - did you look into that which is part of basic server administration. If so what did not work or was understood? what changes were made since original post?

The tools that can improve delivery:

  • DKIM
  • SPF
  • TLS

Some members have posted some links to extensive guides to follow. Make sure you follow up and configure/setup as needed.

Go there to advanced and you see what is missing.

Do some search and reading while dane , dnssec , and so on are not realy virtualmin things. It should be supported in vmin.

Domain Name


also some on x509 certificate there at the mx record part
CA and

Senderscore is only working if higher email volumes are present! ( ony part that is working there blacklist … Reputation Measures )

Or if you don’t know read this adn if then you don’t know you could hire him.

Post Removed.

SenderScore is almost useless you have a paid account. I’m pretty sure they’re in cahoots with Microsoft because MS pushes SenderScore hard when you get on their naughty list. I have my own way of sealing with that, but I digress.

Google is very thorough when it comes to evaluating mail incoming to their servers for spam. (Outgoing mail from their servers… not so much.) They’re also arrogant enough that even if everything on your end is perfect and you’ve never sent a single piece of spam in your life, they still may take months to trust your IP.

Two things seem to help. One is, in my opinion, mandatory anyway, and that’s to enable DMARC (which presupposes PTR and SPF). SPS also should be as strict as possible given your situation. If you NEVER need to send mail from your domain through another server, then -all is what you want.

The second thing is specific to Gmail, and that is to send mail to a dozen or so gmail recipients over a few days (with their permission, of course, and not all at once) and have them mark your mail as not spam. That seems to nudge the bots a bit toward trusting your IP.


Why are these not configured by Virtualmin?

The tools that can improve delivery:

  • DKIM
  • SPF
  • TLS


But they are, if you have Virtualmin configured correctly.

Where i get tutorial? Virtualmin configured correctly

I deleted my first reply to this because you’re not telling us about your setup (are you hosted, are you running your own server from home, are you on a dynamic IP, etc.). That said, here it comes:

It’s this simple: your IP is Black listed.

When you go to MX Toolbox and enter your IP of you are blacklisted by 4 servers.

That can mean several things. It could mean that either you or whoever used that IP before you probably spammed a whole bunch of email at some point and got reported.

It could also mean that you’re on a dynamic IP address and as such aren’t to be trusted. (I ran into a similar issue a while back and @calport offers solutions for it if that’s the case.

Google will never, ever trust a dynamic IP. So if that’s the case either hire Calport to fix you up or forget about running a mail server.

If you’re not on a dynamic IP, you need to find out why you’re on those black lists and get it sorted.

Ya seems to be the trend these days. Provide little info but expect big fixes whilst basic own admin work is overlooked.

1 Like


Thanks to all Virtualmin and the team. Thanks to all members who help me a lot in this.BIG THANKS TO Ilia that he was answered this in other forums.

The happy movement is all my emails are going to the inbox and the happiest movement is going to the inbox with important marks.

These are for those who are seeking this.
I am using outlook and Usermin. My primary domain is and the other domain is as I want all emails are going to Gmail inbox.

Actually, I don’t know how it works but I did these steps. So I am sharing with everyone.

You need to do these steps in both domains. If you want in the primary domain then do only in the primary domain. If you do like me then start with the primary domain but need to be done in both domains.


  1. For DKIM, goto Virtualmin → Email Settings → DomainKeys Identified Mail–> Install (skip if already installed)–> Signing of outgoing mail enabled?–> yes. and Reject incoming email with invalid DKIM signature?–> yes then save.

  2. For SPF, Dmarc and dnssec, goto Virtualmin → server configuration–> DNS options–> SPF record enabled? → Yes

  3. goto Virtualmin → server configuration–> DNS options–> DMARC record enabled? → Yes

  4. goto Virtualmin → server configuration–> DNS options–> DMARC policy for emails that fail SPF or DKIM → Quarantine email

  5. goto Virtualmin → server configuration–> DNS options–> DNSSEC signature enabled? → yes

  6. Save

Check if its works. If not works then do these

  1. Wait for 24hrs to propagate DNS
  2. Try to whitelist the IP address or check blacklist using Email Blacklist Check - IP Blacklist Check - See if your server is blacklisted or
  3. check DNS using
  4. verify domain name by google using google tool Sign in - Google Accounts
  5. Use another google tool Check MX: Check MX and SPF Records.
  6. try these tools too My Email Communications Security Assessment (MECSA)


Actually, i don’t know I am blacklisted.I will try to whitelist.I am running my own server from home and this is static ip.

This is the final result

Don’t auto forward your server emails to gmail but let gmail access your email via pop3/imap. If you blind forward, spam will also be forwarded and your IP will be blacklisted.


It’s not auto-forward. This is used IP address. Now, these days companies do reissue IP addresses.

1 Like