Browse Source

Merge pull request #169 from mfkp/master

fix for gmail imap (via oauth2)
merge-experiment
Hoà V. DINH 8 years ago
parent
commit
610d5d9453
3 changed files with 9 additions and 4 deletions
  1. +6
    -3
      src/driver/implementation/imap/imapdriver.c
  2. +2
    -0
      src/driver/implementation/imap/imapstorage.h
  3. +1
    -1
      src/driver/interface/maildriver.h

+ 6
- 3
src/driver/implementation/imap/imapdriver.c View File

@ -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);
}


+ 2
- 0
src/driver/implementation/imap/imapstorage.h View File

@ -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.


+ 1
- 1
src/driver/interface/maildriver.h View File

@ -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


Loading…
Cancel
Save