Quantcast

blog post about the headef folding algorithm rewrite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

blog post about the headef folding algorithm rewrite

R. David Murray
For the curious, I just posted a writeup of the process that
produced the header folding algorithm rewrite on my blog:

http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/

--
R. David Murray           http://www.bitdance.com
_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

Glenn Linderman-3
On 4/11/2011 2:48 PM, R. David Murray wrote:
For the curious, I just posted a writeup of the process that
produced the header folding algorithm rewrite on my blog:

http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/

Updated my virus definitions, and it went away.  Guess it was a false positive in Avast.  Sorry for the noise.

_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

Barry Warsaw
In reply to this post by R. David Murray
On Apr 11, 2011, at 05:48 PM, R. David Murray wrote:

>For the curious, I just posted a writeup of the process that
>produced the header folding algorithm rewrite on my blog:
>
>http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/

Excellent post David.  Thanks too for being so diplomatic when mentioning "the
author of the algorithm" :).

-Barry

_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

R. David Murray
On Mon, 11 Apr 2011 18:12:05 -0400, Barry Warsaw <[hidden email]> wrote:
> On Apr 11, 2011, at 05:48 PM, R. David Murray wrote:
> >For the curious, I just posted a writeup of the process that
> >produced the header folding algorithm rewrite on my blog:
> >
> >http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/
>
> Excellent post David.  Thanks too for being so diplomatic when
> mentioning "the author of the algorithm" :).

Well, (a) I wasn't sure it was you and (b) my original attempt to
rewrite the algorithm ended up even uglier than yours :)

--
R. David Murray           http://www.bitdance.com
_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

Glenn Linderman-3
In reply to this post by R. David Murray
On 4/11/2011 2:48 PM, R. David Murray wrote:
For the curious, I just posted a writeup of the process that
produced the header folding algorithm rewrite on my blog:

http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/
Interesting!

[2]There may also be cases where whitespace does not mark a valid folding point. So for email6 the folding API will further need to provide a way for the specific header to indicate these points before folding. The simplest scheme is probably to replace the non-folding whitespace with marker characters, fold the header, and then re-convert the marker characters to the original whitespace.

Another alternative may be to allow the header access to the Accumulator, and let it emit chunks directly into the accumulator.  This would save reparsing.


_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

R. David Murray
On Mon, 11 Apr 2011 15:26:27 -0700, Glenn Linderman <[hidden email]> wrote:

> On 4/11/2011 2:48 PM, R. David Murray wrote:
> > [2]
> > <http://www.bitdance.com/blog/2011/04/11_01_Email6_Rewriting_Header_Folding/#id2>There
> > may also be cases where whitespace does /not/ mark a valid folding
> > point. So for email6 the folding API will further need to provide a
> > way for the specific header to indicate these points before folding.
> > The simplest scheme is probably to replace the non-folding whitespace
> > with marker characters, fold the header, and then re-convert the
> > marker characters to the original whitespace.
>
> Another alternative may be to allow the header access to the
> Accumulator, and let it emit chunks directly into the accumulator.  This
> would save reparsing.

Well, the algorithm doesn't work that way, since the smarts for managing
the accumulator is all in the class that is building the output lines,
not in the accumulator itself.  Right now what gets fed into that class
is strings that are pieces of the header (actually it's (string, charset)
pairs), which the feed method then splits up into potential split points
and uses the accumulator to manage.

What would work would be to provide an alternate API where the Header
class feeds in an already-split list instead of a string.  That makes
sense from several perspectives.

Or, despite what I said in the blog post, I may end up rewriting the
algorithm again at some point ;)

--David
_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: blog post about the headef folding algorithm rewrite

Glenn Linderman-3
On 4/11/2011 6:09 PM, R. David Murray wrote:
What would work would be to provide an alternate API where the Header
class feeds in an already-split list instead of a string.  That makes
sense from several perspectives.

That's the essence of what I meant.  An already-split list wouldn't (hopefully) need to do the double substitution for white-space versus placeholders, and wouldn't need to parse to find potential split points.  The only fly in the ointment would be if there was an item in the already-split list that is too long and needs to be further split.

"Just a person that is interested in email and wants to post to the list and wants to use a discriptive but not real name for real name" [hidden email] -ly yours,
Glenn

_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com
Loading...