[Mailman-Developers] Looping digest - mailman bug?

Thomas Wouters thomas@xs4all.net
Wed, 1 Aug 2001 15:52:22 +0200


On Wed, Aug 01, 2001 at 03:29:35PM +0200, Kaja P. Christiansen wrote:

> Thomas Wouters writes:

>  > > +    bar = re.compile('\n\.')
>  > > +    msgtext = re.sub(bar, '\n .', msgtext, 0)
>  > 
>  > Sorry, this is the wrong fix. "\n." isn't the pattern that breaks it; you
>  > want "\r?\n.\r?\n".

> Not really; to be precise, "\n\.\n" is what breaks mail delivery.

Yes. And "\r?\n\.\r?\n" matches that (I forgot to escape the . in my first
reply :) Alright, the first '\r?' can be left out, but the second can't. Go
ahead and try it; I'm pretty certain "\n.\r\n" will also break off the
delivery.

> Guaranteed not to contain CR's; I've saved a few of the 'bombing messages'
> and the single dot on a line is preceeded and followed by LF's.

That is no guarantee, unfortunately. That's empirical proof, which is the
most treacherous sort around :) Unless you (or someone else) traced all code
paths and see no way for any kind of input to case the message text at that
point to contain CR's, I'd prefer to use "\n\.\r?\n", even though that means
we have to use the 're' module instead of the 'string' one.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!