1

Hey all i am try to connect to gmail and hotmail server via telnet.

As:

$: telnet smtp.gmail.com 25
Trying 74.125.127.109...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP j3sm3044317ybe.11
helo
250 mx.google.com at your service
220 2.0.0 Ready to start TLS
mail from: codeomnitrix@smtp.localhost.com
Connection closed by foreign host.

Here codeomnitrix is a user of smtp.localhost.com. And i am running postfix at my system with sitename being smtp.localhost.com.

And i am able to sent mail locally from one user to another user but can't send to any other user who is not local.

Thanks in advance:)

codeomnitrix
  • 145
  • 1
  • 3
  • 8

3 Answers3

4

The reason telnet isn't working is because Google is now requiring ESMTP (EHLO verb, not HELO) and TLS. Telnet is now broken. You can use openssl, though.

openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:25

The normal SMTP commands should work from there.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • kk thanks sysadmin1138. but what do you think about hotmail as it says that you r not having static ip address. so how to tackle that one. Thanks :) – codeomnitrix Feb 22 '11 at 05:19
  • @codeomnitrix That's a different issue entirely. For that you'll have to test from somewhere not on the Big List of Dynamic IP Addresses. – sysadmin1138 Feb 22 '11 at 05:24
1

Why are you trying to connect to smtp.gmail.com? The MX for domains using google apps is aspmx.l.google.com and the MX for gmail.com is gmail-smtp-in.l.google.com. Are you trying to use Gmail as a mail relay for your computer, or trying to deliver to a Google Apps mail/gmail.com account?

aspmx.l.google.com does not require STARTTLS like smtp.gmail.com does, as it's an MX, not a mail submission point.

Also - what you pasted is invalid SMTP. You need angle brackets around the e-mail address in a MAIL FROM. Some SMTP servers might accept it, but Gmail won't.

$ telnet aspmx.l.google.com 25
Trying 74.125.53.27...
Connected to aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP v8si11328246ybe.52
helo
250 mx.google.com at your service
mail from: codeomnitrix@smtp.localhost.com
555 5.5.2 Syntax error. v8si11328246ybe.52
MAIL FROM: <codeomnitrix@smtp.localhost.com>
250 2.1.0 OK v8si11328246ybe.52
akramer
  • 556
  • 2
  • 6
  • Hey akramer till mail from its ok but when i typed : rcpt to: it gives some syntax error. here i am using my gmail account which is the destination of the email. – codeomnitrix Feb 22 '11 at 05:39
-1

@codeomnitrix, please try to type the command in capital letters i.e :

RCPT TO: <username@gmail.com>