please help me my servers mails mark as spam by gmail

my server send spam emails to Gmail

I have pointed my server ns1.mainsite.com > my server (Namecheap panel) is
then I have added ns1.mainsite.com > my server to Webmin DNS,

and added v=spf1 a mx a:mainsite.com ip4: several ?all with DomainKeys Identified Mail options to all domains

and added my server ip> ns1.mainsite.com as reversed DNS to ovh VPS.

info@mainsite.com email not sending me spam but other domains (ex: info@otherserveraddedomains.com) emails mark as spam by Gmail, please help me to solve the problem

thanks

Are you using a locally hosted mail server on a Dynamic IP? If so you configure your SMTP as a relay to your own ISP’s SMTP server. This is only required for OUTGOING mail but you will need to configure using an authenticated account on your ISP.

" Are you using a locally hosted mail server on a Dynamic IP? " no its static ip which gave me by OVH server could you please explain this “configure your SMTP as a relay” ? please help me to configure it

thanks

otherserveraddedomains.com also has to have reverse dns setup since that is the domain sending the mail. Even though the mail server itself already has reverse dns. Each domain for mail being sent has to reverse resolve back to the correct ip.

Which is YOUR domain name where you are hosting the mail server? Use this site (https://mxtoolbox.com/) to see if it can give you further information.