Why my email sent using another domain goes to spam?

Posted November 16, 2017 2.6k views
NginxEmailUbuntu 16.04

I just installed my mail server by following tutorials below:

How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04
How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability
How To Install and Configure DKIM with Postfix on Debian Wheezy

On the server that i installed mail server, i using 2 domains (domain1 and domain2) with different record for each domain (TXT, MX, NS, A)

I test sent my email using standard PHP mail function using domain1 and that’s successfully not goes to spam to Gmail.

But, when i test sent email from domain2, the email goes to spam on Gmail, where ‘mailed-by’ on email detail is using domain1.

So, how i solve this? Thanks before …

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Does your SPF record for both domains allow the server to send mail on its behalf?

How did you make that your sent e-mails didn’t go to spam? I have a domain and mail server (iredmail) and all of my sent mails go to spam (gmail). Can you help me?