--- a/man/man1/splitmail.1
+++ b/man/man1/splitmail.1
@@ -51,6 +51,10 @@
 .BR index++ (1).
 The generated files have 5-digit increasing numbers
 appended to a common prefix.
+If the mailbox file has some non-mail header, then this is
+dumped to a file with the same prefix and
+\f(Cw_junk_header\f1
+as the suffix.
 .SH OPTIONS
 .TP 12
 .BI \-p prefix
@@ -63,7 +67,8 @@
 splits the mailbox \f(CWsent_messages\f1 into files named
 \f(CWmsg.00001\f1,
 \f(CWmsg.00002\f1,
-and so on.
+and so on. Any non-mail header gets dumped to a file named
+\f(CWmsg_junk_header\f1.
 .SH NOTE
 This utility hasn't been exhaustively tested.
 .SH SEE ALSO
--- a/scripts/splitmail.in
+++ b/scripts/splitmail.in
@@ -2,8 +2,11 @@
 ##
 #	SWISH++
 #	splitmail
+#       Modified Sat, 04 Aug 2007 11:40:55 +0530 by KHP
+#       	to save "junk header" if any.
 #
 #	Copyright (C) 2000  Paul J. Lucas
+#	Copyright (C) 2007  Kapil Hari Paranjape
 #
 #	This program is free software; you can redistribute it and/or modify
 #	it under the terms of the GNU General Public License as published by
@@ -30,6 +33,12 @@
 getopts( 'p:' ) or die "usage: $me -p prefix\n";
 die "$me: -p required\n" unless $opt_p;
 
+# Lines added by KHP
+open( FILE, ">$opt_p." . "_junk_header") ||
+	die "$me: can not create file\n";
+$i=0;
+# End of lines added by KHP
+
 while ( <> ) {
 	if ( /^From / ) {
 		close( FILE );
