Mail sent from applications reaches spam

Hello guys, I have a problem these last weeks, I have an application in django - python where mail is sent to other users to change their password or some information, very few emails are sent in one day (less than 50 emails are sent Of the server). These mails arrive at the spam folder in your hotmail and gmail emails, however when they are sent from roundcube they arrive in the inbox, I have tried sending from a java application and the problem is the same. The mail server has passed tests of tls, dkim, dmarc, spf.


Are you sure the mails being sent from Python/Django are going through the local SMTP server? The behavior you describe sounds like maybe what you’d see if they’re being sent directly (and thus not getting the DKIM and other anti-spam headers attached). Check the headers of the delivered mail from Django to see if they have all the right headers.