20 |
unsigned int send_command(int *sock, char *cmd) |
unsigned int send_command(int *sock, char *cmd) |
21 |
{ |
{ |
22 |
#ifdef DEBUG |
#ifdef DEBUG |
23 |
printf("debug: sending command: %s", cmd); |
fprintf(stderr, "debug: sending command: %s", cmd); |
24 |
#endif |
#endif |
25 |
|
|
26 |
socket_write(sock, cmd); |
socket_write(sock, cmd); |
92 |
return send_command(sock, cmd); |
return send_command(sock, cmd); |
93 |
} |
} |
94 |
|
|
95 |
|
|
96 |
|
/* |
97 |
|
* IMAP AUTHENTICATE: indicates authentication mechanism and performs an |
98 |
|
* authentication protocol exchange. |
99 |
|
*/ |
100 |
|
int imap_authenticate(int *sock, char *auth) |
101 |
|
{ |
102 |
|
int r; |
103 |
|
char cmd[MEDIUM_CMD]; |
104 |
|
|
105 |
|
verbose("Client request: AUTHENTICATE\n"); |
106 |
|
|
107 |
|
snprintf(cmd, MEDIUM_CMD, "%X AUTHENTICATE %s\r\n", tag, auth); |
108 |
|
|
109 |
|
return send_command(sock, cmd); |
110 |
|
} |
111 |
|
|
112 |
|
|
113 |
/* |
/* |
114 |
* IMAP LOGIN: identifies client to server. |
* IMAP LOGIN: identifies client to server. |