Problem with emails (Spam, undelivery and so on)

13 posts / 0 new
Last post
#1 Tue, 07/05/2016 - 18:25
tiagobombonatti

Problem with emails (Spam, undelivery and so on)

Hello!

First of all, I mus say this forum is a must for the beginners. I'm really learning a lot. Thank you all. But I have a BIG problem with my emails, and I will tell you now:

1) When I fill the contact form on my website, I receive an e-mail (on my gmail account, as I configured). The problem is the e-mail comes with a question-mark and the information that Gmail couldn't verify mydomain is sending the message or some spammer. Curious is, if I send 3 or 4 contact forms, the first two emails comes with that information, and the other don't. That's one problem.

2) When I compose an e-mail message (via Roundcube or Usermin) and send it to Gmail, the message goes directly to SPAM folder. To the Hotmail, same happens. I couldn't test with Yahoo, but I believe the same will happen.

3) When I try to send an e-mail to some other domains, sometimes I can send, sometimes I can't. The last "undelivered" message I got the header message:

Reporting-MTA: dns; amantesdocarnavalsp.com.br
X-Postfix-Queue-ID: C885F419C4
X-Postfix-Sender: rfc822; comunicacao@amantesdocarnavalsp.com.br
Arrival-Date: Tue,  5 Jul 2016 18:51:24 -0400 (EDT)

Final-Recipient: rfc822; paulo.silva@firmoesilva.com.br
Original-Recipient: rfc822;paulo.silva@firmoesilva.com.br
Action: failed
Status: 5.0.0
Remote-MTA: dns; spmexp-mx-02.cloudexchange.com.br
Diagnostic-Code: smtp; 550 High probability of spam

4) Some people told me they can't send me e-mail, because they got the mail undelivered, but I can't see the header of them.

Debian 8. DKIM activated, DNS records ok.

Please, someone help me.

Wed, 07/06/2016 - 00:35
Diabolico
Diabolico's picture

Well you should start with common problems:

  1. Check if you have SPF, DKIM and DMARC records and if they are properly set
  2. Check if you have rDNS
  3. Check if your domain or IP is blacklisted
  4. From 1 to 3 plus several other settings can be checked with: http://mxtoolbox.com/SuperTool.aspx
  5. Check what services are active and their ports especially dovecot: http://www.cyberciti.biz/faq/how-do-i-find-out-what-ports-are-listeningo...

This are common mistakes/problems people have so its best to start with them. If this doesnt help you should send one message from Usermin to your Gmail account and post the logs here together with email header from Gmail. This should show us what could be the problem but before you do anything check previously mentioned things.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Wed, 07/06/2016 - 18:26 (Reply to #2)
tiagobombonatti

Thank you for replying. 1) I have SPF, I have DKIM but I don't have DMARC. I created a record now, and let's see if it works. 2) I can't create reverse DNS, because when I go to my hosting and add mydomain.tld, it says I don't have a record type A in my DNS records, but I sure do HAVE. So I don't know what happens next. Is there a chance all that records I have in Server > DNS Records are not seen outside the VPS? 3) Neither IP or domain are blacklisted.

I sent e-mail directly from Usermin to Gmail and to other domain I got error before, and guess what? The message sent to Gmail went directly to Inbox, no spam. The mail to other domain was delivered (at least no undelivered message came until now). So, maybe the problem is Roundcube? What your thought about that?

Thank you so much!

Wed, 07/06/2016 - 10:37
unborn
unborn's picture

I would only check the option 1 and 3. you dont need rDNS or port checking at all..

Configuring/troubleshooting Debian servers is always great fun

Wed, 07/06/2016 - 12:39
Diabolico
Diabolico's picture

Without rDNS Gmail will mark all emails as spam and probably will be the same with Hotmail, Office, etc... Some other email servers (mostly privately owned) will reject the email if doent have rDNS. You must have rDNS or your emails will hardly go anywhere not to mention your domain or IP sooner or later will end on several blacklist.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Wed, 07/06/2016 - 22:00
Diabolico
Diabolico's picture

For rDNS should be easy to sort. Best and easiest solution would be to use the hostname (either way it should be FQDN), so if your hostname is "myserver.domain.tld" then check if you have in your DNS records "myserver.domain.tld. IN A your.server.IP.address". If you are missing this record be sure to add it before you proceed to set rDNS. Once done go to your host control panel and set rDNS to "myserver.domain.tld".

Tools like mxtoolbox.com should give you some info if there is a problem, another option is intodns.com but it will check only DNS (there are other solutions just use google). To test email only you can use https://www.unlocktheinbox.com/mail-tester or http://www.mail-tester.com. I prefer the first link because gives more info but second link will present the info in easier way to understand so use both or just one, its up to you. One thing you must know, every single thing what is not properly set or defined it will increase spam score of your emails and more problems you have it will be easier for emails to end in spam or be rejected by receiver.

