Discussion:
Mutt -> Compose -> Some kind of alert?
Alex Sa
2018-10-05 02:43:22 UTC
Permalink
Hi!


When replying to some certain emails, I
usually have to add other recipients to
the list. But unfortunately, I often
forget to do so.

Thus, my question: is it possible that
after leaving the editor and arriving at
Mutt's Compose section (where you can
actually add someone with t or c
hotkeys), there would appear some kind
of additional message in the status
line? Or [dependent on the recipients
list] some script could be launched?
Or any other idea that jumps to you?
Something with the hooks may be? (Not
that I know much about them.)

Would be grateful for any hint here :)

(I already tried to play with the editor
itself, to launch an external script
when leaving it. But it gets very noisy
-- and I need this kind of reminder only
if contacting certain people, actually,
and I can't add them blindly or always,
too).

Thanks!



--
Alex
Patrick Shanahan
2018-10-05 02:56:15 UTC
Permalink
Hi!
When replying to some certain emails, I usually have to add other
recipients to the list. But unfortunately, I often forget to do so.
Thus, my question: is it possible that after leaving the editor and
arriving at Mutt's Compose section (where you can actually add someone
with t or c hotkeys), there would appear some kind of additional message
in the status line? Or [dependent on the recipients list] some script
could be launched? Or any other idea that jumps to you? Something with
the hooks may be? (Not that I know much about them.)
Would be grateful for any hint here :)
(I already tried to play with the editor itself, to launch an external
script when leaving it. But it gets very noisy -- and I need this kind
of reminder only if contacting certain people, actually, and I can't add
them blindly or always, too).
you can add recipients (to "t", copy "c" and bcc "b") after leaving the
editor but before sending the msg.

reading the very fine manual might help *and* there is a help screen after
leaving the editor.

if you have already send the message, you can resend an ammended msg to
the missing recipients.

if that doesn't answer your question, I don't understand as you have
presented it.
--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Registered Linux User #207535 @ http://linuxcounter.net
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode
Alex Sa
2018-10-05 03:13:31 UTC
Permalink
Post by Patrick Shanahan
you can add recipients (to "t", copy
"c" and bcc "b") after leaving the
editor but before sending the msg.
*When* you arrive at this point, when
you leave the editor but before sending
the msg (like shown on this pic:
Loading Image...), is it
possible to produce some kind of alert
(like :echomsg command in Vim, for
example) or to launch an external script
dependent on the list of recipients?
--
Alex
Timothy Rice
2018-10-05 03:46:48 UTC
Permalink
Hi Alex,
Post by Alex Sa
*When* you arrive at this point, when
you leave the editor but before sending
https://i.imgur.com/cjqMrl3.png), is it
possible to produce some kind of alert
(like :echomsg command in Vim, for
example) or to launch an external script
dependent on the list of recipients?
I think what you are asking is, if the To: field matches a particular
pattern, then can the CC: field by populated automatically?

If you would be content to have all the CC: parties go into the To: field,
then this can be handled quite simply using aliases, like so:

alias my.serious.group Very Important Person 1 <***@example.com>, \
Very Important Other Person <***@example.com>, \
Very Important Third Person <***@example.com>

Then when you send email to my.serious.group, the To: field will be
immediately populated with the three individual email addresses.

(This accepts recursive aliases, that is, each person can have their own
alias defined before the group alias.)

~ Tim
Alex Sa
2018-10-05 04:15:57 UTC
Permalink
Post by Timothy Rice
I think what you are asking is, if the To: field matches a particular
pattern, then can the CC: field by populated automatically?
No, Timothy :)

As I've said in my initial question, "I can't add them blindly or
always". I just want to be reminded (in some way) to include Z and Y
if my email is addressed to X.

I don't really know if it's possible (probably, not) but I imagine it this way:

OPTION A) Upon leaving the editor and coming back to Mutt, to its
Compose section (this one: https://i.imgur.com/cjqMrl3.png), Mutt
notices Person X in the To: field and launches an external script (I
assume there is no internal command to echo some message to the status
line or some text popup, right?).

OR OPTION B) As soon as I press Reply to an email from Person X
(before entering the editor), Mutt launches an external script (I
probably can create a macro like "!my-alert-script Add Y,
Z<Enter><mail>x<Enter>" for composing a new email, but what about
replying?)

I hope it's a bit clearer now :)

And thanks for your help and interest anyway :).
--
Alex
David Woodfall
2018-10-05 04:42:51 UTC
Permalink
On Friday 5 October 2018 07:15,
Post by Alex Sa
Post by Timothy Rice
I think what you are asking is, if the To: field matches a particular
pattern, then can the CC: field by populated automatically?
No, Timothy :)
As I've said in my initial question, "I can't add them blindly or
always". I just want to be reminded (in some way) to include Z and Y
if my email is addressed to X.
OPTION A) Upon leaving the editor and coming back to Mutt, to its
Compose section (this one: https://i.imgur.com/cjqMrl3.png), Mutt
notices Person X in the To: field and launches an external script (I
assume there is no internal command to echo some message to the status
line or some text popup, right?).
OR OPTION B) As soon as I press Reply to an email from Person X
(before entering the editor), Mutt launches an external script (I
probably can create a macro like "!my-alert-script Add Y,
Z<Enter><mail>x<Enter>" for composing a new email, but what about
replying?)
I hope it's a bit clearer now :)
And thanks for your help and interest anyway :).
--
Alex
Why not put that in your editor itself? If you use vim for example,
instead of putting all the vim options in mutt's 'editor' variable,
create a 'Mailer' function in your ~/.vimrc or another file that vim
uses, and then use "vim +':call Mailer()' %s" as editor. That way you
can put an alert or whatever you like at the end of the function and
use vim's 'echomsg' or perhaps have it stop and wait for input before
exiting.

--
Dave

"I know the answer! The answer lies within the heart of all mankind!
The answer is twelve? I think I'm in the wrong building."
-- Charles Schulz

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
John Hawkinson
2018-10-05 04:16:31 UTC
Permalink
Post by Alex Sa
When replying to some certain emails, I
usually have to add other recipients to
the list. But unfortunately, I often
forget to do so.
I suggest you

set edit_headers

such that the recipient fields are available while you are editing the message. I do also have a macro:

macro index ,h ":toggle edit_headers\n:set ?edit_headers\n" "toggle edit_headers"

So I can turn on and off header-editing, although I'm struggling to remember why that's useful thing to do...I almost always have it on. Maybe when replying to messages with hundreds or thousands of recipients...

--***@mit.edu
John Hawkinson
Alex Sa
2018-10-05 04:40:03 UTC
Permalink
Post by John Hawkinson
I suggest you
set edit_headers
Now, that's something! Thanks, John!

For those, who are interested: because of email addresses present in
the editor while editing the message, in Vim, I can create something
like that (in $VIMHOME/ftdetect/mail.vim):

autocmd BufEnter *mutt-MyMachine* call BeAware()
function BeAware()
if search('***@gmail.com')
!alert 'Add Y, Z'
endif
endfunction

Which will alert me if this specific string '***@gmail.com' will
be present in the buffer.

Looks pretty nice :).
--
Alex
Loading...