@ -44,6 +44,7 @@ config_defaults (config_t * conf)
conf - > copy_deleted_to = global . copy_deleted_to ;
conf - > copy_deleted_to = global . copy_deleted_to ;
conf - > use_namespace = global . use_namespace ;
conf - > use_namespace = global . use_namespace ;
conf - > expunge = global . expunge ;
conf - > expunge = global . expunge ;
conf - > delete = global . delete ;
conf - > poll = global . poll ;
conf - > poll = global . poll ;
# if HAVE_LIBSSL
# if HAVE_LIBSSL
conf - > require_ssl = global . require_ssl ;
conf - > require_ssl = global . require_ssl ;
@ -133,7 +134,7 @@ load_config (const char *where)
line + + ;
line + + ;
if ( ! cmd | | * cmd = = ' # ' )
if ( ! cmd | | * cmd = = ' # ' )
continue ;
continue ;
if ( ! strn casecmp ( " mailbox " , cmd , 7 ) )
if ( ! strcasecmp ( " mailbox " , cmd ) )
{
{
if ( * cur )
if ( * cur )
cur = & ( * cur ) - > next ;
cur = & ( * cur ) - > next ;
@ -142,13 +143,13 @@ load_config (const char *where)
/* not expanded at this point */
/* not expanded at this point */
( * cur ) - > path = strdup ( val ) ;
( * cur ) - > path = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " maildir " , cmd , 7 ) )
else if ( ! strcasecmp ( " maildir " , cmd ) )
{
{
/* this only affects the global setting */
/* this only affects the global setting */
free ( global . maildir ) ;
free ( global . maildir ) ;
global . maildir = expand_strdup ( val ) ;
global . maildir = expand_strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " host " , cmd , 4 ) )
else if ( ! strcasecmp ( " host " , cmd ) )
{
{
# if HAVE_LIBSSL
# if HAVE_LIBSSL
if ( ! strncasecmp ( " imaps: " , val , 6 ) )
if ( ! strncasecmp ( " imaps: " , val , 6 ) )
@ -175,111 +176,113 @@ load_config (const char *where)
else
else
global . host = strdup ( val ) ;
global . host = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " user " , cmd , 4 ) )
else if ( ! strcasecmp ( " user " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > user = strdup ( val ) ;
( * cur ) - > user = strdup ( val ) ;
else
else
global . user = strdup ( val ) ;
global . user = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " pass " , cmd , 4 ) )
else if ( ! strcasecmp ( " pass " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > pass = strdup ( val ) ;
( * cur ) - > pass = strdup ( val ) ;
else
else
global . pass = strdup ( val ) ;
global . pass = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " port " , cmd , 4 ) )
else if ( ! strcasecmp ( " port " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > port = atoi ( val ) ;
( * cur ) - > port = atoi ( val ) ;
else
else
global . port = atoi ( val ) ;
global . port = atoi ( val ) ;
}
}
else if ( ! strn casecmp ( " box " , cmd , 3 ) )
else if ( ! strcasecmp ( " box " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > box = strdup ( val ) ;
( * cur ) - > box = strdup ( val ) ;
else
else
global . box = strdup ( val ) ;
global . box = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " alias " , cmd , 5 ) )
else if ( ! strcasecmp ( " alias " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > alias = strdup ( val ) ;
( * cur ) - > alias = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " maxsize " , cmd , 7 ) )
else if ( ! strcasecmp ( " maxsize " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > max_size = atol ( val ) ;
( * cur ) - > max_size = atol ( val ) ;
else
else
global . max_size = atol ( val ) ;
global . max_size = atol ( val ) ;
}
}
else if ( ! strn casecmp ( " UseNamespace " , cmd , 12 ) )
else if ( ! strcasecmp ( " UseNamespace " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > use_namespace = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > use_namespace = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . use_namespace = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . use_namespace = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strn casecmp ( " CopyDeletedTo " , cmd , 13 ) )
else if ( ! strcasecmp ( " CopyDeletedTo " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > copy_deleted_to = strdup ( val ) ;
( * cur ) - > copy_deleted_to = strdup ( val ) ;
else
else
global . copy_deleted_to = strdup ( val ) ;
global . copy_deleted_to = strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " Expunge " , cmd , 7 ) )
else if ( ! strcasecmp ( " Expunge " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > expunge = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > expunge = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . expunge = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . expunge = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strncasecmp ( " Poll " , cmd , 4 ) )
#if 0
else if ( ! strcasecmp ( " Poll " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > poll = atoi ( val ) ;
( * cur ) - > poll = atoi ( val ) ;
else
else
global . poll = atoi ( val ) ;
global . poll = atoi ( val ) ;
}
}
# endif
# if HAVE_LIBSSL
# if HAVE_LIBSSL
else if ( ! strn casecmp ( " CertificateFile " , cmd , 15 ) )
else if ( ! strcasecmp ( " CertificateFile " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > cert_file = expand_strdup ( val ) ;
( * cur ) - > cert_file = expand_strdup ( val ) ;
else
else
global . cert_file = expand_strdup ( val ) ;
global . cert_file = expand_strdup ( val ) ;
}
}
else if ( ! strn casecmp ( " RequireSSL " , cmd , 10 ) )
else if ( ! strcasecmp ( " RequireSSL " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > require_ssl = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > require_ssl = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . require_ssl = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . require_ssl = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strn casecmp ( " UseSSLv2 " , cmd , 8 ) )
else if ( ! strcasecmp ( " UseSSLv2 " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > use_sslv2 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > use_sslv2 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . use_sslv2 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . use_sslv2 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strn casecmp ( " UseSSLv3 " , cmd , 8 ) )
else if ( ! strcasecmp ( " UseSSLv3 " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > use_sslv3 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > use_sslv3 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . use_sslv3 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . use_sslv3 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strn casecmp ( " UseTLSv1 " , cmd , 8 ) )
else if ( ! strcasecmp ( " UseTLSv1 " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > use_tlsv1 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > use_tlsv1 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
else
else
global . use_tlsv1 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
global . use_tlsv1 = ( strcasecmp ( val , " yes " ) = = 0 ) ;
}
}
else if ( ! strn casecmp ( " RequireCRAM " , cmd , 11 ) )
else if ( ! strcasecmp ( " RequireCRAM " , cmd ) )
{
{
if ( * cur )
if ( * cur )
( * cur ) - > require_cram = ( strcasecmp ( val , " yes " ) = = 0 ) ;
( * cur ) - > require_cram = ( strcasecmp ( val , " yes " ) = = 0 ) ;
@ -288,7 +291,7 @@ load_config (const char *where)
}
}
# endif
# endif
else if ( buf [ 0 ] )
else if ( buf [ 0 ] )
printf ( " %s:%d:unknown command:%s " , path , line , cmd ) ;
printf ( " %s:%d:unknown command:%s \n " , path , line , cmd ) ;
}
}
fclose ( fp ) ;
fclose ( fp ) ;
}
}