From 5313859e6a37ccd63ec9d1ca78b2ea36ce22861b Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 17 Aug 2011 10:12:21 +0000 Subject: [PATCH] Fix envelope-to header. - don't output leading whitespace - don't output it at all if there is just whitespace inside. --- citadel/msgbase.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/citadel/msgbase.c b/citadel/msgbase.c index abdacccb5..b29980a5d 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1814,6 +1814,7 @@ void OutputRFC822MsgHeaders( int i, j, k; char *mptr = NULL; char *mpptr = NULL; + char *hptr; for (i = 0; i < 256; ++i) { if (TheMessage->cm_fields[i]) { @@ -1839,7 +1840,11 @@ void OutputRFC822MsgHeaders( else if (i == 'V') { if ((flags & QP_EADDR) != 0) mptr = qp_encode_email_addrs(mptr); - cprintf("Envelope-To: %s%s", mptr, nl); + hptr = mptr; + while ((*hptr != '\0') && isspace(*hptr)) + hptr ++; + if (!IsEmptyStr(hptr)) + cprintf("Envelope-To: %s%s", hptr, nl); } else if (i == 'U') { cprintf("Subject: %s%s", mptr, nl); -- 2.30.2