Author Topic: "Received: from localhost" headers  (Read 5263 times)

caraboy

  • Zen Apprentice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
"Received: from localhost" headers
« on: October 06, 2011, 11:03:21 pm »
Hello,

First of all, I like Zentyal, been using it from Ebox.  :)

I am running a production server, on Ubuntu 10.04.3 LTS, with Zentyal Core version 2.0.23.

I activated mail filter, for antivirus and spam. I am behind a router, with internal IP 192.168.0.200. Configured hostname, mailname, FQDN, etc.

My email gets into spam, at least when sending mail to new gmail contacts, or yahoo. I looked at the header I receive on gmail, and it looks like this (replaced my real external IP and domain):

Code: [Select]
Return-Path: <alexandru@mydomain.ro>
Received: from mail.mydomain.ro (mail.mydomain.ro. [86.122.xx.xxx])
        by mx.google.com with ESMTP id n1si2479652faa.119.2011.10.06.08.00.00;
        Thu, 06 Oct 2011 08:00:00 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of alexandru@mydomain.ro designates 86.122.xx.xxx as permitted sender) client-ip=86.122.xx.xxx;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of alexandru@mydomain.ro designates 86.122.xx.xxx as permitted sender) smtp.mail=alexandru@mydomain.ro
Received: from localhost (localhost [127.0.0.1])
by mail.mydomain.ro (Postfix) with ESMTP id 03BD5101761
for <caraboy@gmail.com>; Thu,  6 Oct 2011 18:00:00 +0300 (EEST)
X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at mydomain.ro
Received: from mail.mydomain.ro ([127.0.0.1])
by localhost (mail.mydomain.ro [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id DStnRertlkwb for <my_test_username@gmail.com>;
Thu,  6 Oct 2011 17:59:59 +0300 (EEST)

So it looks like when activating mail filter, amavisd-new ads localhost, and 127.0.0.1 local IP to outgoing headers, thus making gmail add it to spam. I checked for blacklists, I am not listed.

Is it any way to disable those headers, on outgoing mail? It is strange no one reported this before, could not find it in a search.

christian

  • Guest
Re: "Received: from localhost" headers
« Reply #1 on: October 07, 2011, 06:57:04 am »
Clear explanation of what you have set up!  :D

Discussing about header content, the only way would be to run amavis "elsewhere", meaning on another server. If you look at the way postfix works, this is very clear that sanity check is done by forwarding email to external program then receiving it back. Therefore this appears in SMTP header and there is no (simple) way to avoid it except by forging header which I would not advise.

The second point you raise is that gmail stamp such mail as spam. This is the point I would challenge. I'm not saying you're wrong with your analysis  :-[ (I'm not gmail user) but wonder why they set so stupid rule: imagine you have set up an application sending mail to end-user using local sendmail. Result will be somewhat similar.  Oh, I'm stupid, this can't happen if you are using Google cloud only  ;D ;D ;D  Well, I'm joking highlighting (dangerous) Google strategy but I would suggest that you ask this question in gmail related forum and see how gmail users have solved this issue.

BTW, how do you know that spam stamping is due to localhost in header?   

caraboy

  • Zen Apprentice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: "Received: from localhost" headers
« Reply #2 on: October 07, 2011, 10:56:22 am »
Yes, I might be wrong about gmail spam stamping, I can`t be 100% sure about it. But I could not find a logical explanation to why I am getting into the spam label. :)
Checked blacklist, setup reverse DNS, I do not send mass email (I have 15 email accounts, small company, and I monitor trafic on server.).

You are right about amavisd, since yesterday I read a lot of documentation about how it works, it`s no simple way of modifying header information. I think the best way to test, is to send email from my server with filters deactivated, see how this works (no virus, spam scan, etc).

Thanks for the reply.

PS: running your own server was easier back in the 90`s, no SMTP-auth, relay just your internal network, no spam worries. :D

christian

  • Guest
Re: "Received: from localhost" headers
« Reply #3 on: October 07, 2011, 12:00:34 pm »
running your own server was easier back in the 90`s, no SMTP-auth, relay just your internal network, no spam worries. :D

Yes  :'( :'( long time ago  :'(

Once mail is received in spam folder, you should be able to look at what triggered this bad ranking assuming gmail provides it.

caraboy

  • Zen Apprentice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: "Received: from localhost" headers
« Reply #4 on: December 04, 2011, 01:14:31 pm »
Hello again,

I wanted to tell you I solved the problem wiht mail getting into SPAM folder.

It was a little bit of work, but I implemented DKIM signed emails + SPF DNS records. Now (finally) all new mail sent to gmail gets into inbox.  :)
If you need assistance modifying Zentyal stubs template, post here, I might be able to help.

PS: Zentyal should look into making it easy to add txt records to DNS zones, and help with DKIM implementation. It`s a must these days, when so many are migrating to cloud apps (gmail, etc).

beloge2002

  • Zen Apprentice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: "Received: from localhost" headers
« Reply #5 on: January 05, 2015, 09:48:16 am »
Dear Caraboy,
I am working on deploying dkim on my mail server which is running on zentyal but I didn't succeed the deployment. I got this error in mail logs after starting dkim: "opendkim filter unable to bind to port 12301@localhost permission denied". Could you help me to figure out the issue.
Thank you in advance,

Eloge