Re: Correct syntax of send hook

2014-05-09 Thread Jean-Rene David
* Guy Gold [2014.05.09 15:43]:
> If,"  vim -c ':r /path/to/file' " is used, what happens in mutt
> is, vim gets two files to edit, "/path/to/file" and
> /tmp/mutt-muttfile.being.edited.

Not at all. Did you try it?

You would have two files to edit if you did:

vim -c ":e /path/to/file"

or

vim /path/to/file

But not with:

vim -c ":r /path/to/file"

> I'm still far from solving this issue though, the initial !cat
> works fine now, however- if I :wq from the editor into the 'ready
> to send' screen in mutt, (where the From: and Subject: can be
> edited), and, then I choose to go back an re-edit my email, the
> !cat action takes place again - and that's not desired. 

Maybe have a different mapping for 'e' in the
index versus the compose menu?

-- 
JR


Re: Correct syntax of send hook

2014-05-09 Thread Guy Gold
On Fri,May 09 03:14:PM, Jean-Rene David wrote:
> * Guy Gold [2014.05.09 13:58]:
> > send-hook '~t...@domain.com'  'set editor= "vim  -c \":r \!cat  
> > /path/to/file\""'
> 
> Is it me or is this a useless use of cat?
> 
> vim -c ':r !cat /path/to/file' <=> vim -c ':r /path/to/file'

Yes, and no. 
While issuing this command from the shell itself, or from vim
itself does not call for !cat, using this in a send-hook left me
no choice but to use !cat. 
If,"  vim -c ':r /path/to/file' " is used, what happens in mutt
is, vim gets two files to edit, "/path/to/file" and
/tmp/mutt-muttfile.being.edited. That , creates a mess of itself. 

I'm still far from solving this issue though, the initial !cat
works fine now, however- if I :wq from the editor into the 'ready
to send' screen in mutt, (where the From: and Subject: can be
edited), and, then I choose to go back an re-edit my email, the
!cat action takes place again - and that's not desired. 

-- 

GG


Re: Correct syntax of send hook

2014-05-09 Thread Jean-Rene David
* Guy Gold [2014.05.09 13:58]:
> send-hook '~t...@domain.com'  'set editor= "vim  -c \":r \!cat  
> /path/to/file\""'

Is it me or is this a useless use of cat?

vim -c ':r !cat /path/to/file' <=> vim -c ':r /path/to/file'

-- 
JR


Re: Correct syntax of send hook

2014-05-09 Thread Guy Gold
On Fri,May 09 02:58:PM, Suvayu Ali wrote:
> 
> In my experience, I found it is easier to escape nested quotes instead
> of mixing multiple types of quotes.  Maybe you can replace the single
> quotes with escaped double quotes.  You might also need to quote the
> whole "set editor=..." bit.

Thank you.
Double quoiting and escaping did it right. Here's the exact way it is now,
in .muttrc :

send-hook '~t...@domain.com'  'set editor= "vim  -c \":r \!cat  
/path/to/file\""'

-- 

GG


Re: disabling shell-escape

2014-05-09 Thread David Champion
* On 09 May 2014, Shawn Zaidermann wrote: 
> Is there a way to completely disable the shell-escape feature?

You can unbind the key (or bind it to no-op), but the user can still
rebind it unless you also remove the enter-command binding (preventing
them from entering a bind command).  Also ensure that they cannot source
any muttrc files (check bindings for source macros), and cannot edit any
muttrc files that the program is sourcing.  Your use case might help to
answer more exactly.

To avoid this complexity, source code changes are the only option.
There is no irreversible "restricted" mode that does all this
automatically.

-- 
David Champion • d...@bikeshed.us


Re: Are there arguments to the pipe command

2014-05-09 Thread ss
On Fri, May 09, 2014 at 11:38:24AM +0200, s...@thetabiz.com wrote:
> I am thinking of something like: |process_email.pl %from %to %subject

That question of me, relates to piping the attachment rather, not a
whole message.



Re: Correct syntax of send hook

2014-05-09 Thread Suvayu Ali
Hi Guy,

On Thu, May 08, 2014 at 06:37:21PM -0400, Guy Gold wrote:
> 
> The usage of  "-c ':r !cat /tmp/file'" does solve the issue of
> editing two files, but, I cannot seem to get the send-hook correct,
> and depending on how/where I place my quotes, I get different
> errors. -
> Which is troubling, because I do have other send-hooks defined
> and working well. 

In my experience, I found it is easier to escape nested quotes instead
of mixing multiple types of quotes.  Maybe you can replace the single
quotes with escaped double quotes.  You might also need to quote the
whole "set editor=..." bit.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.


disabling shell-escape

2014-05-09 Thread Shawn Zaidermann

Is there a way to completely disable the shell-escape feature?


Are there arguments to the pipe command

2014-05-09 Thread ss
Hello to all,

I am constructing a mutt macro which shall pipe the text/plain message
to a script that processes the markdown formatting and inserts the HTML
output into the HTML template. This so far works well.

However, it would be beneficial to get an option to pipe with the
arguments such as $from_email or $from_name, $subject and $to_name

I am thinking of something like: |process_email.pl %from %to %subject

If anyone has an idea how to implement that on the pipe, let me know.

Thank you,
Raul