LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-09-2014, 02:38 PM   #1
marcelc
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Rep: Reputation: Disabled
Postfix vs Google SMTP servers inconsistency


I want to host my own mail server and in order to do so I've installed Postfix 2.7.0 and Dovecot 1.2.9 on Ubuntu Server 10.04.

One big problem I face right now is that Google SMTP servers reject my mail ONLY WHEN it is being sent remotely. Strange, right?

So if I telnet localhost 25, then issue AUTH LOGIN (not an open relay of course) then send the mail I get a status = sent and I actually receive the mail message in my Gmail's account Inbox. Works like a charm.

On the other hand, if I want to send the mail from a remote host, I use:

Code:
openssl s_client -connect mail.mydomain.com:465
Then I issue AUTH LOGIN, the login process is successful. So I don't have a problem communicating with my server. I can see what happens in the log files. But when I try to send mail like this, Google replies:

Quote:
Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0
Why Google accepts my mail if being sent locally but rejects it when I openssl to my server and send it remotely?

It's like Postfix on my server makes Google aware of how email got to it in the first place and this way enables Google to reject mail that was not sent locally.
 
Old 08-09-2014, 09:22 PM   #2
Zyglow
Member
 
Registered: Nov 2004
Location: Texas
Distribution: CentOS, RHEL, Ubuntu
Posts: 73
Blog Entries: 1

Rep: Reputation: 16
Check your NDR messages to see what SMTP error is being returned. Most likely the DNS information on your mail headers aren't returning a valid address when Google runs the messages through their spam filter.
 
Old 08-22-2014, 04:41 PM   #3
marcelc
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
OK, but I use the same mail server to send mail in both cases.

The only difference is that in

Case 1: I issue the commands from my mail server terminal itself.
Case 2: I send the mail by issuing an openssl s_client -connect to my mail server, with successful authentication.

Why doesn't Google reject my mail in both cases then? Mail headers should be the same.
 
Old 08-22-2014, 04:49 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Because google thinks that mail from <spammer.ip> is still spam, even if it is routed via <clean.server>
 
Old 08-22-2014, 05:28 PM   #5
marcelc
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post
Because google thinks that mail from <spammer.ip> is still spam, even if it is routed via <clean.server>
OK, in this case, considering that I am using Postfix SASL, so I do authenticate as a valid user from my mail server point of view(which is clean), is there a way to make my mail server hide the original address that mail is actually coming from? Could I impersonate my server?

I mean, this shouldn't be unethical as I do provide some kind of authentication before I ask for mail relay service from my server.
 
Old 08-24-2014, 03:02 PM   #6
marcelc
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Finally solved after hundreds of hours of pain:

Google SMTP rejected my mail because Postfix failed to automatically generate a Message-ID for mail that it was relaying.
Strange enough, this didn't happen if mail was sent locally(telnet localhost 25) - so Postfix was generating Message IDs for these.

So the solution was to add
Code:
always_add_missing_headers = yes
in /etc/postfix/main.cf.

Hope someone else will not have to struggle with this for so long.
 
1 members found this post helpful.
Old 05-29-2015, 09:42 AM   #7
gvpathak
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
Thumbs up

Thanks a lot, you saved my time & efforts
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two SMTP servers, one domain, MX problem mlewis Linux - Server 4 12-05-2013 09:24 AM
POSTFIX SMTP banner based on MX hostname (PostFix 2.3.3 on RHEL) samarudge Linux - Server 1 02-15-2011 01:59 AM
POP3 and SMTP Servers fakie_flip Linux - Networking 1 09-20-2005 11:42 AM
Cannot connect to any SMTP Servers? DiZASTiX Linux - General 13 06-16-2003 01:07 AM
SMTP POP3 Servers Nezar Linux - Networking 1 03-19-2002 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration