3

All mails coming from my server has Received: (from www-data@localhost) even though I've set 127.0.0.1 mydomain.org mydomain server2 in /etc/hosts. I think that's the reason why it's ending up in the spam folder.

How can I change this Received: (from www-data@localhost)?

    $headers = "Sender: " . $fromMail . "\r\n";
    $headers .= "From: " . $fromMail . "\r\n";
    $headers .= "Reply-To: ". $replayFromMail . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";

    mail($urow['email'],$subject,$notify,$headers);

I also tried adding -f [email protected]:

mail($urow['email'],$subject,$notify,$headers,"-f [email protected]");

Why I think it's related to spam problem?

from http://cbl.abuseat.org/

This IP address is HELO'ing as "localhost.localdomain" which violates the relevant standards (specifically: RFC5321).

The CBL does not list for RFC violations per-se. This particular behaviour, however, correlates strongly to spambot infections. In other words, out of thousands upon thousands of IP addresses HELO'ing this way, all but a handful are infected and spewing junk. Even if it isn't an infection, it's a misconfiguration that should be fixed, because many spam filtering mechanisms operate with the same rules, and it's best to fix it regardless of whether the CBL notices it or not.

Orlo
  • 263
  • 1
  • 5
  • 12
  • Did you re-configure the mail client after changing your `/etc/hosts` file? What does the output of `hostname` give? – Canadian Luke Mar 05 '14 at 20:46
  • Yes I did. it gives me server2 and `hostname -f` gives me my domain – Orlo Mar 05 '14 at 20:54
  • And sendmail is your mail-sending daemon? I can help with exim, but I haven't used sendmail. Hopefully someone else can give some insight – Canadian Luke Mar 05 '14 at 21:03
  • [Here is how you ask this question](http://serverfault.com/questions/570369/). Notice that the questioner names the MTS in use and provides details of how that MTS is configured. – JdeBP Mar 05 '14 at 22:48
  • Have you restarted/HUPed sendmail daemon after changing `/etc/hosts`? AFAIR sendmail sets "this host email name" during daemon startup. – AnFi Mar 06 '14 at 00:31
  • @AndrzejA.Filip yes I did... – Orlo Mar 06 '14 at 09:51
  • Try adding -a 'From:no-reply' as an argument to mail – farosch Jan 25 '17 at 00:24

0 Answers0