64 |
} |
} |
65 |
|
|
66 |
|
|
67 |
|
#ifdef SSL_TLS |
68 |
|
/* |
69 |
|
* Begin TLS negotiation (STARTTLS). |
70 |
|
*/ |
71 |
|
int |
72 |
|
imf_starttls(int *sock) |
73 |
|
{ |
74 |
|
unsigned int t; |
75 |
|
int r; |
76 |
|
|
77 |
|
r = server_response(sock, imap_starttls(sock)); |
78 |
|
imf_ssl_init(sock, SSL_TLS_V1); |
79 |
|
|
80 |
|
return r; |
81 |
|
} |
82 |
|
|
83 |
|
#endif |
84 |
|
|
85 |
|
|
86 |
/* |
/* |
87 |
* Login to server. |
* Login to server. |
88 |
*/ |
*/ |
587 |
if (r == RESPONSE_BYE || check_capabilities(&sockaux)) |
if (r == RESPONSE_BYE || check_capabilities(&sockaux)) |
588 |
return ERROR_NETWORK; |
return ERROR_NETWORK; |
589 |
|
|
590 |
|
#ifdef SSL_TLS |
591 |
|
if (destacc->ssl == SSL_DISABLED && capsaux & CAPABILITY_STARTTLS) |
592 |
|
if (imf_starttls(&sockaux) == RESPONSE_OK) |
593 |
|
check_capabilities(&sockaux); |
594 |
|
#endif |
595 |
|
|
596 |
if (r != RESPONSE_PREAUTH) { |
if (r != RESPONSE_PREAUTH) { |
597 |
if (destacc->passwdattr == PASSWORD_NONE) { |
if (destacc->passwdattr == PASSWORD_NONE) { |
598 |
printf("Enter password for %s@%s: ", destacc->username, |
printf("Enter password for %s@%s: ", destacc->username, |