Commit 057471f6 057471f6debcf726ac515f029e71bf8af819a671 by Sergey Poznyakoff

Use "tls" command line capability.

1 parent c255ceba
......@@ -39,6 +39,7 @@
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailutils/nls.h>
#include <mailutils/tls.h>
static char* show_field;
static int show_to;
......@@ -161,6 +162,9 @@ static const char *frm_argp_capa[] = {
"common",
"license",
"mailbox",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -308,6 +312,9 @@ main(int argc, char **argv)
mu_init_nls ();
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
mu_argp_parse (&argp, &argc, &argv, 0, frm_argp_capa, &c, NULL);
/* have an argument */
......@@ -323,6 +330,7 @@ main(int argc, char **argv)
registrar_get_list (&bookie);
list_append (bookie, mbox_record);
list_append (bookie, path_record);
list_append (bookie, mh_record);
list_append (bookie, pop_record);
list_append (bookie, imap_record);
}
......
......@@ -82,6 +82,9 @@ static const char *capa[] = {
"common",
"license",
"mailbox",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -104,6 +107,9 @@ main(int argc, char **argv)
{
int opt;
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
mu_argp_parse (&argp, &argc, &argv, 0, capa, &opt, NULL);
mailbox_name = argv[opt];
}
......@@ -114,6 +120,7 @@ main(int argc, char **argv)
registrar_get_list (&bookie);
list_append (bookie, mbox_record);
list_append (bookie, path_record);
list_append (bookie, mh_record);
list_append (bookie, pop_record);
list_append (bookie, imap_record);
}
......
......@@ -136,10 +136,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
if (args->file)
{
util_error (_("Usage error: --file takes an optional argument, "
"it must follow the option\n"
"without any intervening whitespace."));
util_error (_("Run mail --help for more info."));
args->file = arg;
}
else
......@@ -171,6 +167,9 @@ static const char *mail_capa[] = {
"common",
"license",
"mailbox",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -222,7 +221,7 @@ main (int argc, char **argv)
/* Native Language Support */
mu_init_nls ();
/* Register the desire formats. */
/* Register the desired formats. */
{
list_t bookie;
registrar_get_list (&bookie);
......@@ -252,7 +251,7 @@ main (int argc, char **argv)
/* set up the default environment */
if (!getenv ("HOME"))
{
char *p = util_get_homedir();
char *p = util_get_homedir ();
setenv ("HOME", p, 0);
}
setenv ("DEAD", util_fullpath("~/dead.letter"), 0);
......@@ -326,6 +325,9 @@ main (int argc, char **argv)
/* argument parsing */
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
mu_argp_parse (&argp, &argc, &argv, 0, mail_capa, NULL, &args);
/* read system-wide mail.rc and user's .mailrc */
......
......@@ -45,6 +45,9 @@ static const char *argp_capa[] = {
"common",
"license",
"mailbox",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -101,6 +104,9 @@ main (int argc, char **argv)
mu_init_nls ();
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
mu_argp_parse (&argp, &argc, &argv, 0, argp_capa, NULL, &args);
registrar_get_list (&bookie);
......
......@@ -59,6 +59,9 @@ static struct argp argp = {
static const char *readmsg_argp_capa[] = {
"common",
"mailbox",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -229,6 +232,9 @@ main (int argc, char **argv)
mu_init_nls ();
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
mu_argp_parse (&argp, &argc, &argv, 0, readmsg_argp_capa, &index, NULL);
/* Registration. */
......
......@@ -42,6 +42,7 @@
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/nls.h>
#include <mailutils/tls.h>
void mutil_register_all_mbox_formats (void);
......@@ -221,6 +222,9 @@ static const char *sieve_argp_capa[] =
"logging",
"mailer",
"sieve",
#ifdef WITH_TLS
"tls",
#endif
NULL
};
......@@ -311,6 +315,9 @@ main (int argc, char *argv[])
mu_init_nls ();
mu_argp_init (program_version, NULL);
#ifdef WITH_TLS
mu_tls_init_client_argp ();
#endif
sieve_argp_init ();
rc = mu_argp_parse (&argp, &argc, &argv, ARGP_IN_ORDER, sieve_argp_capa,
0, &opts);
......