/[imapfilter]/imapfilter/request.c
ViewVC logotype

Diff of /imapfilter/request.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.49 by lefcha, Sun Mar 30 15:40:28 2003 UTC revision 1.50 by lefcha, Sat Jul 26 19:40:20 2003 UTC
# Line 12  Line 12 
12  extern int sockpri, sockaux;  extern int sockpri, sockaux;
13  extern unsigned int options;  extern unsigned int options;
14  extern char charset[CHARSET_LEN];  extern char charset[CHARSET_LEN];
15  extern unsigned int capabilities;  extern unsigned int capspri, capsaux;
16    
17  namesp_t nsppri, nspaux;        /* Primary and auxiliary namespace. */  namesp_t nsppri, nspaux;        /* Primary and auxiliary namespace. */
18    
# Line 36  test(int *sock) Line 36  test(int *sock)
36  int  int
37  check_capabilities(int *sock)  check_capabilities(int *sock)
38  {  {
39          capabilities = CAPABILITY_NONE;          if (sock == &sockpri)
40                    capspri = CAPABILITY_NONE;
41            else
42                    capsaux = CAPABILITY_NONE;
43    
44          return capability_response(sock, imap_capability(sock));          return capability_response(sock, imap_capability(sock));
45  }  }
# Line 48  check_capabilities(int *sock) Line 51  check_capabilities(int *sock)
51  int  int
52  check_namespace(int *sock, namesp_t * nsp)  check_namespace(int *sock, namesp_t * nsp)
53  {  {
54            unsigned int *caps;
55    
56            caps = (sock == &sockpri ? &capspri : &capsaux);
57          nsp->prefix[0] = nsp->delim = '\0';          nsp->prefix[0] = nsp->delim = '\0';
58    
59          if (!(options & OPTION_NAMESPACE) ||          if (!(options & OPTION_NAMESPACE) ||
60              !(capabilities & CAPABILITY_NAMESPACE))              !(*caps & CAPABILITY_NAMESPACE))
61                  return 0;                  return 0;
62          else          else
63                  return namespace_response(sock, imap_namespace(sock), nsp);                  return namespace_response(sock, imap_namespace(sock), nsp);
# Line 569  action_rcopy(char *mbox, char *mesgs, ac Line 575  action_rcopy(char *mbox, char *mesgs, ac
575                          get_password(destacc->password, PASSWORD_LEN);                          get_password(destacc->password, PASSWORD_LEN);
576                          destacc->passwdattr = PASSWORD_PLAIN;                          destacc->passwdattr = PASSWORD_PLAIN;
577                  }                  }
578                  if (login(&sockaux, destacc->username,  #ifdef CRAM_MD5
579                          destacc->password) == RESPONSE_NO) {                  if (capsaux & CAPABILITY_AUTH_CRAM_MD5)
580                            r = imf_cram_md5(&sockaux, destacc->username,
581                                destacc->password);
582                    else
583    #endif
584                            r = login(&sockaux, destacc->username,
585                                destacc->password);
586    
587                    if (r == RESPONSE_NO) {
588                          error("username %s or password rejected at %s\n",                          error("username %s or password rejected at %s\n",
589                              destacc->username, destacc->server);                              destacc->username, destacc->server);
590                          return ERROR_NETWORK;                          return ERROR_NETWORK;

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26