mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [bktools patch] mailsplit: handle tabs in headers
Date: Fri, 1 Apr 2005 15:32:53 -0500	[thread overview]
Message-ID: <20050401203253.GA27961@kvack.org> (raw)

Hello Linus et al,

The patch below fixes mailsplit to cope with non-' ' space characters 
in mail headers.  Some people seem to have mail clients that use tabs 
which would result in mailsplit omitting those headers from its 
substitutions.

		-ben
-- 
"Time is what keeps everything from happening all at once." -- John Wheeler

===== mailsplit.c 1.5 vs edited =====
--- 1.5/mailsplit.c	2002-10-09 15:52:37 -04:00
+++ edited/mailsplit.c	2005-04-01 15:26:54 -05:00
@@ -37,9 +37,9 @@
 	void (*fn)(const char *);
 	char value[HDRLEN];
 } header[] = {
-	{ "From: ", parse_from },
-	{ "Subject: " },
-	{ "Date: " }
+	{ "From:", parse_from },
+	{ "Subject:" },
+	{ "Date:" }
 };
 
 enum header_type { FROM, SUBJECT, DATE, NRHEADERS };
@@ -218,6 +218,12 @@
 			int len = strlen(name);
 			if (memcmp(buffer, name, len))
 				continue;
+			if (!isspace(buffer[len])) {
+				fprintf(stderr,
+					"malformed mail: no space after header\n");
+				continue;
+			}
+			len++;
 			strncpy(header[i].value, buffer+len, HDRLEN-1);
 			if (header[i].fn)
 				header[i].fn(header[i].value);
===== Makefile 1.7 vs edited =====
--- 1.7/Makefile	2003-05-25 22:56:42 -04:00
+++ edited/Makefile	2005-04-01 15:12:42 -05:00
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -O2
+CFLAGS=-Wall -g
 HOME=$(shell echo $$HOME)
 
 PROGRAMS=mailsplit diffsplit mkfile bkr

                 reply	other threads:[~2005-04-01 20:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050401203253.GA27961@kvack.org \
    --to=bcrl@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®