[Mailman-Developers] Looping digest - mailman bug?

Thomas Wouters thomas@xs4all.net
Mon, 30 Jul 2001 21:06:41 +0200


On Mon, Jul 30, 2001 at 07:09:47PM +0200, Kaja P. Christiansen wrote:

> Until there is something better, I suggest adding to Sendmail.py a patch 
> which perhaps is not pretty (it adds a space before the infamous dot), 
> but it works:

> --- ./Mailman/Handlers/Sendmail.py.orig	Fri Jul 27 13:40:31 2001
> +++ ./Mailman/Handlers/Sendmail.py	Fri Jul 27 14:11:46 2001
> @@ -31,6 +31,7 @@
>  
>  import string
>  import os
> +import re
>  
>  import HandlerAPI
>  from Mailman import mm_cfg
> @@ -80,6 +81,8 @@
>      msgtext = str(msg)
>      # cycle through all chunks
>      failedrecips = []
> +    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". And the proper escape of a single dot on a line is
doubling it (see the SMTP standard.) Barry, do you have a clue whether
msgtext is guaranteed (not) to have \r's (CR) in them ? If either is
guaranteed, we don't even need to use that ugly 're' module :)

-- 
Thomas Wouters <thomas@xs4all.net>

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