X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpost.c;h=d99da1fd627ec86ee9380d7594212699a77e3452;hb=76b51b746c95647aceff29ab178eff496843f528;hp=e161674430e5bd2211e6998b2f366e205cbc414d;hpb=59a210325d70e6a38c0ef9e5dcb105cec8bd38d2;p=mmh diff --git a/uip/post.c b/uip/post.c index e161674..d99da1f 100644 --- a/uip/post.c +++ b/uip/post.c @@ -48,6 +48,8 @@ #define FCCS 10 /* max number of fccs allowed */ +#define uptolow(c) ((isalpha(c) && isupper (c)) ? tolower (c) : c) + /* In the following array of structures, the numeric second field of the structures (minchars) is apparently used like this: @@ -292,7 +294,7 @@ static int insert (struct mailname *); static void pl (void); static void anno (void); static int annoaux (struct mailname *); -static void insert_fcc (struct headers *, char *); +static void insert_fcc (struct headers *, unsigned char *); static void make_bcc_file (int); static void verify_all_addresses (int); static void chkadr (void); @@ -828,7 +830,7 @@ putfmt (char *name, char *str, FILE *out) static void start_headers (void) { - char *cp; + unsigned char *cp; char myhost[BUFSIZ], sigbuf[BUFSIZ]; struct mailname *mp; @@ -944,7 +946,7 @@ get_header (char *header, struct headers *table) struct headers *h; for (h = table; h->value; h++) - if (!strcasecmp (header, h->value)) + if (!mh_strcasecmp (header, h->value)) return (h - table); return NOTOK; @@ -1046,8 +1048,8 @@ insert (struct mailname *np) : &netaddrs; mp->m_next; mp = mp->m_next) - if (!strcasecmp (np->m_host, mp->m_next->m_host) - && !strcasecmp (np->m_mbox, mp->m_next->m_mbox) + if (!mh_strcasecmp (np->m_host, mp->m_next->m_host) + && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox) && np->m_bcc == mp->m_next->m_bcc) return 0; @@ -1126,9 +1128,9 @@ annoaux (struct mailname *mp) static void -insert_fcc (struct headers *hdr, char *pp) +insert_fcc (struct headers *hdr, unsigned char *pp) { - char *cp; + unsigned char *cp; for (cp = pp; isspace (*cp); cp++) continue; @@ -1165,7 +1167,18 @@ make_bcc_file (int dashstuff) if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", (int) getpid (), (long) tclock, LocalName ()); - fprintf (out, "From: %s\n", signature); + if (msgflags & MFRM) { + /* There was already a From: in the draft. Don't add one. */ + if (!draft_from_masquerading) + /* mts.conf didn't contain "masquerade:[...]draft_from[...]" + so we'll reveal the user's actual account@thismachine + address in a Sender: header (and use it as the envelope + From: later). */ + fprintf (out, "Sender: %s\n", from); + } + else + /* Construct a From: header. */ + fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); fprintf (out, "BCC:\n"); @@ -1275,7 +1288,7 @@ static int find_prefix (void) { int len, result; - char buffer[BUFSIZ]; + unsigned char buffer[BUFSIZ]; FILE *in; if ((in = fopen (tmpfil, "r")) == NULL) @@ -1286,7 +1299,7 @@ find_prefix (void) result = OK; while (fgets (buffer, sizeof(buffer) - 1, in)) if (buffer[0] == '-' && buffer[1] == '-') { - char *cp; + unsigned char *cp; for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (!isspace (*cp))