E-Mail sent from my CentOS 6 being flagged as spam

Hi, all mail I send from PHP mail() is getting flagged as spam in Gmail and other email services. Any suggestions? Thank you in advance.

9 Replies

Have you set-up your reverse DNS?

@hardwire:

Any suggestions?
Ummmm….maybe provide some actual details? (although Mr.Nod's is a good guess)

Yes, I have already setup my reverse DNS. BTW, I'm using self hosted service (sendmail). Thanks.

I made another try to send mail to gmail account, it now goes to inbox. However, in hotmail account it still flagged as SPAM. Any ideas would be much appreciated.

Providing the actual email and domain would allow checking for possible issues.. Otherwise there are a lot of reasons why your email might be marked as spam.

Email marked as spam is normally a result of:

o Invalid mail server communication

o Improper use of headers

o Syntax errors in headers

o Improper HELO

o Invalid or improper rDNS

o Blocked or marked IP

o Poor reputation of host

o Improper SPF setting

o Incorrect DKIM Signature

If you want to send a PM, I can provide you with a test email address that you can send to to see what the issues might be.

The problem with all this secret PM stuff (and it's the 2nd thread in a couple of days to have it) is it invalidates the whole community support thing.

By PM'ing the info required to solve the problem, it means that all future readers that come across this thread via key word search are left hanging.

Either publicly provide the info required to SOLVE YOUR PROBLEM, or if your privacy is so important, hire someone to fix it for you and keep it off a community support forum.

Hi,

I have used PHPMailer API to make this work (just like to share it to this thread). Anyway, some tips from Dweeber (in our private message):

Received: from hostname.domainname.com (li311-99.members.linode.com. [178.79.111.11]) 
        by mx.google.com with ESMTPS id 39si911193wet.123.2012.06.02.19.55.45 
        (version=TLSv1/SSLv3 cipher=OTHER); 
        Sat, 02 Jun 2012 19:55:45 -0700 (PDT)
  • Make sure that hostname.domainname.com has an A record.

  • The rDNS for 178.79.111.11 points to hostname.domainname.com

  • All email addresses used by the mail system need to be valid including the From (Envelope Sender), From, Reply-To headers.

  • Server generated scripts can generate perfectly formatted and fully RFC compliant email. Keys are including proper

o Date headers

o Valid Message-ID headers

o Proper Envelope Senders

It's a new Centos thing. Telnet into port 25 on your installation. You will probably get an EHLO of localhost.localdomain. That is why you are being pegged as a spammer. Make sure to set your hosts file.

telnet localhost 25

if you get back:

[root@mailserver ~]# telnet localhost 25

Trying 127.0.0.1…

Connected to localhost.localdomain (127.0.0.1).

Escape character is '^]'.

Then you need to set your hostname in /etc/config/network and in /etc/hosts

You have it right when a telnet to port 25 EHLOs your domain name, NOT localhost.localdomain

I'm sorry I can't be more help, It was several months ago that I solved this. I'm surprised, given how common this is, that this is not better documented.

Once you have this fixed, not before, go to http://www.spamhaus.org/lookup/ put your ip address in, get back the results of who pegged you as a spammer and request to be removed from the list

THEN you won't have any more trouble with emails in Centos.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct