X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpost.c;h=580d3d13672f235e70ce7220fa76cd53e1a1ef40;hb=4877596410e850f2295f1015738bd8ca6e86ee0f;hp=6429cb4a14cf87b52e582b7cba2f3f67a0cb5979;hpb=f475d48680eb8bb0b6543efab9057eba2773666e;p=mmh diff --git a/uip/post.c b/uip/post.c index 6429cb4..580d3d1 100644 --- a/uip/post.c +++ b/uip/post.c @@ -20,19 +20,12 @@ #include #include -#include #include -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include -# include -#else -# ifdef TM_IN_SYS_TIME -# include -# else -# include -# endif #endif +#include #ifdef SMTPMTS # include @@ -272,10 +265,10 @@ static char *fccfold[FCCS]; /* foldernames for FCC'ing */ 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; @@ -875,8 +868,8 @@ start_headers (void) 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); @@ -884,7 +877,7 @@ start_headers (void) 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) @@ -893,7 +886,7 @@ start_headers (void) while (getname ("")) continue; } else { - strncpy (signature, adrsprintf (NULL, NULL), sizeof(signature)); + strncpy (signature, getlocaladdr(), sizeof(signature)); } } @@ -915,7 +908,7 @@ finish_headers (FILE *out) 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) @@ -950,7 +943,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", - (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) @@ -1204,7 +1197,7 @@ make_bcc_file (int dashstuff) 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) @@ -1614,6 +1607,8 @@ do_text (char *file, int fd) static void sigser (int i) { + NMH_UNUSED (i); + unlink (tmpfil); if (msgflags & MINV) unlink (bccfil);