Mercurial > hgrepos > hgweb.cgi > imapext
comparison src/imapd/imapd.c @ 3:2366b362676d draft
imap-2007f
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Thu, 30 Oct 2014 00:00:57 +0900 |
parents | 28a55bc1110c |
children | d741b3ecc917 |
comparison
equal
deleted
inserted
replaced
2:fc6002700ecd | 3:2366b362676d |
---|---|
19 * University of Washington | 19 * University of Washington |
20 * Seattle, WA 98195 | 20 * Seattle, WA 98195 |
21 * Internet: MRC@Washington.EDU | 21 * Internet: MRC@Washington.EDU |
22 * | 22 * |
23 * Date: 5 November 1990 | 23 * Date: 5 November 1990 |
24 * Last Edited: 3 March 2008 | 24 * Last Edited: 22 July 2011 |
25 */ | 25 */ |
26 | 26 |
27 /* Parameter files */ | 27 /* Parameter files */ |
28 | 28 |
29 #include <stdio.h> | 29 #include <stdio.h> |
551 } | 551 } |
552 } | 552 } |
553 | 553 |
554 /* plaintext login with password */ | 554 /* plaintext login with password */ |
555 else if (!strcmp (cmd,"LOGIN")) { | 555 else if (!strcmp (cmd,"LOGIN")) { |
556 #ifdef QMAIL | |
557 extern char* conv_virtualdomain(char*); | |
558 #endif | |
559 if (user) fs_give ((void **) &user); | 556 if (user) fs_give ((void **) &user); |
560 if (pass) fs_give ((void **) &pass); | 557 if (pass) fs_give ((void **) &pass); |
561 /* two arguments */ | 558 /* two arguments */ |
562 if (!((user = cpystr (snarf (&arg))) && | 559 if (!((user = cpystr (snarf (&arg))) && |
563 (pass = cpystr (snarf (&arg))))) response = misarg; | 560 (pass = cpystr (snarf (&arg))))) response = misarg; |
574 tcp_clienthost ()); | 571 tcp_clienthost ()); |
575 } | 572 } |
576 else { /* delimit user from possible admin */ | 573 else { /* delimit user from possible admin */ |
577 if (s = strchr (user,'*')) *s++ ='\0'; | 574 if (s = strchr (user,'*')) *s++ ='\0'; |
578 /* see if username and password are OK */ | 575 /* see if username and password are OK */ |
579 #ifdef QMAIL | |
580 if (server_login (conv_virtualdomain(user),pass,s,argc,argv)) { | |
581 #else | |
582 if (server_login (user,pass,s,argc,argv)) { | 576 if (server_login (user,pass,s,argc,argv)) { |
583 #endif | |
584 state = SELECT; /* make select */ | 577 state = SELECT; /* make select */ |
585 alerttime = 0; /* force alert */ | 578 alerttime = 0; /* force alert */ |
586 response = logwin;/* return logged-in capabilities */ | 579 response = logwin;/* return logged-in capabilities */ |
587 syslog (LOG_INFO,"Login user=%.80s host=%.80s",user, | 580 syslog (LOG_INFO,"Login user=%.80s host=%.80s",user, |
588 tcp_clienthost ()); | 581 tcp_clienthost ()); |
2146 }; | 2139 }; |
2147 if (*(ret = *arg) == '='); /* easy case if zero-length argument */ | 2140 if (*(ret = *arg) == '='); /* easy case if zero-length argument */ |
2148 /* must be at least one BASE64 char */ | 2141 /* must be at least one BASE64 char */ |
2149 else if (!base64mask[*ret]) return NIL; | 2142 else if (!base64mask[*ret]) return NIL; |
2150 else { /* quick and dirty */ | 2143 else { /* quick and dirty */ |
2151 while (base64mask[*s++]); /* scan until end of BASE64 */ | 2144 while (base64mask[*s]) s++; /* scan until end of BASE64 */ |
2152 if (*s == '=') ++s; /* allow up to two padding chars */ | 2145 if (*s == '=') ++s; /* allow up to two padding chars */ |
2153 if (*s == '=') ++s; | 2146 if (*s == '=') ++s; |
2154 } | 2147 } |
2155 switch (*s) { /* anything following the argument? */ | 2148 switch (*s) { /* anything following the argument? */ |
2156 case ' ': /* another argument */ | 2149 case ' ': /* another argument */ |