Re: How to change From: and other headers according to language
On Mon, Dec 01, 2003 at 12:36:41AM -0500, David Yitzchak Cohen wrote:
> 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@xxxxx=3D
> > > > but I get the error that 'h' is not supported in this mode.
[...]
> Those two questions were related. Theoretically, ~h _should_ work
> in that mode, since the header structure is available at that point.
That was my interpretation wrt " reply-hook." "Send-hook," maybe not.
> However, we've noticed some interesting troubles with IMAP at least,
> where the entire message is fetched when trying to match on ~h ... which
I can reaffirm that I do not use IMAP. I use the mailbox format, and
will be replying to a mail in either the default /var/mail/$LOGNAME box
or various mailboxes sorted by procmail. All mailboxes are already on
the local machine.
> > > My original plan had been to add a speaks: field to my aliases file,
> >=20
> > This is what I'm doing now in a way, adding specific From: headers accord=
> ing
> > to "~t" patterns. It works quite well for people I know.
>
> =2E..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 :-)
I have to admit that I do not really understand what you had in mind.
Sorry. Are you saying that Mutt would set certain headers, signature,
etc. based on a sourced "alias" file that would contain a list of
recipient addresses matched with a "language", so-called "speaks: field"?
Sounds like a terrible amount of work, but if it were user friendly I
suspect it would be useful to bi- or multi-lingual Mutt users.
> > 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
>
> 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
It already happened to me. :(
> 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.
I don't understand what you mean by "custom editor".
> (Note that doing
> this purely with hooks isn't too easy, AFAICT.)
I'm beginning to think you are right. At least for me, anyway, country
does not indicate the language. The content-type/charest header would
be fairly close. I will be writing in one or other language depending
on what language the mail is that I am replying to. I will be initiating
a mail in one or other language depending on whom I am writing to. In
either case, I want the From: header and signature to match the language
of the message body.
henry