Discussion:
How-to access any email headers from reply-hook or attribution / whatever ?
(too old to reply)
Gugus
2016-06-23 08:32:30 UTC
Permalink
Hi all,

I’m trying to setup some random attribution at every reply I’m doing with mutt.

Actually, I’ve got this line on my ~/.muttrc :

set attribution="`~/.mutt/citations.sh`\n"

Where citations.sh is a simple shellscript which will issue a random
string with $index_format escape sequences.
It works well.

Until then, some of these sequences where computed during the call of
the script, to add some funny weather description of the day, f.e.
The problem is, this weather description only matches the *current*
weather, not the weather at the time the mail was sent.
F.e., if I’m answering an email sent 2 weeks ago, when the weather was
sunny, but it’s actually rainy, it would give me some attribution like :

"On this rainy %[%d %M %Y], %n said :"

but i would it being :

"On this sunny %[%d %M %Y], %n said :"



So, 1st problem was to store, in some way, the "real" weather (well, of
course, it’s only the weather of my home place, but maybe later... ;)),
which matches the e-mail receival.
This has been simply done with the help of procmail, adding some X-
header field with a simple string giving the weather description.

But now, I’m stuck with mutt : how could I extract this X- header
*prior* the call to my “citations.sh” shellscript ? I guess yes, by
giving the escape sequence inside the backticks. But which one ?
-Or-, I thought about a second solution : is there a way , from my
citations.sh shellscript, to access the contents (header+body) of the
mail I’m currently replying to ? I’ve not found any $index_format escape
sequence which would give me such a thing... (I’m working with Maildir
folders)

Any help appreciated.

Br,
--
Gugus [http://what.dafuq.it/]
Gugus
2016-06-23 08:38:06 UTC
Permalink
Post by Gugus
But now, I’m stuck with mutt : how could I extract this X- header
*prior* the call to my “citations.sh” shellscript ? I guess yes, by
giving the escape sequence inside the backticks.
Just tested,
and wrong guess, escape sequences are not expanded inside backticks ;(
--
Gugus [http://what.dafuq.it/]
Loading...