[comp.mail.elm] Filter problems - a possible solution

nigelm@ohm.york.ac.uk (Nigel Metheringham) (03/05/91)

I have seen a number of problems in this group referring to problems
with filter corrupting, or concaternating mail messages.  I had this
problem and fixed it as described in here.  I have mailed a couple
of other people having problems and described this fix, and it
worked for them as well, so I'm passing it on in the hope that it is
generally useful.

If you are using sendmail (and you are if you're using filter - read
the filter manual!), then separate messages in a mail box are delimited
by a line looking like this:-
	From syd@dsinc.dsi.com Wed Jan 23 16:34:53 1991
(the "From " starts in column 1).  Lines within a message starting
with "From " are escaped within the message, normally with a ">"
(don't confuse "From " with "From:" which is a different header). 
If the "From " header is missing, then the message start is not
recognised, so it is concaternated on to the end of the previous
message in the mailbox, or if there is no previous message elm will
complain that the mailbox is corrupt.

So the reason that we are having problems is that there is a missing
"From " delimiter, and what we need to find out is where that has
gone.  Filter is normally started from the .forward file in your
home directory, which will look something like this:-
	|/usr/local/bin/filter +some-filter-params...
Sendmail checks this file and invokes the named program with the
mail messsage as stdin.  The way the program (filter) is invoked is
described by the Prog mailer in the sendmail.cf file.  On my system
thw Prog mailer description looks like this:-
	Mprog,    P=/bin/sh,   F=lsFD,   S=20, R=20, A=sh -c $u 
However many systems have an additional flag (in the F= section),
which is the "n" flag - which tells sendmail to strip off the
initial "From " line before giving the program the message.  Most
default sendmail.cf files seem to be set like this (with the "n"
flag included).  If you, or your friendly system administrator
removes the "n" from the flags section, you should find that filter
will start working correctly - and hopefully you haven't broken
anything else!

I hope this helps some people - maybe it should be added (in a
curtailed form) to a FAQ list, or (preferably) into the filter
manual under common problems.

	Nigel.

-- 
% Nigel Metheringham, System Administrator, Department of Electronics     %
% University of York, Heslington, York, UK, YO1 5DD                       %
% Phone: +44 904 432374  Fax: +44 904 432335  Mail: nigelm@ohm.york.ac.uk %
% #include <std_disclaimer.h>      %     Keyboard error - fingers dumped! %