aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-11-20 12:15:45 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-11-20 12:15:45 +0000
commit81f55d00c85342c2b0cea983babb369df0964faf (patch)
treed59b635534ebd426416eaf47128e4ae914a77406
parent7ff058904c6bcffb8d2e0198d6a756faec8f8be4 (diff)
downloadwyslij-po-81f55d00c85342c2b0cea983babb369df0964faf.tar.gz
wyslij-po-81f55d00c85342c2b0cea983babb369df0964faf.tar.bz2
Define MU-1.3x configuration statements.
-rw-r--r--ChangeLog4
-rw-r--r--src/main.c51
2 files changed, 54 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e2f58a..ceb00a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-20 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/main.c: Define MU-1.3x configuration statements.
+
2007-11-19 Sergey Poznyakoff <gray@gnu.org.ua>
* README-hacking: Mention GNU Mailutils.
diff --git a/src/main.c b/src/main.c
index 1231adb..1dab2ce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -186,6 +186,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
}
static const char *capa[] = {
+ "common",
"mailer",
NULL
};
@@ -200,6 +201,53 @@ static struct argp argp = {
NULL
};
+
+#if MAILUTILS_VERSION_NUMBER >= 1290
+
+static int
+_cb_verify_option (mu_cfg_locus_t *locus, void *data, char *arg, int bit)
+{
+ int flag;
+ if (mu_cfg_parse_boolean (arg, &flag))
+ {
+ mu_error ("%s:%u: %s", locus->file, locus->line, _("not a boolean"));
+ return 1;
+ }
+ if (flag)
+ SET_VERIFY_BIT (bit);
+ else
+ CLEAR_VERIFY_BIT (bit);
+ return 0;
+}
+
+static int
+_cb_verify_po_time (mu_cfg_locus_t *locus, void *data, char *arg)
+{
+ return _cb_verify_option (locus, data, arg, VERIFY_PO_TIME);
+}
+
+static int
+_cb_verify_version (mu_cfg_locus_t *locus, void *data, char *arg)
+{
+ return _cb_verify_option (locus, data, arg, VERIFY_PACKAGE_VERSION);
+}
+
+struct mu_cfg_param wyslij_po_cfg_param[] = {
+ { "compress", mu_cfg_string, &compress },
+ { "langtab", mu_cfg_string, &langtab },
+ { "to", mu_cfg_string, &address },
+ { "cc", mu_cfg_string, &cc },
+ { "bcc", mu_cfg_string, &bcc },
+ { "fcc", mu_cfg_string, &fcc },
+ { "from", mu_cfg_string, &sender },
+ { "from-po", mu_cfg_bool, &set_sender_from_po },
+ { "verify-po-time", mu_cfg_callback, NULL, _cb_verify_po_time },
+ { "verify-version", mu_cfg_callback, NULL, _cb_verify_version },
+ { NULL }
+};
+#endif
+
+
static char *
concat (const char *a, const char *b, const char *c)
{
@@ -495,7 +543,8 @@ main (int argc, char **argv)
#if MAILUTILS_VERSION_NUMBER < 1290
rc = mu_argp_parse (&argp, &argc, &argv, 0, capa, &index, NULL);
#else
- rc = mu_app_init (&argp, capa, NULL, argc, argv, 0, &index, NULL);
+ rc = mu_app_init (&argp, capa, wyslij_po_cfg_param, argc, argv, 0, &index,
+ NULL);
#endif
if (rc)
exit (1);

Return to:

Send suggestions and report system problems to the System administrator.