*
* Copyright (C) 2003 Hugo Villeneuve <hugo@hugovil.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * This file is released under the GPLv2
*/
#if HAVE_CONFIG_H
"# Mail Check Interval (in minutes, default is 5 minutes).\n");
fprintf(fp, "#mailcheckdelay 5\n\n");
fprintf(fp, "# Default mail client (optional).\n");
+ fprintf(fp,
+ "# Manual mail check: 0=double-click, 1=single-click (optional, default is "
+ "1).\n");
+ fprintf(fp, "mailcheck_single_click 1\n\n");
fprintf(fp, "#mailclient sylpheed\n\n");
fprintf(fp,
"# Audio notification, 0=disable, 1=enable (optional, default is "
wmnotify_infos.mail_check_interval = 60; /* 1 minute interval. */
wmnotify_infos.audible_notification = false; /* Disabled. */
wmnotify_infos.use_ssl = false; /* Disabled. */
+ wmnotify_infos.mailcheck_single_click = 1;
wmnotify_infos.mail_client_argv[0] = NULL; /* No default command. */
wmnotify_infos.audiofile[0] = '\0'; /* No default audio file. */
wmnotify_infos.volume = 100; /* 100% volume. */
}
} else if (STREQ(token, "server")) {
token = GetArguments("server", true);
- strncpy(wmnotify_infos.server_name, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.server_name, token, MAX_STR_LEN - 1);
+ wmnotify_infos.server_name[
+ sizeof(wmnotify_infos.server_name) - 1] = '\0';
server_found = true;
} else if (STREQ(token, "port")) {
token = GetArguments("port", true);
else if (STREQ(token, "username")) {
token = GetArguments("username", true);
- strncpy(wmnotify_infos.username, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.username, token, MAX_STR_LEN - 1);
+ wmnotify_infos.username[
+ sizeof(wmnotify_infos.username) - 1] = '\0';
username_found = true;
} else if (STREQ(token, "password")) {
token = GetArguments("password", true);
- strncpy(wmnotify_infos.password, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.password, token, MAX_STR_LEN - 1);
+ wmnotify_infos.password[
+ sizeof(wmnotify_infos.password) - 1] = '\0';
password_found = true;
} else if (STREQ(token, "mailcheckdelay")) {
int delay; /* delay in minutes. */
}
wmnotify_infos.mail_check_interval =
(unsigned int)delay * 60;
+ } else if (STREQ(token, "mailcheck_single_click")) {
+ int number;
+
+ token = GetArguments("mailcheck_single_click", true);
+ number = GetNumber(token, "mailcheck_single_click");
+ if ((number == 0) || (number == 1)) {
+ wmnotify_infos.mailcheck_single_click = number;
+ } else {
+ fprintf(stderr,
+ "%s: Invalid value for for parameter 'mailcheck_single_click' in\n"
+ "configuration file (must be 0 or 1): %d\n",
+ PACKAGE, number);
+ exit(EXIT_FAILURE);
+ }
} else if (STREQ(token, "mailclient")) {
/* Multiple arguments */
token = GetArguments("mailclient", false);