X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=58134e866ff57e70598e4c7f7255790f24f7bc59;hb=a8e1bd2a4a465c35b837951cfa5ef459cc07e0ad;hp=6962e7d090bf72dfa50442f03140b1aa95015b7e;hpb=ce4f06238d2fde40958f4089921d332426f8be4e;p=dockapps%2Fwmnotify.git diff --git a/src/configfile.c b/src/configfile.c index 6962e7d..58134e8 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -85,6 +85,8 @@ CreateDefaultConfigurationFile( char *file ) fprintf( fp, "username xxxxxxxx\n\n" ); fprintf( fp, "# Password.\n" ); fprintf( fp, "password xxxxxxxx\n\n" ); + fprintf( fp, "# IMAP folder name (optional, default is INBOX).\n" ); + fprintf( fp, "# folder INBOX.some_folder\n\n" ); fprintf( fp, "# Mail Check Interval (in minutes, default is 5 minutes).\n" ); fprintf( fp, "#mailcheckdelay 5\n\n" ); fprintf( fp, "# Default mail client (optional).\n" ); @@ -188,6 +190,7 @@ ParseConfigurationFile( FILE *file ) const char *err_string = NULL; /* Default values for optional parameters. */ + strcpy( wmnotify_infos.imap_folder, "INBOX"); /* Default IMAP folder. */ wmnotify_infos.port = 110; wmnotify_infos.mail_check_interval = 60; /* 1 minute interval. */ wmnotify_infos.audible_notification = false; /* Disabled. */ @@ -223,6 +226,11 @@ ParseConfigurationFile( FILE *file ) protocol_found = true; } + else if( STREQ( token, "imap_folder" ) ) { + token = GetArguments( "imap_folder", true ); + /* Should check size before using strcpy(), or use strncopy() instead. */ + strcpy( wmnotify_infos.imap_folder, token ); + } else if( STREQ( token, "use_ssl" ) ){ int number;