projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix burst so it actually complies with RFC 934. This means discarding
[mmh]
/
uip
/
post.c
diff --git
a/uip/post.c
b/uip/post.c
index
419b86c
..
6ce3280
100644
(file)
--- a/
uip/post.c
+++ b/
uip/post.c
@@
-20,19
+20,12
@@
#include <h/mts.h>
#include <errno.h>
#include <h/mts.h>
#include <errno.h>
-#include <setjmp.h>
#include <signal.h>
#include <signal.h>
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef TM_IN_SYS_TIME
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
#endif
+#include <time.h>
#ifdef SMTPMTS
# include <mts/smtp/smtp.h>
#ifdef SMTPMTS
# include <mts/smtp/smtp.h>
@@
-138,17
+131,21
@@
static struct swit switches[] = {
{ "queued", -6 },
#define SASLSW 37
{ "sasl", SASLminc(-4) },
{ "queued", -6 },
#define SASLSW 37
{ "sasl", SASLminc(-4) },
-#define SASLMECHSW 38
+#define NOSASLSW 38
+ { "nosasl", SASLminc(-6) },
+#define SASLMXSSFSW 39
+ { "saslmaxssf", SASLminc(-10) },
+#define SASLMECHSW 40
{ "saslmech", SASLminc(-5) },
{ "saslmech", SASLminc(-5) },
-#define USERSW 39
+#define USERSW 41
{ "user", SASLminc(-4) },
{ "user", SASLminc(-4) },
-#define PORTSW 40
+#define PORTSW 42
{ "port server port name/number", 4 },
{ "port server port name/number", 4 },
-#define TLSSW 41
+#define TLSSW 43
{ "tls", TLSminc(-3) },
{ "tls", TLSminc(-3) },
-#define FILEPROCSW 42
+#define FILEPROCSW 44
{ "fileproc", -4 },
{ "fileproc", -4 },
-#define MHLPROCSW 43
+#define MHLPROCSW 45
{ "mhlproc", -3 },
{ NULL, 0 }
};
{ "mhlproc", -3 },
{ NULL, 0 }
};
@@
-246,6
+243,7
@@
static int checksw = 0; /* whom -check */
static int linepos=0; /* putadr()'s position on the line */
static int nameoutput=0; /* putadr() has output header name */
static int sasl=0; /* Use SASL auth for SMTP */
static int linepos=0; /* putadr()'s position on the line */
static int nameoutput=0; /* putadr() has output header name */
static int sasl=0; /* Use SASL auth for SMTP */
+static int saslssf=-1; /* Our maximum SSF for SASL */
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 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 */
@@
-272,10
+270,10
@@
static char *fccfold[FCCS]; /* foldernames for FCC'ing */
static struct headers *hdrtab; /* table for the message we're doing */
static struct headers *hdrtab; /* table for the message we're doing */
-static struct mailname localaddrs={NULL}; /* local addrs */
-static struct mailname netaddrs={NULL}; /* network addrs */
-static struct mailname uuaddrs={NULL}; /* uucp addrs */
-static struct mailname tmpaddrs={NULL}; /* temporary queue */
+static struct mailname localaddrs; /* local addrs */
+static struct mailname netaddrs; /* network addrs */
+static struct mailname uuaddrs; /* uucp addrs */
+static struct mailname tmpaddrs; /* temporary queue */
#ifdef SMTPMTS
static int snoop = 0;
#ifdef SMTPMTS
static int snoop = 0;
@@
-522,6
+520,16
@@
main (int argc, char **argv)
case SASLSW:
sasl++;
continue;
case SASLSW:
sasl++;
continue;
+
+ case NOSASLSW:
+ sasl = 0;
+ continue;
+
+ case SASLMXSSFSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ saslssf = atoi(cp);
+ continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
@@
-875,8
+883,8
@@
start_headers (void)
mygid = getgid ();
time (&tclock);
mygid = getgid ();
time (&tclock);
- strncpy (from, adrsprintf (NULL, NULL), sizeof(from));
- strncpy (myhost, LocalName (), sizeof(myhost));
+ strncpy (from, getlocaladdr(), sizeof(from));
+ strncpy (myhost, LocalName (0), sizeof(myhost));
for (cp = myhost; *cp; cp++)
*cp = uptolow (*cp);
for (cp = myhost; *cp; cp++)
*cp = uptolow (*cp);
@@
-884,7
+892,7
@@
start_headers (void)
if ((cp = getfullname ()) && *cp) {
strncpy (sigbuf, cp, sizeof(sigbuf));
snprintf (signature, sizeof(signature), "%s <%s>",
if ((cp = getfullname ()) && *cp) {
strncpy (sigbuf, cp, sizeof(sigbuf));
snprintf (signature, sizeof(signature), "%s <%s>",
- sigbuf, adrsprintf (NULL, NULL));
+ sigbuf, getlocaladdr());
if ((cp = getname (signature)) == NULL)
adios (NULL, "getname () failed -- you lose extraordinarily big");
if ((mp = getm (cp, NULL, 0, AD_HOST, NULL)) == NULL)
if ((cp = getname (signature)) == NULL)
adios (NULL, "getname () failed -- you lose extraordinarily big");
if ((mp = getm (cp, NULL, 0, AD_HOST, NULL)) == NULL)
@@
-893,7
+901,7
@@
start_headers (void)
while (getname (""))
continue;
} else {
while (getname (""))
continue;
} else {
- strncpy (signature, adrsprintf (NULL, NULL), sizeof(signature));
+ strncpy (signature, getlocaladdr(), sizeof(signature));
}
}
}
}
@@
-915,7
+923,7
@@
finish_headers (FILE *out)
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Message-ID: <%d.%ld@%s>\n",
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName ());
+ (int) getpid (), (long) tclock, LocalName (1));
if (msgflags & MFRM) {
/* There was already a From: in the draft. Don't add one. */
if (!draft_from_masquerading)
if (msgflags & MFRM) {
/* There was already a From: in the draft. Don't add one. */
if (!draft_from_masquerading)
@@
-950,7
+958,7
@@
finish_headers (FILE *out)
fprintf (out, "Resent-Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n",
fprintf (out, "Resent-Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName ());
+ (int) getpid (), (long) tclock, LocalName (1));
if (msgflags & MRFM) {
/* There was already a Resent-From: in draft. Don't add one. */
if (!draft_from_masquerading)
if (msgflags & MRFM) {
/* There was already a Resent-From: in draft. Don't add one. */
if (!draft_from_masquerading)
@@
-1204,7
+1212,7
@@
make_bcc_file (int dashstuff)
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Message-ID: <%d.%ld@%s>\n",
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
if (msgid)
fprintf (out, "Message-ID: <%d.%ld@%s>\n",
- (int) getpid (), (long) tclock, LocalName ());
+ (int) getpid (), (long) tclock, LocalName (1));
if (msgflags & MFRM) {
/* There was already a From: in the draft. Don't add one. */
if (!draft_from_masquerading)
if (msgflags & MFRM) {
/* There was already a From: in the draft. Don't add one. */
if (!draft_from_masquerading)
@@
-1438,8
+1446,8
@@
post (char *file, int bccque, int talk)
sigon ();
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose,
sigon ();
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose,
- snoop, onex, queued, sasl, saslmech,
- user, tls))
+ snoop, onex, queued, sasl, saslssf,
+ saslmech, user, tls))
|| rp_isbad (retval = sm_winit (smtpmode, from)))
die (NULL, "problem initializing server; %s", rp_string (retval));
|| rp_isbad (retval = sm_winit (smtpmode, from)))
die (NULL, "problem initializing server; %s", rp_string (retval));
@@
-1478,7
+1486,7
@@
verify_all_addresses (int talk)
if (!whomsw || checksw)
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
verbose, snoop, 0, queued, sasl,
if (!whomsw || checksw)
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
verbose, snoop, 0, queued, sasl,
- saslmech, user, tls))
+ saslssf, saslmech, user, tls))
|| rp_isbad (retval = sm_winit (smtpmode, from)))
die (NULL, "problem initializing server; %s", rp_string (retval));
|| rp_isbad (retval = sm_winit (smtpmode, from)))
die (NULL, "problem initializing server; %s", rp_string (retval));
@@
-1611,12
+1619,10
@@
do_text (char *file, int fd)
* SIGNAL HANDLING
*/
* SIGNAL HANDLING
*/
-static RETSIGTYPE
+static void
sigser (int i)
{
sigser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (i, SIG_IGN);
-#endif
+ NMH_UNUSED (i);
unlink (tmpfil);
if (msgflags & MINV)
unlink (tmpfil);
if (msgflags & MINV)