diff --git a/src/compat/main.c b/src/compat/main.c index 0f1be9e..1b21f0e 100644 --- a/src/compat/main.c +++ b/src/compat/main.c @@ -34,7 +34,7 @@ #include #include -#if HAVE_GETOPT_LONG +#ifdef HAVE_GETOPT_LONG # define _GNU_SOURCE # include struct option Opts[] = { @@ -187,7 +187,7 @@ main( int argc, char **argv ) #define FLAGS "wW:alCLRc:defhp:qu:P:r:F:M:1I:s:vVD" mod = all = list = ops = writeout = Quiet = Verbose = Debug = 0; -#if HAVE_GETOPT_LONG +#ifdef HAVE_GETOPT_LONG while ((i = getopt_long( argc, argv, FLAGS, Opts, NULL )) != -1) #else while ((i = getopt( argc, argv, FLAGS )) != -1) @@ -252,7 +252,7 @@ main( int argc, char **argv ) mod = 1; break; case 's': -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (!strncasecmp( "imaps:", optarg, 6 )) { global.use_imaps = 1; global.port = 993; diff --git a/src/drv_imap.c b/src/drv_imap.c index e01e7c0..46d2a81 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -25,7 +25,7 @@ /* This must come before isync.h to avoid our #define S messing up * blowfish.h on MacOS X. */ #include -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL # include # include # include @@ -62,7 +62,7 @@ typedef struct imap_server_conf { int port; char *user; char *pass; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL char *cert_file; unsigned use_imaps:1; unsigned require_ssl:1; @@ -96,7 +96,7 @@ typedef struct _list { typedef struct { int fd; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL SSL *ssl; unsigned int use_ssl:1; #endif @@ -124,7 +124,7 @@ typedef struct imap_store { /* command queue */ int nexttag, num_in_progress, literal_pending; struct imap_cmd *in_progress, **in_progress_append; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL SSL_CTX *SSLContext; #endif buffer_t buf; /* this is BIG, so put it last */ @@ -155,7 +155,7 @@ enum CAPABILITY { UIDPLUS, LITERALPLUS, NAMESPACE, -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL CRAM, STARTTLS, #endif @@ -166,7 +166,7 @@ static const char *cap_list[] = { "UIDPLUS", "LITERAL+", "NAMESPACE", -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL "AUTH=CRAM-MD5", "STARTTLS", #endif @@ -187,7 +187,7 @@ static const char *Flags[] = { "Deleted", }; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL /* Some of this code is inspired by / lifted from mutt. */ static int @@ -351,7 +351,7 @@ init_ssl_ctx( imap_store_t *ctx ) static void socket_perror( const char *func, Socket_t *sock, int ret ) { -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL int err; if (sock->use_ssl) { @@ -388,7 +388,7 @@ socket_read( Socket_t *sock, char *buf, int len ) assert( sock->fd >= 0 ); n = -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL sock->use_ssl ? SSL_read( sock->ssl, buf, len ) : #endif read( sock->fd, buf, len ); @@ -407,7 +407,7 @@ socket_write( Socket_t *sock, char *buf, int len ) assert( sock->fd >= 0 ); n = -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL sock->use_ssl ? SSL_write( sock->ssl, buf, len ) : #endif write( sock->fd, buf, len ); @@ -428,7 +428,7 @@ socket_pending( Socket_t *sock ) return -1; if (num > 0) return num; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (sock->use_ssl) return SSL_pending( sock->ssl ); #endif @@ -1295,7 +1295,7 @@ imap_open_store( store_conf_t *conf, struct hostent *he; struct sockaddr_in addr; int s, a[2], preauth; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL int use_ssl; #endif @@ -1317,7 +1317,7 @@ imap_open_store( store_conf_t *conf, ctx->in_progress_append = &ctx->in_progress; /* open connection to IMAP server */ -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL use_ssl = 0; #endif @@ -1379,7 +1379,7 @@ imap_open_store( store_conf_t *conf, ctx->buf.sock.fd = s; } -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (srvc->use_imaps) { if (start_tls( ctx )) goto ssl_bail; @@ -1407,7 +1407,7 @@ imap_open_store( store_conf_t *conf, goto bail; if (!preauth) { -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (!srvc->use_imaps && (srvc->use_sslv2 || srvc->use_sslv3 || srvc->use_tlsv1)) { /* always try to select SSL support if available */ if (CAP(STARTTLS)) { @@ -1452,7 +1452,7 @@ imap_open_store( store_conf_t *conf, */ srvc->pass = nfstrdup( arg ); } -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (CAP(CRAM)) { struct imap_cmd *cmd = new_imap_cmd(); @@ -1470,7 +1470,7 @@ imap_open_store( store_conf_t *conf, error( "Skipping account %s, server forbids LOGIN\n", srvc->name ); goto bail; } -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (!use_ssl) #endif warn( "*** IMAP Warning *** Password is being sent in the clear\n" ); @@ -1504,7 +1504,7 @@ imap_open_store( store_conf_t *conf, cb( &ctx->gen, aux ); return; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL ssl_bail: /* This avoids that we try to send LOGOUT to an unusable socket. */ close( ctx->buf.sock.fd ); @@ -1785,7 +1785,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, int *err ) } else return 0; -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL /* this will probably annoy people, but its the best default just in * case people forget to turn it on */ @@ -1796,7 +1796,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, int *err ) while (getcline( cfg ) && cfg->cmd) { if (!strcasecmp( "Host", cfg->cmd )) { /* The imap[s]: syntax is just a backwards compat hack. */ -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL if (!memcmp( "imaps:", cfg->val, 6 )) { cfg->val += 6; server->use_imaps = 1; @@ -1818,7 +1818,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, int *err ) server->pass = nfstrdup( cfg->val ); else if (!strcasecmp( "Port", cfg->cmd )) server->port = parse_int( cfg ); -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL else if (!strcasecmp( "CertificateFile", cfg->cmd )) { server->cert_file = expand_strdup( cfg->val ); if (access( server->cert_file, R_OK )) { diff --git a/src/main.c b/src/main.c index 4776fc7..7899a0e 100644 --- a/src/main.c +++ b/src/main.c @@ -74,7 +74,7 @@ PACKAGE " " VERSION " - mailbox synchronizer\n" "--create and --expunge can be suffixed with -master/-slave. Read the man page.\n" "\nSupported mailbox formats are: IMAP4rev1, Maildir\n" "\nCompile time options:\n" -#if HAVE_LIBSSL +#ifdef HAVE_LIBSSL " +HAVE_LIBSSL\n" #else " -HAVE_LIBSSL\n"