[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: outlook reply to sanity converter for vim



Karsten M. Self wrote:
> on Fri, Dec 07, 2001 at 01:00:24PM -0600, Mike Brownlow (mike@wsmake.org) wrote:
> > I'm feeling random, so I thought I'd share this fun thing I added for
> > messages that are outlook user replies. 
> 
> Hmmm....
> 
> I'm playing with it.  Pretty cool start.  Not sure it's quite prime-time
> yet....

Yeah, I only spent enough time on it to make a point at work recently.
But I'm starting to find it very useful now that finals are over and I'm
back at work more, where nearly everybody uses outlook. bleahk. I have
puke yellow to show up in my index for outlook messages, it gets nasty.

> > It works semi-reliably on them after hitting reply in mutt. 
> 
> ...not with default reply-to settings, as this tool wants headers, and
> they're not there by default.  So you've got to do a reply, save the
> message, then 'E' to edit with headers.

Unless edit_headers is set in the configuration. Then they are there by
default on reply. But you are right, it would be good for the script to
be independent of that.

> > There's plenty of room for improvement, but it works pretty nicely as
> > a way to free my frustration after seeing outlook replies. 
> 
> Agreed there.
> 
> > Even when it doesn't work. :) 
> 
> ...unfortunately, somewhat often.

I haven't had it fail that often...but I imagine there would be quite a
few Outlook features I haven't run into yet.

> > Note, it currently only works on one outlook reply at a time.
> 
> I'm noticing this.  One list I monitor has a _bunch_ of LookOut Lusers,
> with a *really* bad habit of quoting several days worth of archives in
> their posts (well, 3-5 generations of reply, in full, at any rate).
> 
> Any chance this could be generalized to loop through multiple replies
> and modify accordingly?  I'm a pretty minimally skilled Perl hacker
> myself....

Sure. In fact, I was ultimately planning to do that when I got the time.
Also, it would try to detect discontinuous emails in general and attempt
to fix them.

I would also like to change it so that it fixes the message before mutt
adds a generation. I tried playing around with message-hook, but
couldn't find a way to get this to work nicely. Something like:

message-hook '~h "^X-Mailer: Microsoft"' "exec pipe-message fixit.pl"

Of course I don't think I'm using those commands appropriately. :)
message-hook's input/output is independent of that command afaics.
message-hook doesn't have input/output i think. It only changes
settings.

> > So use it regularly. ;) It changes the "-- Original Message --"
> > nonsense and some other things. 
> 
> Delimiting what it changes would be a good step.  Seems to:
> 
>   1. Fix attributions.
> 
> 	-----Original Message-----
> 	From: <sender>
> 	Sent: <date>
> 	To: <recipient>
> 	Subject: <subject>
> 
>      ...is changed to:
> 
>      On <date>, <sender> wrote, as it should be.
> 
>      I'm noting that a "From:" line that wraps isn't properly handled,
>      e.g.:
> 
>      > -----Original Message-----
>      > From: owner-pho@onehouse.com [mailto:owner-pho@onehouse.com] On Behalf
>      > Of Brad Hill
>      > Sent: Monday, November 19, 2001 1:56 PM
>      > To: Jeff Coleman; pho@onehouse.com
>      > Subject: Re: pho: Wired: Will draw for food

Oops. Hadn't run into that yet. :)

>   2. Reply is moved *below* quoted material.
> 
>   3. Quoting is fixed -- the broken prefix format of MS Outlook (the
>      security hole that happens to be an email client) is
>      rectified...for the first generation of quoting.

Such a relief, isn't it? :) When it works...

> > Be sure to customize it to your liking.
> > 
> > Note...the headers for the message being edited are preferred to be in
> > vim for this to work.
> 
> This should be made optional.

Yep.

> > Add in vimrc:
> > map <f1> vG$!ol2sanity.pl<cr>
> > 
> > Choose a different key if you want. Note that it assumes you are at the
> > top of the file.
> 
> <f1> is already mapped to "help" in vim.  I'd suggest a different key.
> 
> "1,$ ! ol2sanity.pl<cr>" would be a better mapping to cover all
> contingencies.  This will run over the full buffer regardless of pointer
> position.

Ahh, cool. But it needs a colon in front right?

map <f2> :1,$ ! ol2sanity.pl<cr>

I'll put some real effort into the script it if people are interested.

-- 
Mike Brownlow           ><>          http://www.wsmake.org/~mike/
-----------------------------------------------------------------
1024D/8AA6EAFD 3861 96B3 EEA2 285C BE23  F706 3E1E EBB2 8AA6 EAFD



Reply to: