Mail delivered to spam a lot with my current setup

10 posts / 0 new
Last post
#1 Tue, 09/23/2014 - 07:25
marceld202

Mail delivered to spam a lot with my current setup

Hi, i`m struggling all the time with mail problems. A lot of mail gets delivered to spam by clients and lot of mails are not delivered at all.

I hope someone can help me to set things up correctly.

I have this as setup:

A VPS with the name srv1.myservers.com myservers.com is registrered and points to its own domain on another server srv1.myservers.com is an A record to my VPS (resolves correctly)

On the VPS i have added one mainserver: srv1.myservers.com (not used as website really).

I created a subserver for my website: example.com. This website is a subserver for srv1.myservers.com. (I changed the domainname afterwards, so the full domain is example.com, not example.srv1.myservers.com).

In DNS I created these records for domain.com: mail.domain.com. IN A IP.ADDRESS > IP adress is the IP of domain.com VPS mail.domain.com. CNAME to mydomain.com mydomain.com IN TXT "v=spf1 include:srv1.myservers.com ~all" MX 5 to srv1.myservers.com

In DNS i created these records for srv1.myservers.com: mail.srv1.myservers.com IN A IP.ADDRESS > IP address of srv1.myservers.com MX 5 mail.srv1.myservers.com. srv1.myservers.com. IN TXT ""v=spf1 a mx a:srv1.myservers.com ip4:ipadres ?all"

This setup is working, but like 25% gets not delivered or is marked as spam. Basically the idea of this was to setup multiple domains with all the mailserver via srv1.myservers.com.

So mail.domain.com resolves to mydomain.com, which MX record resolves to srv1.myservers.com. Srv1.myservers MX records resolves to mail.srv1.myservers.com. and this resolves to srv1.myservers.com.

It seems like this could be setup lot easier and much more reliable, but this is completely new for me and I am glad I came this far already.

It would be awesome if someone could share the exact DNS settings for me I would use. (keeping in mind the setup of srv1, srv2, srvX.myservers.com and that my actual website is a subserver in Virtualmin). If it is wrong to be a subserver le me know too, I could just make it a mainserver but thought this was better managable since I would go to /home/user/domains/ and all my websites were there instead of every domain having its own home directory.

Thanks a lot in advance!

Tue, 09/23/2014 - 10:12
andreychek

Howdy,

Well, you may want to verify that you have reverse DNS setup on your main IP address (which is something your ISP/provider would need to enabled).

However, what you may want to try is to send an email to another server running SpamAssassin, and then review the mail headers to see what is spam-like about your emails. SpamAssassin will show you what rules were triggered.

Another thing you could try is to see if your IP address is listed on any of the common RBL's, that's a possible cause of what you're seeing:

http://www.anti-abuse.org/multi-rbl-check/

Tue, 09/23/2014 - 10:26
marceld202

Hey! Thanks a lot, very helpfull for diagnostic debugging.

There is reverse DNS setup for the srv1.myservers.com domain. That would be enough right, since that is the final mailserver sending the mails? Does it matter that mails sent from domain1.com are sent via mailserver of srv1.myservers.com?

I will definitely try to sent mails to another server (luckily I have one with mail and spamassassin setup) and look into the headers. I think that will help a lot.

I checked for blocklists via your URL. Luckily I`m on no blocklist with srv1.myservers.com.

So, apart from these suggestions of your, is my DNS setup ok this way? Or is it a bad setup anyway?

Tue, 09/23/2014 - 15:33
andreychek

Howdy,

In theory, what you're describing should work.

There are a lot of variables involved though, seeing what SpamAssassin has to say about the issue by sending an email to another server can really help nail down the culprit.

-Eric

Tue, 09/23/2014 - 16:05
ReArmedHalo

Tracking this thread, was forced to leave a comment so...

I'm a comment. :)

Tue, 09/23/2014 - 16:26
marceld202

Thanks! I will dive into the logs of spamassassin. I wil post here if I discover something helpfull.

Tue, 09/23/2014 - 18:19
andreychek

When sending an email to another server, check out the "X-Spam-Status" email header that SpamAssassin adds to that email. It will contain everything that it has to say about that email.

-Eric

Wed, 09/24/2014 - 03:20
marceld202

Thanks! I did already find out one problem, one DNS record was pointing to the wrong IP

Wed, 09/24/2014 - 09:31
marceld202

Hi! I have one more question and hopefully someone can help.

Now my setup is as this: domain1.com has MX record to srv1.myservers.com. srv1.myservers.com has an MX record to mail.srv1.myservers.com, which points to the ip of srv1.myservers.com.

This is working, but I wonder would this be better: domain1.com has MX record to mail.domain1.com. mail.domain1.com has A record to srv1.myservers.com.

In the latter case, the MX records domain is the same as the A record for the mailserver. I don`t know if, but might this be better to prevent spam marking?

And for the first case, my TXT record is like this: v=spf1 a mx a:srv1.myservers.com ip4:IPADDRESS ?all". Don`t I need to inlcude domain1.com in this TXT record, or add an addiontal TXT record for domain1.com?

Now mails are being sent from user@domain1.com, but the server and everything goes to srv1.myservers.com. I can imagine that being a problem (since lot of spammers are impersonating like being someone else).

Wed, 09/24/2014 - 14:00 (Reply to #9)
ReArmedHalo

On my server, I have the following:

mail.dustinschreiber.me. IN  A   <server_ip>
dustinschreiber.me. IN  MX  5 mail.dustinschreiber.me.
dustinschreiber.me. IN  TXT "v=spf1 a mx -all"

I also believe that is how virtualmin creates records by default (not sure about the SPF record, as I didn't have SPF creation enabled in server template when I created the virtual server)

I don't think it matters either way however though. Someone who knows more about how mail servers work might be able to say if it does or does not with more authority then me :)

Dustin Schreiber

Topic locked