X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..a3724ed39:/uip/post.c?ds=sidebyside diff --git a/uip/post.c b/uip/post.c index abd89b72..81bd7b4a 100644 --- a/uip/post.c +++ b/uip/post.c @@ -15,6 +15,8 @@ #include #include #include +#include "../sbr/m_mktemp.h" +#include "../sbr/message_id.h" #ifdef HAVE_SYS_TIME_H # include @@ -169,7 +171,7 @@ struct headers { #define MVIS 0x0008 /* we've seen sighted addrs */ #define MINV 0x0010 /* we've seen blind addrs */ #define MSND 0x0020 /* we've seen a Sender: */ -#define MRSN 0x0040 /* We've seen a Resent-Sendr:*/ +#define MRSN 0x0040 /* We've seen a Resent-Sender: */ #define MEFM 0x0080 /* We've seen Envelope-From: */ #define MMIM 0x0100 /* We've seen Mime-Version: */ @@ -318,7 +320,7 @@ main (int argc, char **argv) int noverify = 0; int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */ char *cp, *msg = NULL, **argp, **arguments, *envelope; - char buf[BUFSIZ], name[NAMESZ], *auth_svc = NULL; + char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL; FILE *in, *out; m_getfld_state_t gstate = 0; @@ -1211,7 +1213,7 @@ get_header (char *header, struct headers *table) struct headers *h; for (h = table; h->value; h++) - if (!strcasecmp (header ? header : "", h->value ? h->value : "")) + if (!strcasecmp (FENDNULL(header), FENDNULL(h->value))) return (h - table); return NOTOK; @@ -1312,10 +1314,10 @@ insert (struct mailname *np) : &netaddrs; mp->m_next; mp = mp->m_next) - if (!strcasecmp (np->m_host ? np->m_host : "", - mp->m_next->m_host ? mp->m_next->m_host : "") && - !strcasecmp (np->m_mbox ? np->m_mbox : "", - mp->m_next->m_mbox ? mp->m_next->m_mbox : "") && + if (!strcasecmp (FENDNULL(np->m_host), + FENDNULL(mp->m_next->m_host)) && + !strcasecmp (FENDNULL(np->m_mbox), + FENDNULL(mp->m_next->m_mbox)) && np->m_bcc == mp->m_next->m_bcc) return 0; @@ -1339,7 +1341,7 @@ pl (void) printf ("\nnet:\t"); for (mp = netaddrs.m_next; mp; mp = mp->m_next) - printf ("%s%s@%s%s%s", mp->m_path ? mp->m_path : "", + printf ("%s%s@%s%s%s", FENDNULL(mp->m_path), mp->m_mbox, mp->m_host, mp->m_bcc ? "[BCC]" : "", mp->m_next ? ",\n\t" : ""); @@ -1566,18 +1568,16 @@ find_prefix (void) } -#define plural(x) (x == 1 ? "" : "s") - static void chkadr (void) { if (badadr && unkadr) die (NULL, "%d address%s unparsable, %d addressee%s undeliverable", - badadr, plural (badadr), unkadr, plural (badadr)); + badadr, PLURALS(badadr), unkadr, PLURALS(badadr)); if (badadr) - die (NULL, "%d address%s unparsable", badadr, plural (badadr)); + die (NULL, "%d address%s unparsable", badadr, PLURALS(badadr)); if (unkadr) - die (NULL, "%d addressee%s undeliverable", unkadr, plural (unkadr)); + die (NULL, "%d addressee%s undeliverable", unkadr, PLURALS(unkadr)); } @@ -1849,7 +1849,7 @@ do_text (char *file, int fd) int retval, state; char buf[BUFSIZ]; - lseek (fd, (off_t) 0, SEEK_SET); + lseek(fd, 0, SEEK_SET); while ((state = read (fd, buf, sizeof(buf))) > 0) { if (rp_isbad (retval = sm_wtxt (buf, state))) @@ -1866,7 +1866,7 @@ do_text (char *file, int fd) case RP_NO: case RP_NDEL: die (NULL, "posting failed; %s", rp_string (retval)); - /* FALLTHRU */ + break; default: die (NULL, "unexpected response; %s", rp_string (retval)); @@ -1988,7 +1988,7 @@ fcc (char *file, char *folder) if (!verbose) fprintf (stderr, " %sFcc %s: ", msgstate == RESENT ? "Resent-" : "", folder); - pidstatus (status, verbose ? stdout : stderr, NULL); + pidstatus (status, verbose ? stdout : stderr, fileproc); } else { if (verbose) puts("folder ok");