Gmail is filtering my web app's email as spam [closed]
Asked Answered
P

3

10

We have a business web application that periodically sends emails as reminders, links to client data, etc. Our company uses Google Apps for our email provider (with our own domain name), and the web application sends email through Google with SMTP.

The problem is that Google Apps / Gmail keeps marking the messages as spam, even for the inboxes in our domain name. No other email provider seems to mark it as spam (but of course we haven't tested them all...).

We've tried various formulations of the body test: i.e. including more contextual information, addressing the recipient by name, but so far with no apparent changes. This makes me thing it may be something about our email sending process, rather than the content of the email, that's causing the emails to be marked as spam.

Things that we tried but that didn't solve the problem:

  • "From" address is valid and not spoofed
  • SPF records are correct, and show as "pass" in the email header
  • Since we are connecting to Google's SMTP server to send email, it's not an issue with a blacklisted IP address (however, our website has a static IP address that is not blacklisted).
  • Email is not very spammy: I've checked against several online spam filter tests, and the email body always shows up as extremely unlikely to be filtered.
  • HTML body vs plain-text body seems to make no difference.
  • We send a small volume of email: probably 0-10 emails per day, so I don't see how that would make this suspicious.
  • Whenever we have access to the receiving inbox (i.e. it belongs to an employee of our company), we've been marking the emails as "not spam", since Gmail may be using communal statistics to determine spam. After a couple times this results in emails to that particular inbox getting through, but doesn't seem to help other accounts.

What else can we try?

If it makes a difference, we're sending emails using an ASP.NET site running .NET 3.5. A typical email gets sent like this:

var message = new MailMessage(new MailAddress(from), new MailAddress(to)) {
    Subject = subject,
    Body = body
    IsBodyHtml = true
};

// SMTP details stored in web.config 
new SmtpClient { EnableSsl = true }.SendAsync(message, null);

EDIT: I've seen this similar question: How to stop Gmail from marking mails sent by my web app as spam?, but the situation is a little different since we can reproduce it by sending and receiving from the same Google Apps domain. Besides, I believe I have covered all of the proposed solutions for that question.

Puberty answered 30/1, 2011 at 0:40 Comment(7)
mail.google.com/support/bin/answer.py?answer=81126Dematerialize
@Tom Gullen: I've seen that article, and believe I have addressed everything on it. But anyway, I'm not sure I would even classify our email as "bulk" - right now we're sending not more than 10 emails per day, never the same body twice, never to more than one person. According to the language of that site, our emails are "transactional", not "promotional".Puberty
The From email is a @gmail mail?Cadman
@Bruno Costa: "from" is @ourcompany.com -- we use Google Apps for our email, so they are our email provider.Puberty
So, the domain of your "from" email is different of the provider email. Perhaps that is the problem?Cadman
If it's from ourcompany.com, I suspect the problem is that you're sending directly to gmail's SMTP server. Does whoever provides your companies hosting/connection offer a SMTP server you could use instead? If not and you have a static IP, could you start up SMTP in IIS and use that? Gmail may see a direct send as botnet like activity.Prorate
I have a similar situation. I've isolated it to the From address domain names. If I use domain1nospf.com, domain2withspf.com my email gets through, if I use domain3withspf.org, or numerous other domains I own some with spf, some with mx records, etc it get marks as spam. The two domains that work are primary domains on google apps accounts (we have 2). I'm using my own SMTP (tested with 2 smtp in different parts of the world) and the issue follows the From Name. Last point, some of the domains that get blocked never been used before.Elijaheliminate
P
7

I think you will need to use Domain Keys, read more about it here: http://en.wikipedia.org/wiki/DomainKeys

Google mail need this parameter, if you do not want to do it, you may need to use googlemail as smtp server.

I had this issue last month.

Another consideration are the urls, se this question: Gmail mark as spam email with html and anchor links

Hope it works.

Predestine answered 31/1, 2011 at 11:22 Comment(2)
Thanks for the DomainKeys idea. We have started that process, but like all DNS stuff it will take a while to propagate. I'll report back either way. Re: anchor links: we're not using any, so that's probably not hurting us.Puberty
This solved the problem for us! Thanks for your help. For anyone else with this problem, here is some info about DKIM with Google Apps: googleenterprise.blogspot.com/2011/01/… Bizarrely, this only became available recently. Better late than never!Puberty
L
5

Other stuff that you can try:

  • Do not send your emails from an IP address which is known for sending spam. This usually means no shared hosting.
  • Make sure your mail host is a valid A record, rather than a CNAME.
  • Make sure your MX record is set to the full host name of your mail host (which is set-up as an A record).
  • Make sure you can do a reverse lookup of your mail host's IP address. This will be important for setting up SPF/Sender ID records.
  • Set up SPF/SenderID information as a TXT record.
  • Once you've configured everything you should verify it. Make sure there are no warnings or errors before contacting Gmail support.
  • Test your emails with Spam Assassin. Send yourself an email from your app and copy the raw message (including headers) to a text file and run it against Spam Assassin's command line test.
  • If you are sending plain text emails, make sure you have the charset in the Content-Type header set to ISO-8859-1. Gmail seems to be very particular about this.
Linder answered 31/1, 2011 at 14:13 Comment(2)
I'd already read the discussion thread at #371120, where I see you originally posted this answer. Given the situation I described, I don't see how any of those points are relevant -- namely, the emails are actually being sent from google, just initiated by an SMTP client on our end; we have SPF properly set up; and I've tested using Spam Assassin. Have I missed something?Puberty
It could be some sort of relay issue. Have you tried sending the same email direct from one gmail account to another?Linder
N
0

Have you contacted Google? After having done everything on your side, this would be an option. Even more since they are your provider.

Try to ask them, and don't forget to keep us up to date, please.

Nemesis answered 31/1, 2011 at 10:44 Comment(2)
Most large companies won't respond to requests about how to bypass their spam blocking.Masterstroke
If the DomainKeys thing doesn't help, we'll see what Google has to say. Obviously they're not going to give us their spam filtering secrets, but it seems weird that mail sent FROM a valid gmail address, TO a valid gmail address, in the same domain and Google Apps account, would be blocked.Puberty

© 2022 - 2024 — McMap. All rights reserved.