9

I want to authenticate myself using my Gmail ID and password on a Gmail SMTP server. I am using the GSASL library. I have a set of mechanisms that my client supports: Anonymous, External, Login, Plain, SecureID, Digest-MD5 and CRAM-MD5. Does somebody know which mechanism Gmail uses for user authentication?

james.garriss
  • 12,959
  • 7
  • 83
  • 96
Ali Ahmed
  • 1,749
  • 6
  • 20
  • 29
  • Are you looking for this? http://mail.google.com/support/bin/answer.py?answer=78799 (my mail client seems to be using "plain" over a SSL connection) – Piskvor left the building Jul 22 '11 at 08:02
  • no its something different. I am writing my APIs for authenticating a user on gmail SMTP server. – Ali Ahmed Jul 22 '11 at 10:23
  • 1
    Now I'm confused. Are you authenticating to GoogleMail's SMTP server? (it seems so) Are you asking what mechanism is used for authenticating to the SMTP server? (it seems so) In that case, how is this quote not applicable? "Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication) Use Authentication: Yes Use STARTTLS: Yes (some clients call this SSL) Port: 465 or 587" - the authentication in this case is "Plain" – Piskvor left the building Jul 22 '11 at 10:41
  • yes 'Googlemail's' SMTP server. my mistake I should mention that earlier. – Ali Ahmed Jul 22 '11 at 10:44
  • Then indeed STARTTLS and AUTH PLAIN is what you're looking for (as stated in the linked document) – Piskvor left the building Jul 22 '11 at 10:55
  • Thanks I now understand it. I was confusing it with something else. Thanks for explanation. – Ali Ahmed Jul 22 '11 at 12:17
  • Ok, converting that comment to answer then. – Piskvor left the building Jul 22 '11 at 12:40

3 Answers3

7

To find out what authentication mechanisms an SMTP server supports, send the EHLO command. If you haven't built your own SMTP client yet, you can test this using TELNET. The server will respond with the ESMTP extensions that it supports, including AUTH. For example, if you send the EHLO command to smtp.gmail.com, you will find that it currently supports 4 mechanisms:

SERVER: 220 mx.google.com ESMTP c10sm612924yhk.4
CLIENT: EHLO AR93684-PC.local
SERVER: 250-mx.google.com at your service, [75.189.236.125]
SERVER: 250-SIZE 35882577
SERVER: 250-8BITMIME
SERVER: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
SERVER: 250 ENHANCEDSTATUSCODES

So the answer to your question is Login, Plain, XOAuth, and XOAuth2.

Note that XOAuth has been deprecated in favor of XOAuth2: https://developers.google.com/accounts/docs/OAuth2

james.garriss
  • 12,959
  • 7
  • 83
  • 96
5

To quote Google's documentation for authenticating to GMail's SMTP:

Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587

the authentication in this case is "Plain".

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
1
Mail Sender: SMTP
SMTP Server: smtp.gmail.com
Authentication: LOGIN
User: yourzuser@gmail.com
Pass: gess???
security: TLS
port: 587

at least this work for me :D cheers

kleopatra
  • 51,061
  • 28
  • 99
  • 211
Fabricio
  • 11
  • 1