Skip to content

Commit

Permalink
Merge pull request #169 from mfkp/master
Browse files Browse the repository at this point in the history
fix for gmail imap (via oauth2)
  • Loading branch information
dinhvh committed Oct 29, 2014
2 parents 4079ddc + b71bbe1 commit 610d5d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/driver/implementation/imap/imapdriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,9 +1236,12 @@ static int imapdriver_login_sasl(mailsession * session,
{
int r;

r = mailimap_authenticate(get_imap_session(session),
auth_type, server_fqdn, local_ip_port, remote_ip_port,
login, auth_name, password, realm);
if (strcasecmp(auth_type, "xoauth2") == 0)
r = mailimap_oauth2_authenticate(get_imap_session(session), auth_name, password);
else
r = mailimap_authenticate(get_imap_session(session),
auth_type, server_fqdn, local_ip_port, remote_ip_port,
login, auth_name, password, realm);

return imap_error_to_mail_error(r);
}
Expand Down
2 changes: 2 additions & 0 deletions src/driver/implementation/imap/imapstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ extern "C" {
@param login is the login of the IMAP4rev1 account.
@param password is the password of the IMAP4rev1 account.
If performing OAuth2 login, use the OAuth2 token here
instead of password.
@param cached if this value is != 0, a persistant cache will be
stored on local system.
Expand Down
2 changes: 1 addition & 1 deletion src/driver/interface/maildriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ int mailsession_get_message_by_uid(mailsession * session,
@param remote_ip_port remote IP:port (server)
@param login login
@param auth_name authentication name
@param password password
@param password password (or token for OAuth2 login)
@param realm realm
@return MAIL_NO_ERROR is returned on success, MAIL_ERROR_XXX is returned
Expand Down

0 comments on commit 610d5d9

Please sign in to comment.