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

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



On Fri, Nov 28, 2003 at 10:27:28AM +0900, henry nelson wrote:

> On Wed, Nov 26, 2003 at 03:38:15PM -0500, David Yitzchak Cohen wrote:
> > On Tue, Nov 25, 2003 at 07:51:34PM +0900, henry nelson wrote:
> > > I've been trying reply-hook's and send-hook's like:
> > >    '~h "(iso-2022-jp|euc-jp)"' my_hdr 'From: \"MyJaName\" <netb@xxxxxxxxx=
> > s>'
> > > but I get the error that 'h' is not supported in this mode.
> > 
> > It _should_ work according to the manual. . .
> 
> I didn't see in the manual where "~h" wouldn't work -- but then I don't
> really have a grasp on what the meaning of "this mode" is.
> 
> > JFF, are you using IMAP?
> 
> No.

Those two questions were related.  Theoretically, ~h _should_ work
in that mode, since the header structure is available at that point.
However, we've noticed some interesting troubles with IMAP at least,
where the entire message is fetched when trying to match on ~h ... which
is rather weird.  I was curious about the possibility that your problem
may be related.  Obviously, either it isn't, or the problem reaches
farther than IMAP.

> > > 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.
> 
> I need to clarify that what I had hoped Mutt would do is to act on the
> Content-type/charset header.  I realize that that would only apply to
> replies and forwards, etc., not to newly initiated mails, but for my
> purposes that would be quite valuable.

Well, I don't know of any simple solution other than what you're already
doing.

> > My original plan had been to add a speaks: field to my aliases file,
> 
> This is what I'm doing now in a way, adding specific From: headers according
> to "~t" patterns.  It works quite well for people I know.

...except that my idea (making my makealiasesrc use the speaks: field)
automates the whole process ... if you're willing to use it, I'm willing
to implement the feature :-)

> > Any other ideas?
> 
> Well, the best general pattern (i.e., not relying on an alias) I've been
> able to come up with is right out of the manual: "~t .*\.jp$".  Problem
> is that a lot of people I know here don't speak, much less read, a word
> of Japanese. :)

Well, here's another problem you just reminded me of: how about if you
detect a .jp guy in the To: field, but there's also a .us guy in the
To: field.  It's more likely that the .jp guy will be able to make sense
of a name written in en_US text than the poor .us guy having a chance
at figuring out anything from the jp_JP name.  However, your hook will
happily send the mail out with your name written in Japanese.  I like
the idea of a custom editor since it'll be able to look at the speaks:
fields of the two (or more) guys, and pick a sensible name for you based
on the list of languages spoken by each recipient.  (Note that doing
this purely with hooks isn't too easy, AFAICT.)

 - 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: pgp2zJkwsqqnO.pgp
Description: PGP signature