X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpost.c;h=d5760a294cb598e677f7ddbb8d38a8e17ea780cf;hb=a01a41d031c796b526329a4170eb23f0ac93b949;hp=ba898a4c88bf8206d846d2d37c8463b4bc495611;hpb=2f689a1cb907a5de04e6d39ffd217a69af3216c7;p=mmh diff --git a/uip/post.c b/uip/post.c index ba898a4..d5760a2 100644 --- a/uip/post.c +++ b/uip/post.c @@ -2,8 +2,6 @@ /* * post.c -- enter messages into the mail transport system * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -46,6 +44,12 @@ # define SASLminc(a) 0 #endif /* CYRUS_SASL */ +#ifndef TLS_SUPPORT +# define TLSminc(a) (a) +#else /* TLS_SUPPORT */ +# define TLSminc(a) 0 +#endif /* TLS_SUPPORT */ + #define FCCS 10 /* max number of fccs allowed */ #define uptolow(c) ((isalpha(c) && isupper (c)) ? tolower (c) : c) @@ -140,6 +144,8 @@ static struct swit switches[] = { { "user", SASLminc(-4) }, #define PORTSW 40 { "port server port name/number", 4 }, +#define TLSSW 41 + { "tls", TLSminc(-3) }, { NULL, 0 } }; @@ -239,6 +245,7 @@ static int sasl=0; /* Use SASL auth for SMTP */ static char *saslmech=NULL; /* Force use of particular SASL mech */ static char *user=NULL; /* Authenticate as this user */ static char *port="smtp"; /* Name of server port for SMTP */ +static int tls=0; /* Use TLS for encryption */ static unsigned msgflags = 0; /* what we've seen */ @@ -526,6 +533,10 @@ main (int argc, char **argv) if (!(port = *argp++) || *port == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; + + case TLSSW: + tls++; + continue; } } if (msg) @@ -1415,7 +1426,7 @@ post (char *file, int bccque, int talk) if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose, snoop, onex, queued, sasl, saslmech, - user)) + user, tls)) || rp_isbad (retval = sm_winit (smtpmode, from))) die (NULL, "problem initializing server; %s", rp_string (retval)); @@ -1454,7 +1465,7 @@ verify_all_addresses (int talk) if (!whomsw || checksw) if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose, snoop, 0, queued, sasl, - saslmech, user)) + saslmech, user, tls)) || rp_isbad (retval = sm_winit (smtpmode, from))) die (NULL, "problem initializing server; %s", rp_string (retval));