From: markus schnalke Date: Sat, 7 Jul 2012 10:33:31 +0000 (+0200) Subject: spost: Don't send Sign: or Enc: headers out. X-Git-Tag: mmh-thesis-end~7 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=4cb212cf82fa0c832ee3247da33e733f5cce04d6 spost: Don't send Sign: or Enc: headers out. Also, fixed the format of header fields with empty values. The trailing newline is no longer stripped. --- diff --git a/uip/spost.c b/uip/spost.c index de4a6d2..9b2ffcb 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -314,20 +314,25 @@ putfmt(char *name, char *str, FILE *out) char *cp; struct headers *hdr; - /* remove all leading whitespace (even newlines) */ - while (*str==' ' || *str=='\t' || *str=='\n') { + /* remove leading whitespace */ + while (*str==' ' || *str=='\t') { str++; } if ((i = get_header(name, hdrtab)) == NOTOK) { - /* no header we would care for: push it through */ - fprintf(out, "%s: %s", name, str); + /* no header we would care for */ + if (mh_strcasecmp(name, attach_hdr)!=0 && + mh_strcasecmp(name, sign_hdr)!=0 && + mh_strcasecmp(name, enc_hdr)!=0) { + /* push it through */ + fprintf(out, "%s: %s", name, str); + } return; } /* it's one of the interesting headers */ hdr = &hdrtab[i]; - if (hdr->flags & HIGN || !*str) { + if (hdr->flags & HIGN || strcmp(str, "\n")==0) { return; }