summaryrefslogtreecommitdiffstats
path: root/examples/mail-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/mail-file.c')
-rw-r--r--examples/mail-file.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/mail-file.c b/examples/mail-file.c
index 771ce5a..784410d 100644
--- a/examples/mail-file.c
+++ b/examples/mail-file.c
@@ -56,6 +56,7 @@ struct option longopts[] =
{ "mdn", no_argument, NULL, 'd', },
{ "subject", required_argument, NULL, 's', },
{ "reverse-path", required_argument, NULL, 'f', },
+ { "ssl", no_argument, NULL, 'S', },
{ "tls", no_argument, NULL, 't', },
{ "require-tls", no_argument, NULL, 'T', },
{ "noauth", no_argument, NULL, 1, },
@@ -98,7 +99,7 @@ main (int argc, char **argv)
session = smtp_create_session ();
message = smtp_add_message (session);
- while ((c = getopt_long (argc, argv, "dmch:f:s:n:tTv",
+ while ((c = getopt_long (argc, argv, "dmch:f:s:n:StTv",
longopts, NULL)) != EOF)
switch (c)
{
@@ -138,6 +139,10 @@ main (int argc, char **argv)
smtp_set_header (message, "Disposition-Notification-To", NULL, NULL);
break;
+ case 'S':
+ smtp_starttls_enable (session, Starttls_OVER_SSL);
+ break;
+
case 't':
smtp_starttls_enable (session, Starttls_ENABLED);
break;
@@ -543,6 +548,7 @@ usage (void)
"\t-m,--monitor -- watch the protocol session with the server\n"
"\t-c,--crlf -- translate line endings from \\n to CR-LF\n"
"\t-t,--tls -- use STARTTLS extension if possible\n"
+ "\t-S,--ssl -- connect over SSL to smtps service\n"
"\t-T,--require-tls -- require use of STARTTLS extension\n"
"\t --noauth -- do not attempt to authenticate to the MSA\n"
"\t--version -- show version info and exit\n"