Roundcube is installed on second domain? Honestly i dont know much about Roundcube but log files will show you what happened with that email. If other domain didnt get the email then probably the problem is with your email or other domain (server) configuration. To be sure i would properly set the records with first domain and then see what will happen. That two new links i gave you it will show you with more details what is going on with your emails and point out any potential problem.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Thu, 07/07/2016 - 17:01 (Reply to #6)
tiagobombonatti

Hey, @Diabolico, I tested with all the tools that you provided me, including the mail-tester... The only question is about DMARC record, and I'm not sure if that's the cause of my problems, but I guess so. I will try to setup rDNS. I tried the support of my VPS-hosting, but they said they can't do nothing, since it's MY PROBLEM setting everything up. I see I had a good start on the VPS world... Anyway, there was no complain about email issues today... While I can't completely kill that issue, I'm advising people my e-mails can be on trash/spam folders (hotmail, Gmail, Yahoo and others).

Fri, 07/08/2016 - 01:16
unborn
unborn's picture

@tiagobombonatti - check if your ip is not blacklisted to spamhouse and other corporations like it.. you can google it. if not, we can go from there.. if it is, make sure you would change password for your ssh on root and user domains.. and deploy fail2ban ( I will help you with those), plus check postfix email query..if there is anything not coming from you or your users email address, please remove that. I will help you to be white listed and also to make your srv more secure..

edit: if you do have all stuff correctly no one will refuse emails from your srv as an spam, nor gmail - personal experience here.

Configuring/troubleshooting Debian servers is always great fun

Thu, 07/07/2016 - 16:55 (Reply to #8)
tiagobombonatti

Thank you for replying, but my IP is not blacklisted at all. I think the fact is I don't have a DMARC record, and I don't know how I can do that. I'll keep on reading this thread. Thank you again!

P.S.: Please, don't fight or I'll feel guilty because all started with my question...

Fri, 07/08/2016 - 01:39 (Reply to #9)
unborn
unborn's picture

Hi, you can enable dmarc if you go virtualmin - domain - server configuration and click dns options. There you scroll down and click enabled on DMARC record enabled? also you can change policy there. Mine one is rejected. You may perhaps wait 24 hours to apply this as its dns which could take time a bit.

Configuring/troubleshooting Debian servers is always great fun

Thu, 07/07/2016 - 15:08
Diabolico
Diabolico's picture

I do see your point but I am hosting sites with emails without rDNS - that does not need to be concerned at all

Well based on RFC1912 we have:

2.1 Inconsistent, Missing, or Bad Data

   Every Internet-reachable host should have a name.  The consequences
   of this are becoming more and more obvious.  Many services available
   on the Internet will not talk to you if you aren't correctly
   registered in the DNS.
   Make sure your PTR and A records match.  For every IP address, there
   should be a matching PTR record in the in-addr.arpa domain.  If a
   host is multi-homed, (more than one IP address) make sure that all IP
   addresses have a corresponding PTR record (not just the first one).
   Failure to have matching PTR and A records can cause loss of Internet
   services similar to not being registered in the DNS at all.  Also,
   PTR records must point back to a valid A record, not a alias defined
   by a CNAME.  It is highly recommended that you use some software
   which automates this checking, or generate your DNS data from a
   database which automatically creates consistent data...

So please read it you will find a lot of information there about rDNS. For the rest there is difference between helping and hand holding and i will not do the later. If someone dont want to spend few minutes on google then he or she dont deserve any attention and if you want to do differently please be my guest, i'm sure no one will stop you.

P.S. Stop telling people wrong information, there are rules you must follow so instead of teaching people wrong things lets educate them to properly follow the rules.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Thu, 07/07/2016 - 17:07
tiagobombonatti

This is the output when I tested the Mail Tester (rDNS section):

rDNS PTR Records
Records Results
Domain: dc-bad63aeb.amantesdocarnavalsp.com.br
- Type: MX
- IP Address: 93.188.166.164
- ARPA Record: 164.166.188.93.in-addr.arpa.
- rDNS PTR Record: Email Authentication Pro Feature - Learn More
- rDNS PTR Test: Email Authentication Pro Feature - Learn More
- RDNS PTR Count:

Email Authentication Pro Feature - Learn More

Domain: amantesdocarnavalsp.com.br
- Type: LSIP
- IP Address: 93.188.166.164
- ARPA Record: 164.166.188.93.in-addr.arpa.
- rDNS PTR Record: Email Authentication Pro Feature - Learn More
- rDNS PTR Test: Email Authentication Pro Feature - Learn More
- RDNS PTR Count:

Email Authentication Pro Feature - Learn More

These are one out of five or six information about DKIM:

Public DKIM Key
Selector Location: Click Here: 2016._domainkey.amantesdocarnavalsp.com.br
DNS Record Found: Not Found - Learn how to set up DKIM by clicking here: DKIM Instructions

Maybe something is wrong right there, and I can't find what or why!

Thu, 07/07/2016 - 21:36
Diabolico
Diabolico's picture

Did you recently change DKIM? Because if you have high TTL you must wait to expire for changes to propagate. If you didnt recently change DKIM then go to Vmin - Email Messages - DomainKeys Identified Mail:

Signing of outgoing mail enabled? -- Yes
Selector for DKIM record name -- whatever you want, you can even leave on "default"
Reject incoming email with invalid DKIM signature? -- Yes
Force generation of new private key? -- Yes
Size of new DKIM key - 2048

For "Force generation of new private key?" select "Yes" and try to generate new key. My advice before you proceed with any changes in DNS to lower TTL to 5-10 min. Remember you still must wait for old TTL value to expire. If you have DKIM set to "No" then "Force generation of new private key?" will not be visible, all the rest is same.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Topic locked