Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: SMTP puzzle
PostPosted: Sat Jul 12, 2008 10:44 am 
Offline
Newbie

Joined: Sat Jul 12, 2008 10:26 am
Posts: 4
Hi everybody,

I'm using postfix on my computer as mta. When I send a mail to my gmail adress through postfix it is delivered to gmail mailbox and then automatically moved in the "spam" folder. That's because my IP address is not considered trustful, or something like that. But at least it is delivered. Instead, when I try to send a mail by telnetting to smtp1.google.com:25 and typing smtp commands the server refuses to accept the RCPT TO: my.address@gmail.com (again because of my ip). I don't understand this behavior. I chose the server smtp1.google.com because it appers as output of

dig google.com mx.

I also tried the servers which appear as output of

dig gmail.com mx

but in this case they don't even accept the command MAIL FROM:, answering with a syntax error

555 5.5.2 Syntax error

but i'm sure that i typed the command correctly.

So the puzzle is: how can postfix deliver the msg? which server is it using?

thanks


Top
   
 Post subject:
PostPosted: Sat Jul 12, 2008 11:43 am 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Your postfix logs will tell you what server it spoke to. Look for the "relay=" value in /var/log/maillog on "status=sent" lines.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Sat Jul 12, 2008 1:18 pm 
Offline
Newbie

Joined: Sat Jul 12, 2008 10:26 am
Posts: 4
Quote:
Your postfix logs will tell you what server it spoke to. Look for the "relay=" value in /var/log/maillog on "status=sent" lines.


This confirms that the server is the same listed by
dig gmail.com mx.

Still I don't understand what postfix tells to the server in order to have the mail delivered. When I try by telnet it continues to give the syntax error 555 which should mean something like "I didn't understand an extension to a MAIL or RCPT command", but i'm using a plain MAIL FROM: command. :?


Top
   
 Post subject:
PostPosted: Sat Jul 12, 2008 7:27 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
Did you send a valid "HELO" first? What is the exact syntax you used?

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
 Post subject:
PostPosted: Sat Jul 12, 2008 8:33 pm 
Offline
Junior Member

Joined: Fri Jun 27, 2008 12:24 am
Posts: 31
It's not accepting the mail when you telnet because smtp1.google.com is not a valid MX for gmail.com. You ran 'dig google.com mx' when you should have run 'dig gmail.com mx'. You also need to make sure that your MAIL and RCPT commands have <> around the email address. In your example you didn't show the angle brackets being used and GMail will refuse a message without them.

As for the problem of GMail considering mail from your server to be spam, this is a big problem mostly caused by pressure on Google to shut down the spammers in their own network. They now rely more on reputation. The more people that mark your mail as non-spam the better chances you will have of your mail being delivered.


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 2:35 am 
Offline
Junior Member

Joined: Sat Jan 05, 2008 2:40 am
Posts: 43
SelfishMan wrote:
As for the problem of GMail considering mail from your server to be spam, this is a big problem mostly caused by pressure on Google to shut down the spammers in their own network. They now rely more on reputation. The more people that mark your mail as non-spam the better chances you will have of your mail being delivered.


You have that last part a bit backwards. Generally speaking, Gmail filters new mail once people have begun marking other similar message as Spam in the past. I rarely get false positives in my Spam folders on Gmail, and they certainly don't expect you to non-spam all your mail before it gets accepted. This includes mail sent from my Linode.

I recommend checking your Postfix IPs to make sure they don't appear in any DNS-BLs, and also making sure your reverse dns is properly set up. Adding additional features like DKIM might help as well. Try sending the message to check-auth@verifier.port25.com, and see what results it gives you for the SpamAssassin test too.


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 9:07 am 
Offline
Newbie

Joined: Sat Jul 12, 2008 10:26 am
Posts: 4
Quote:
You also need to make sure that your MAIL and RCPT commands have <> around the email address.

Great! Now the mail and rcpt commands are accepted. Anyway, after the DATA command the server replies with

