36 |
{ |
{ |
37 |
struct sockaddr_in sa; |
struct sockaddr_in sa; |
38 |
struct hostent *he; |
struct hostent *he; |
39 |
|
|
40 |
#ifndef SSL_TLS |
#ifndef SSL_TLS |
41 |
if (protocol != SSL_DISABLED) { |
if (protocol != SSL_DISABLED) { |
42 |
error("imapfilter: SSL not supported by this build\n"); |
error("imapfilter: SSL not supported by this build\n"); |
44 |
} |
} |
45 |
#endif |
#endif |
46 |
|
|
47 |
memset((char *) &sa, 0, sizeof(struct sockaddr_in)); |
memset((char *)&sa, 0, sizeof(struct sockaddr_in)); |
48 |
|
|
49 |
*sock = socket(PF_INET, SOCK_STREAM, 0); |
*sock = socket(PF_INET, SOCK_STREAM, 0); |
50 |
|
|
75 |
#ifdef SSL_TLS |
#ifdef SSL_TLS |
76 |
if (protocol != SSL_DISABLED) |
if (protocol != SSL_DISABLED) |
77 |
if (!ssl_init(sock, protocol)) { |
if (!ssl_init(sock, protocol)) { |
78 |
info("Connected to %s using %s.\n", serv, SSL_get_cipher(ssl)); |
if (sock == &sockpri) |
79 |
|
info("Connected to %s using %s.\n", serv, |
80 |
|
SSL_get_cipher(ssl)); |
81 |
return 0; |
return 0; |
82 |
} else |
} else |
83 |
return ERROR_SSL; |
return ERROR_SSL; |
85 |
ssl = NULL; |
ssl = NULL; |
86 |
#endif |
#endif |
87 |
|
|
88 |
info("Connected to %s.\n", serv); |
if (sock == &sockpri) |
89 |
|
info("Connected to %s.\n", serv); |
90 |
|
|
91 |
return 0; |
return 0; |
92 |
} |
} |
164 |
|
|
165 |
return 0; |
return 0; |
166 |
} |
} |
167 |
|
|
168 |
#endif |
#endif |
169 |
|
|
170 |
|
|