<<< Date Index >>>     <<< Thread Index >>>

Re: How to change From: and other headers according to language



On Tue, Nov 25, 2003 at 07:51:34PM +0900, henry nelson wrote:

> (making this a new thread since original one has been answered)

(didn't answer original thread to avoid getting off onto a potentially
long tangent in this, but that's no longer an issue now)

> I've been trying reply-hook's and send-hook's like:
>    '~h "(iso-2022-jp|euc-jp)"' my_hdr 'From: \"MyJaName\" <netb@xxxxxxxxxx>'
> but I get the error that 'h' is not supported in this mode.

It _should_ work according to the manual. . .

JFF, are you using IMAP?

> Another idea I had is to stick in an 'X-label' with procmail/formail and
> then try a ~y, but I'd rather not get procmail involved (even if 'y' were
> to work in send/reply mode).

eww, eww, eww ... please don't do "X-Label:"s ... we'll end up encoding
all the "important" (read: all) information in the entire message into
a ton of labels before we're done if we use "X-Label:" headers for
everything :-(

> Anyone have a sleek way of changing headers according to language in Mutt?
> What I've seen in the manual are patterns based on To: and such.

My original plan had been to add a speaks: field to my aliases file,
and have my makealiasesrc add a send-hook for each guy with his default
language.  However, I've been thinking lately about the possibility of
replacing editor with a script that'll process the mail (edit_headers
in that case would always be set in Mutt, and the script would have its
own criteria for determining which headers to toss in the real editor).
If we do that, then we have the full power of our system behind us, and
we can easily scan the message with spell checkers of various languages
to determine the number of misspelled words according to each language,
picking the language with the least errors.  (Your method above works
fine if you use different encodings for different languages, but UTF kinda
screws everything up.)  We can also provide a menu for hand-picking, etc.
(My setup already sets the entire From: header directly anyway, with
ample facilities for "hook-like" customization (essentially allowing the
equivalent of setting from and/or realname retroactively), so pieces of
the From: header (from and/or realname) can be individually manipulated
by the setup, and/or negotiated with suggestions from other sources
(possibly forming a menu for you to pick from on a case-by-case basis).)

I hesitate to implement such an "editor" for the same reason I hesitated
to implement my "From:"-setting script: I don't like to reimplement
features that Mutt already provides.  (If the Mutt implementation sucks,
somebody should fix it.  Reimplementing core Mutt features externally
doesn't really make Mutt itself any better.)

Any other ideas?

Thanks,
 - Dave

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpqFuNKzZHYI.pgp
Description: PGP signature