13 |
|
|
14 |
|
|
15 |
extern connection_t connpri, connaux; |
extern connection_t connpri, connaux; |
16 |
|
extern options_t opts; |
17 |
extern jmp_buf acctloop; |
extern jmp_buf acctloop; |
18 |
|
|
19 |
buffer_t ibuf; /* Input buffer. */ |
buffer_t ibuf; /* Input buffer. */ |
125 |
response_bye(ibuf.data); |
response_bye(ibuf.data); |
126 |
} while (!strcasestr(ibuf.data, ultostr(tag, 16))); |
} while (!strcasestr(ibuf.data, ultostr(tag, 16))); |
127 |
|
|
128 |
if (strcasestr(ibuf.data, "IMAP4rev1")) |
if (opts.force_protocol == PROTOCOL_NONE) { |
129 |
conn->prot |= PROTOCOL_IMAP4REV1; |
if (strcasestr(ibuf.data, "IMAP4rev1")) |
130 |
else if (strcasestr(ibuf.data, "IMAP4")) |
conn->prot = PROTOCOL_IMAP4REV1; |
131 |
conn->caps |= PROTOCOL_IMAP4; |
else if (strcasestr(ibuf.data, "IMAP4")) |
132 |
else { |
conn->prot = PROTOCOL_IMAP4; |
133 |
error("server supports neither the IMAP4rev1 nor the " |
else { |
134 |
"IMAP4 protocol\n"); |
error("server supports neither the IMAP4rev1 nor the " |
135 |
return -2; |
"IMAP4 protocol\n"); |
136 |
} |
return -2; |
137 |
|
} |
138 |
|
} else |
139 |
|
conn->prot = opts.force_protocol; |
140 |
|
|
141 |
if (strcasestr(ibuf.data, "NAMESPACE")) |
if (strcasestr(ibuf.data, "NAMESPACE")) |
142 |
conn->caps |= CAPABILITY_NAMESPACE; |
conn->caps |= CAPABILITY_NAMESPACE; |