X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpost.c;h=6429cb4a14cf87b52e582b7cba2f3f67a0cb5979;hb=811c11557492b9a6e6bd5ae45bb5597647ba5c99;hp=ba898a4c88bf8206d846d2d37c8463b4bc495611;hpb=2f689a1cb907a5de04e6d39ffd217a69af3216c7;p=mmh diff --git a/uip/post.c b/uip/post.c index ba898a4..6429cb4 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,12 @@ static struct swit switches[] = { { "user", SASLminc(-4) }, #define PORTSW 40 { "port server port name/number", 4 }, +#define TLSSW 41 + { "tls", TLSminc(-3) }, +#define FILEPROCSW 42 + { "fileproc", -4 }, +#define MHLPROCSW 43 + { "mhlproc", -3 }, { NULL, 0 } }; @@ -239,6 +249,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 +537,22 @@ main (int argc, char **argv) if (!(port = *argp++) || *port == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; + + case TLSSW: + tls++; + continue; + + case FILEPROCSW: + if (!(cp = *argp++) || *cp == '-') + adios (NULL, "missing argument to %s", argp[-2]); + fileproc = cp; + continue; + + case MHLPROCSW: + if (!(cp = *argp++) || *cp == '-') + adios (NULL, "missing argument to %s", argp[-2]); + mhlproc = cp; + continue; } } if (msg) @@ -1298,16 +1325,13 @@ make_bcc_file (int dashstuff) static int find_prefix (void) { - int len, result; + int result = OK; unsigned char buffer[BUFSIZ]; FILE *in; if ((in = fopen (tmpfil, "r")) == NULL) adios (tmpfil, "unable to re-open"); - len = strlen (prefix); - - result = OK; while (fgets (buffer, sizeof(buffer) - 1, in)) if (buffer[0] == '-' && buffer[1] == '-') { unsigned char *cp; @@ -1415,7 +1439,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 +1478,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)); @@ -1587,13 +1611,9 @@ do_text (char *file, int fd) * SIGNAL HANDLING */ -static RETSIGTYPE +static void sigser (int i) { -#ifndef RELIABLE_SIGNALS - SIGNAL (i, SIG_IGN); -#endif - unlink (tmpfil); if (msgflags & MINV) unlink (bccfil);