Dear Salve, Thomas,
On Wed, Feb 27, 2013 at 08:36:44PM +0100, Thomas Wallrafen wrote:
> Hello once more,
>
> On Wed, Feb 27, 2013 at 08:28:43PM +0100, Thomas Wallrafen wrote:
> > Hej,
> >
> > On Wed, Feb 27, 2013 at 08:14:13PM +0100, Salve Håkedal wrote:
> > > ...
> > > Is it possible to scp an attachment directly from mutt?
> >
A short time ago I posted here a small script which may be useful to
run arbitrary commands on arbitrary attachments. I put the cursor on
the desired attachment and tipe:
| muttfilter filename program [arguments ...]
where filename is the name with which you want to save the attachment
(maybe temporarily) and program is the program or script you want to
run on that file. The arguments are optional. Maybe it can be useful
to run the script that copies to the other machine and runs
openoffice, etc. You could have a different script for each required file type
The script is:
#!/bin/bash
# muttfilter
# to filter from mutt
#first copy standard in to regular file giving some name
# then open with some program using some arguments
#Usage muttfilter name program args
cat - > $1
# Then run command with given arguments on filename
$2 ${@:3} $1
> > Well, you could try at least something like below:
> >
> > macro attach ,p '<pipe-entry>ssh -X user@remotehost "cat - > ~/out.odt;
> > oowriter ~/out.odt"<enter>
> >
> > So you can type ,p upon the attachment and get it opened on the remote
> > host.
> >
> > Obvious drawback is the hard coded program on the remote host - but
> > that should be easily replacable by sth acting dependent upon the file
> > extension.
>
> ok, the latter was rubbish because afaik you will not be able to set
> the file name on the remote host dynamically. However, you could still
> (a) define one macro per file extension or (b) try to use file(1) to
> invoke the right program.
>
> bye,
>
> thomas
--
o
W. Luis Mochán, | tel:(52)(777)329-1734 /<(*)
Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\
Apdo. Postal 48-3, 62251 | (*)/\/ \
Cuernavaca, Morelos, México | [email protected] /\_/\__/
GPG: DD344B85, 2ADC B65A 5499 C2D3 4A3B 93F3 AE20 0F5E DD34 4B85