summaryrefslogtreecommitdiff
path: root/pop3d/pop3d.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-28 00:59:50 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-28 00:59:50 +0200
commitd39f4c2db3ea8bc387cde7dcc2825598aa166ff6 (patch)
tree0bec3e016c68147941de2d340f24ffaf718f02f2 /pop3d/pop3d.c
parent6dad17fe877fde4f17d87bc5a0327417936dbbd8 (diff)
downloadmailutils-d39f4c2db3ea8bc387cde7dcc2825598aa166ff6.tar.gz
mailutils-d39f4c2db3ea8bc387cde7dcc2825598aa166ff6.tar.bz2
Improve configuration parsing (step 1).
Remove obsolete options (these have been made hidden in v. 2.0). Handle "include" and "program" after parsing the sources, not while reducing the tree, as was previously. Retain, however, old functions for compatibility, making them deprecated. Add "query" mode to mailutils-config. * include/mailutils/cfg.h (mu_cfg_node_tag): Remove (mu_cfg_statement): Rename to mu_cfg_node_statement. (mu_cfg_tree): New member: tail. (mu_cfg_perror): Change signature. (mu_cfg_vperror, mu_cfg_parse_error): New protos. (MU_CFG_PATH_DELIM, MU_CFG_PATH_DELIM_STR): New defines. (MU_PARSE_CONFIG_PLAIN,MU_CFG_FMT_LOCUS): New constant. (MU_CFG_DEPRECATED): New macro. (mu_parse_config,mu_get_config): Deprecated. (mu_cfg_format_parse_tree): Change signature. (mu_cfg_format_node, mu_cfg_parse_file): New protos. (mu_cfg_tree_free): Remove stale proto. (mu_cfg_find_node, mu_cfg_create_subtree): New protos. * include/mailutils/libcfg.h (mu_libcfg_parse_config): New proto. (mu_parse_config_files): Deprecated. * include/mailutils/mutil.h (mu_make_file_name): New proto. (mu_retrieve_fp, mu_register_retriever) (mu_retrieve): Remove unused prototypes. * include/mailutils/opool.h (mu_opool_union): New proto. * libmu_argp/Makefile.am (libmu_argp_a_SOURCES): Remove sources (see below): * po/POTFILES.in: Likewise. * libmu_argp/gsasl.c: Remove. * libmu_argp/pam.c: Remove. * libmu_argp/radius.c: Remove. * libmu_argp/sql.c: Remove. * libmu_argp/tls.c: Remove. * libmu_argp/virtdomain.c: Remove. * config/mailutils-config.c: New option --query (-q) (main): Handle query mode. * comsat/comsat.c: Define MU_CFG_COMPATIBILITY to suppress deprecation warnings. * bootstrap.conf (XGETTEXT_OPTIONS): Add mu_cfg error reporting functions. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add mkfilename.c * mailbox/mkfilename.c: New file. * imap4d/imap4d.c: Remove obsolete option (hidden since 2.0) * libmu_argp/auth.c: Likewise. * libmu_argp/cmdline.c: Likewise. * libmu_argp/tls.c: Likewise. * pop3d/pop3d.c: Likewise. * libmu_argp/common.c: Likewise. (mu_common_argp_options): New option --set. * libmu_argp/muinit.c (mu_app_init): Rewrite using parse tree as a principal entity. * libmu_cfg/init.c (mu_libcfg_parse_config): New function. * mailbox/cfg_driver.c (make_file_name): Remove. (_cb_include): Use mu_make_file_name. (mu_build_container): Use deprecated code only unless MU_PARSE_CONFIG_PLAIN flag is set. (mu_cfg_tree_reduce): Do nothing if the tree is NULL. * mailbox/cfg_format.c (format_node): Print locus optionally. (mu_cfg_format_parse_tree): Take additional argument. (mu_cfg_format_node): New function. * mailbox/cfg_lexer.l: Update calls to diagnostic functions. (mu_cfg_parse_file): New function. (mu_get_config): Rewrite. * mailbox/cfg_parser.y (parse_tree): Replace with parse_head, parse_tail. All usages updated. (mu_cfg_free_node): New function. (mu_cfg_vperror): New function. (mu_cfg_perror,mu_cfg_parse_error): New function. (mu_cfg_tree_union): New function. (mu_cfg_tree_postprocess): New function. (mu_cfg_find_section): Use MU_CFG_PATH_DELIM instead of hardcoded slash. (mu_cfg_value_eq): New function. (mu_cfg_find_node): New function. Redesign of an old idea. (mu_cfg_create_subtree): New function. * mailbox/opool.c (mu_opool_union): New function. * frm/testsuite/frm/test.exp: use --set option instead of the obsolete --mail-folder. * messages/testsuite/messages/test.exp: Likewise. * sieve/testsuite/sieve/action.exp: Likewise. * mail/testsuite/lib/mail.exp: use --set option instead of the obsolete --mail-spool. * mailbox/testsuite/lib/mailbox.exp: Likewise. * testsuite/lib/mailutils.exp: Likewise. * mailbox/mutil.c (mu_register_retriever) (mu_retrieve): Remove unused functions. Minor fix: * frm/common.c (frm_abort): Initialize URL before usage. (frm_scan): Don't call frm_abort on a mailbox that was not opened successfully.
Diffstat (limited to 'pop3d/pop3d.c')
-rw-r--r--pop3d/pop3d.c81
1 files changed, 2 insertions, 79 deletions
diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c
index 6c725cbdb..50621a2a3 100644
--- a/pop3d/pop3d.c
+++ b/pop3d/pop3d.c
@@ -49,21 +49,14 @@ char *login_stat_file = LOGIN_STAT_FILE;
#endif
unsigned expire = EXPIRE_NEVER; /* Expire messages after this number of days */
-int expire_on_exit = 0; /* Delete expired messages on exit */
+int expire_on_exit = 0; /* Delete expired messages on exit */
static error_t pop3d_parse_opt (int key, char *arg, struct argp_state *astate);
const char *program_version = "pop3d (" PACKAGE_STRING ")";
static char doc[] = N_("GNU pop3d -- the POP3 daemon.");
-#define OPT_LOGIN_DELAY 257
-#define OPT_STAT_FILE 258
-#define OPT_EXPIRE 259
-#define OPT_EXPIRE_ON_EXIT 260
-#define OPT_TLS_REQUIRED 261
-#define OPT_BULLETIN_SOURCE 262
-#define OPT_BULLETIN_DB 263
-#define OPT_FOREGROUND 264
+#define OPT_FOREGROUND 256
static struct argp_option options[] = {
#define GRP 0
@@ -73,38 +66,6 @@ static struct argp_option options[] = {
N_("runs in daemon mode with a maximum of NUMBER children"), GRP+1 },
#undef GRP
-#define GRP 5
- {"undelete", 'u', NULL, OPTION_HIDDEN,
- N_("undelete all messages on startup"), GRP+1},
- {"expire", OPT_EXPIRE, N_("DAYS"), OPTION_HIDDEN,
- N_("expire read messages after the given number of days"), GRP+1},
- {"delete-expired", OPT_EXPIRE_ON_EXIT, NULL, OPTION_HIDDEN,
- N_("delete expired messages upon closing the mailbox"), GRP+1},
-#ifdef WITH_TLS
- {"tls-required", OPT_TLS_REQUIRED, NULL, OPTION_HIDDEN,
- N_("always require STLS before entering authentication phase")},
-#endif
-#undef GRP
-
-#define GRP 10
-#ifdef ENABLE_LOGIN_DELAY
- {"login-delay", OPT_LOGIN_DELAY, N_("SECONDS"), OPTION_HIDDEN,
- N_("allowed delay between two successive logins"), GRP+1},
- {"stat-file", OPT_STAT_FILE, N_("FILENAME"), OPTION_HIDDEN,
- N_("name of login statistics file"), GRP+1},
-#endif
-
-#undef GRP
-
-#define GRP 20
- { "bulletin-source", OPT_BULLETIN_SOURCE, N_("MBOX"), OPTION_HIDDEN,
- N_("set source mailbox to get bulletins from"), GRP+1 },
-#ifdef USE_DBM
- { "bulletin-db", OPT_BULLETIN_DB, N_("FILE"), OPTION_HIDDEN,
- N_("set the bulletin database file name"), GRP+1 },
-#endif
-#undef GRP
-
{NULL, 0, NULL, 0, NULL, 0}
};
@@ -203,44 +164,6 @@ pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
mu_argp_node_list_new (&lst, "foreground", "yes");
break;
- case 'u':
- mu_argp_node_list_new (&lst, "undelete", "yes");
- break;
-
-#ifdef ENABLE_LOGIN_DELAY
- case OPT_LOGIN_DELAY:
- mu_argp_node_list_new (&lst, "login-delay", arg);
- break;
-
- case OPT_STAT_FILE:
- mu_argp_node_list_new (&lst, "stat-file", arg);
- break;
-#endif
-
- case OPT_EXPIRE:
- mu_argp_node_list_new (&lst, "expire", arg);
- break;
-
- case OPT_EXPIRE_ON_EXIT:
- mu_argp_node_list_new (&lst, "delete-expired", "yes");
- break;
-
-#ifdef WITH_TLS
- case OPT_TLS_REQUIRED:
- mu_argp_node_list_new (&lst, "tls-required", "yes");
- break;
-#endif
-
- case OPT_BULLETIN_SOURCE:
- mu_argp_node_list_new (&lst, "bulletin-source", arg);
- break;
-
-#ifdef USE_DBM
- case OPT_BULLETIN_DB:
- mu_argp_node_list_new (&lst, "bulletin-db", arg);
- break;
-#endif
-
case ARGP_KEY_INIT:
mu_argp_node_list_init (&lst);
break;

Return to:

Send suggestions and report system problems to the System administrator.