Ralf Haferkamp wrote:
>
> On Fri, Feb 22, 2002 at 11:40:04AM -0500, Ken Murchison wrote:
> >
> >
> > Christopher Wong wrote:
> > >
> > > On Fri, 22 Feb 2002, Christopher Wong wrote:
> > > > I am using Cyrus-IMAP 2.0.16 with Sieve enabled, and managing it with
> > > > websieve. For this mailing list, I set up the following rule using
> > > > websieve (as displayed by the "current rules" page):
> > > >
> > > > IF 'To' contains 'info-cyrus' OR field: 'CC' contains 'info-cyrus' THEN
> > > > File Into 'INBOX.Cyrus-IMAP'
> > > >
> > > > This rule works most of the time. What puzzles me is that some emails do
> > > > not get filtered. That is, instead of getting filed into the Cyrus-IMAP
> > > > mailbox, occasional emails get past Sieve and end up in my INBOX. Here is
> > > > one recent email that got past it:
> > >
> > > On second thought, I think I should include the full headers. One of the
> > > unfiltered emails' headers follow below. One thing different between the
> > > unfiltered emails and other emails on the list is the presence of a
> > > Received line prefixed by a ">" coming from the sauter-bc.com domain.
> > > Could this be messing up Sieve?
> >
> > Good catch (I've noticed the same problem, but never spent any time
> > tracking it down). I'm almost certain that this is what it is causing
> > the problem, ie, lmtpd/sieve choke on this header and never read the
> > rest. If I have the time, I'll double check the source.
> Since we had the same problems here I took a look at the source code.
> It is exactly what You guessed. It happens in the function
> fill_cache()/parseheader() in lmtpengine.c:
>
> static int fill_cache(......)
> {
> /* let's fill that header cache */
> for (;;) {
> char *name, *body;
> int cl, clinit;
>
> if (parseheader(fin, fout, &name, &body) < 0) {
> break;
> }
>
> [..]
>
> parseheader tries to split a mail header into its contents. It returns a
> values less than 0, in case the Header name doesn't start with an Letter
> (it checks with isalpha)
>
> > > Does that prefix belong in the headers?
> >
> > No. I'm pretty certain that if you check RFC[2]822 that this is an
> > illegal header. Just like "From" without a colon is illegal.
> Yes, that is what I thought, but then I took a look at the RFCs. RFC2822 says
> the following about header-names:
>
> [..]
> 2.2. Header Fields
>
> Header fields are lines composed of a field name, followed by a colon
> (":"), followed by a field body, and terminated by CRLF. A field
> name MUST be composed of printable US-ASCII characters (i.e.,
> characters that have values between 33 and 126, inclusive), except
> ^^^^^^^^^^^^^^^^^^
> colon. A field body may be composed of any US-ASCII characters,
> [..]
>
> It should be easy to fix lmtpengine.c to match this specification. I'll
> give it a try.
Fixed in CVS.
Ken
--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26 Orchard Park, NY 14127
--PGP Public Key-- http://www.oceana.com/~ken/ksm.pgp