1 |
#include <stdio.h> |
#include <stdio.h> |
|
#include <unistd.h> |
|
|
#include <stdlib.h> |
|
|
#include <ctype.h> |
|
|
#include <errno.h> |
|
2 |
#include <string.h> |
#include <string.h> |
3 |
#include <sys/time.h> |
#include <ctype.h> |
4 |
#include <sys/types.h> |
#include <sys/types.h> |
5 |
#include <regex.h> |
#include <regex.h> |
6 |
#include <setjmp.h> |
#include <setjmp.h> |
7 |
|
|
8 |
#include "config.h" |
#include "config.h" |
9 |
#include "imapfilter.h" |
#include "imapfilter.h" |
10 |
|
#include "buffer.h" |
11 |
|
|
12 |
|
|
13 |
extern conn_t connpri, connaux; |
extern conn_t connpri, connaux; |
16 |
buffer_t ibuf; /* Input buffer. */ |
buffer_t ibuf; /* Input buffer. */ |
17 |
|
|
18 |
|
|
19 |
|
void receive_response(conn_t * conn, char *buf); |
20 |
|
void bye_response(char *buf); |
21 |
|
int analyze_response(conn_t * conn, char *buf); |
22 |
|
|
23 |
|
|
24 |
/* |
/* |
25 |
* Read one packet of data that the server sent. |
* Read one packet of data that the server sent. |
26 |
*/ |
*/ |
34 |
fprintf(stderr, "debug: getting response (%s):\n\n%s\n", |
fprintf(stderr, "debug: getting response (%s):\n\n%s\n", |
35 |
(conn == &connpri ? "primary" : "auxiliary"), buf); |
(conn == &connpri ? "primary" : "auxiliary"), buf); |
36 |
#endif |
#endif |
|
|
|
37 |
} |
} |
38 |
|
|
39 |
|
|
132 |
if (strcasestr(ibuf.data, "STARTTLS")) |
if (strcasestr(ibuf.data, "STARTTLS")) |
133 |
conn->caps |= CAPABILITY_STARTTLS; |
conn->caps |= CAPABILITY_STARTTLS; |
134 |
#endif |
#endif |
|
|
|
|
|
|
135 |
return analyze_response(conn, ibuf.data); |
return analyze_response(conn, ibuf.data); |
136 |
} |
} |
137 |
|
|
165 |
} |
} |
166 |
return analyze_response(conn, ibuf.data); |
return analyze_response(conn, ibuf.data); |
167 |
} |
} |
|
|
|
168 |
#endif |
#endif |
169 |
|
|
170 |
|
|