550-5.7.1 [151.66.38.251] The IP you're using to send mail is not authorized
550-5.7.1 to send email directly to our servers. Please use the SMTP
550-5.7.1 relay at your service provider instead. Learn more at
550 5.7.1 http://mail.google.com/support/bin/answ ... swer=10336 j9si14697256mue.5

and the msg is not delivered. On the other hand, with a "sendmail" command from the shell everything works (I mean: the msg arrives in the "spam" folder). But obviously my ip address is the same. I think that the problem lies in the fact that Postfix is "fluent" in speaking SMTP, but i am not . I encounter the same problems trying to "talk" with HTTP servers, for example :mrgreen:


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 1:24 pm 
Offline
Junior Member

Joined: Fri Jun 27, 2008 12:24 am
Posts: 31
CybrMatt wrote:
SelfishMan wrote:
As for the problem of GMail considering mail from your server to be spam, this is a big problem mostly caused by pressure on Google to shut down the spammers in their own network. They now rely more on reputation. The more people that mark your mail as non-spam the better chances you will have of your mail being delivered.


You have that last part a bit backwards. Generally speaking, Gmail filters new mail once people have begun marking other similar message as Spam in the past. I rarely get false positives in my Spam folders on Gmail, and they certainly don't expect you to non-spam all your mail before it gets accepted. This includes mail sent from my Linode.


GMail is having some serious issues with blocking too much legitimate mail. There are even huge threads in Google groups about GMail blocking Google alerts and other mail originating from within Google. It seems to me that the only source GMail should trust is mail originating from within Google.com (not GMail.com).

If you use GMail frequently you have probably trained the spam filters well enough to be accurate for you.

stefano wrote:
550-5.7.1 [151.66.38.251] The IP you're using to send mail is not authorized
550-5.7.1 to send email directly to our servers. Please use the SMTP
550-5.7.1 relay at your service provider instead. Learn more at
550 5.7.1 http://mail.google.com/support/bin/answ ... swer=10336 j9si14697256mue.5


The link tells you exactly what is wrong. Have you updated your reverse DNS to point to the server hostname? For example, if the sending server is named 'mail.mydomain.com' then the reverse should point to 'mail.mydomain.com'. Even though it isn't required, you should set your HELO to 'mail.mydomain.com' as well.

--Blaine


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 2:58 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
151.66.38.251 has no PTR record, and is listed on several popular blacklists. You will probably find that many email servers will refuse to accept messages from that ip.

Perhaps you should get a linode? :)


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 3:02 pm 
Offline
Newbie

Joined: Sat Jul 12, 2008 10:26 am
Posts: 4
SelfishMan wrote:
The link tells you exactly what is wrong. Have you updated your reverse DNS to point to the server hostname? For example, if the sending server is named 'mail.mydomain.com' then the reverse should point to 'mail.mydomain.com'. Even though it isn't required, you should set your HELO to 'mail.mydomain.com' as well.



I do not have a domain name, postfix is installed on my laptop an my ip address changes every time I connect from a different point. I accept that gmail server rejects my mail, but I don't understand why the mail is accepted when I use the command "sendmail" from the shell.

anyway, thank you all for your aswers


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 3:36 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
stefano wrote:
Still I don't understand what postfix tells to the server in order to have the mail delivered.


You can set the following in main.cf to enable verbose debugging for any connections to/from google.com:

debug_peer_list = google.com

With the default debug_peer_level of 2, this will pretty much show you the entire SMTP transaction that is taking place when postfix connects.


Top
   
 Post subject:
PostPosted: Sun Jul 13, 2008 9:02 pm 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
you should consider using a relay host (your linode is not a bad place for this) and enabling sasl in the smtp client to authenticate with it. This way, no matter where your laptop is connecting from, you can relay your mail through your linode (and your linode's (hopefully) clean ip address), and it should be accepted by most sites.


Top
   
 Post subject:
PostPosted: Mon Jul 14, 2008 4:53 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
I do this the easy way, just by establishing an SSH tunnel:
Code:
ssh -L 25:localhost:25 user@linode


Then I tell my mail client the SMTP server is at localhost. All done!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group