Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-25 Thread Patrick Schoenfeld
Hey Karl,

it may have sounded arrogant, but indeed it wasn't intended to sound
that. But...

On Thu, Oct 25, 2007 at 10:35:31AM +1300, Karl. wrote:
> Given that you asked for advice, perhaps you should work on accepting 
> all advice _graciously_, rather than being arrogant?  You'll find it a 

You are right. Given that I'm the one searching for advise, I should not
bite into the hand of people that could probably give it to me. But I
didn't think that I do, because in my opinion I just told him, that the
requested information is already there (and I confirmed it with my first
reply to him). Given that I needed to confirm it a second time to him,
my reply was a bit rude, yes, and I'm sorry for that.

> The list archives are littered with examples of people declaring that "I 
> have done exactly what you told me to do" and then finding out that they 
> had not.  His request was entirely reasonable.  Your response just puts 

IMHO that case is different from the current case.

1) I wasn't following an advice to set it executable, but checked it
myself before I've written the help request.

2) I already indicated twice that I checked it (and after telling it a
second time, one should be sure that I really did it and not just tell
it).

So IMHO his first request was just a sign that he does not trust me that
I am telling the truth (but maybe reasonable), but his second request
wasn't reasonable anymore.

> you higher on the list of people who are not worth responding to (unless 
> it's amusing to  :-)

I know that *I* were searching for advice and therefore should provide
verbose informations to avoid unneccesary effort on the side of someone
who could help me. But the other way round is true. Just because I'm
asking for help I'm not forced to accept _all_ conditions and _wasting_
_my_ time w/o sense do I not have to accept. Off course you are write
that it could mean that I won't get help. Thats bitter, but unavoidable.

Best Regards,
Patrick


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-25 Thread Karl.
On Wed, Oct 24, 2007 at 09:37:34PM +0200, Patrick Schoenfeld wrote:
> On Wed, Oct 24, 2007 at 01:39:17PM -0400, Patrick Shanahan wrote:
> > ls -la ~/.mutt/return_receipt
> 
> You should work on you ability to _read_ mails others write _properly_.

Given that you asked for advice, perhaps you should work on accepting 
all advice _graciously_, rather than being arrogant?  You'll find it a 
lot more productive, even if sometimes you find yourself supplying 
information that you think is unnecessary.

> I told you, that the file _is_ executable.

The list archives are littered with examples of people declaring that "I 
have done exactly what you told me to do" and then finding out that they 
had not.  His request was entirely reasonable.  Your response just puts 
you higher on the list of people who are not worth responding to (unless 
it's amusing to  :-)

Karl.
-- 
webpage of the day: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-24 Thread Patrick Schoenfeld
On Wed, Oct 24, 2007 at 01:39:17PM -0400, Patrick Shanahan wrote:
> ls -la ~/.mutt/return_receipt

You should work on you ability to _read_ mails others write _properly_.
I told you, that the file _is_ executable. And as you eventually noticed
someone else already pointed the right solution out to me, which were
not a missing executable flag.

-Patrick


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-24 Thread Patrick Shanahan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Patrick Schoenfeld <[EMAIL PROTECTED]> [10-24-07 11:01]:
> On Wed, Oct 24, 2007 at 04:53:23PM +0200, Patrick Schoenfeld wrote:
> > What information do you expect me to presentate? Eventually my whole mutt
> > configuration just to ask why one specific message-hook (which I 
> > presentated)
> > is not working?
> 
> There is only one information that I see that I really missed to presentate:
> 
> [EMAIL PROTECTED] ~ % mutt -v
> Mutt 1.5.16 (2007-06-11)

ls -la ~/.mutt/return_receipt


- -- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn4472 (GNU/Linux)

iD8DBQFHH4NEClSjbQz1U5oRAjceAJ4pOlmi7x1qRmA272w2bSVtP6XHwgCdHGKT
0PpyO/5MVyxTTnGMcFRy2No=
=AO9N
-END PGP SIGNATURE-


Re: Howto run a command in message hooks

2007-10-24 Thread Rado S
=- Patrick Schoenfeld wrote on Wed 24.Oct'07 at 17:18:54 +0200 -=

> and waits for an input ("read yn"), but mutt adds its "Press any
> key to continue...". So it seems that mutt already answers the
> question (what it shouldn't do). Also if I do press return to that
> question, it restarts the script and the game starts from the
> beginning. Endless, until i somehow force it to quit (not that
> easy).

As you've already learned, script doesn't wait for your input, it
already got it from STDIN (EOT). What you see is only the prompt
echo thrown into your regular mutt screen, while it actually already
has returned to mutt. When you press  again, why should it be
any different from your first execution? Use q or x to see the
difference.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-24 Thread Rado S
=- Patrick Schoenfeld wrote on Wed 24.Oct'07 at 16:40:33 +0200 -=

> Why? According to what I read this works for macros, why shouldn't
> it work for message hooks?

Because macros operate on functions, while hooks operate on muttrc
commands. See http://WIKI.mutt.org/ -> MuttGuide -> Syntax for
details.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.


Re: Howto run a command in message hooks

2007-10-24 Thread Dave Evans
On Wed, Oct 24, 2007 at 05:38:55PM +0200, Patrick Schoenfeld wrote:
> On Wed, Oct 24, 2007 at 05:30:45PM +0200, Christian Brabandt wrote:
> > If you have used  I think your stdin has changed to the
> > messages you piped. And read expects your answer from that filehandle.
> > So you might try explicitly setting your tty with read yn  
> Okay, that might be an explanation why it does immedetiately print those
> mutt press any key message (btw. is it possible to suppress this message
> when calling the script?), but why does it recall and recall the script
> endlessly?

Just a guess, but maybe after running an external script, mutt re-runs the
hooks; after all, it is still "Before  mutt  displays (or formats for replying
or forwarding) a message".  The muttrc man page, at least, is not very
specific (AFAICT) about when the hooks get run.

In any case you'll presumably want some way of /not/ prompting the user to
send the receipt if one has already been sent for this message; ideally some
way that's "built in" to mutt, i.e. doesn't require an external script.

-- 
Dave Evans
http://djce.org.uk/
http://djce.org.uk/pgpkey


signature.asc
Description: Digital signature


Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:

> On Wed, Oct 24, 2007 at 05:30:45PM +0200, Christian Brabandt wrote:
> > If you have used  I think your stdin has changed to the
> > messages you piped. And read expects your answer from that filehandle.
> > So you might try explicitly setting your tty with read yn  
> Okay, that might be an explanation why it does immedetiately print those
> mutt press any key message (btw. is it possible to suppress this message
> when calling the script?), 

set wait_key=no

> but why does it recall and recall the script endlessly?

I don't know.

regards,
Christian
-- 
Everything can be filed under "miscellaneous".


Re: Howto run a command in message hooks

2007-10-24 Thread Patrick Schoenfeld
On Wed, Oct 24, 2007 at 05:30:45PM +0200, Christian Brabandt wrote:
> If you have used  I think your stdin has changed to the
> messages you piped. And read expects your answer from that filehandle.
> So you might try explicitly setting your tty with read yn 

Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:

> On Wed, Oct 24, 2007 at 04:56:13PM +0200, Christian Brabandt wrote:
> > Do you mind formating your message with a width < 80 chars?
> 
> no, thats no problem.
> 
> > Depending on what your want try either  or 
> 
> Hm. That and what Dave Evans wrote works, at least partially. Now the
> script is launched, but it does not work as expected.  It starts the
> script which outputs:
> 
> User has asked for a return receipt. Send one? ([yes]/no): 
> 
> and waits for an input ("read yn"), but mutt adds its "Press any key to
> continue...". So it seems that mutt already answers the question (what
> it shouldn't do). Also if I do press return to that question, it
> restarts the script and the game starts from the beginning. Endless,
> until i somehow force it to quit (not that easy).
> 
> The (for now very basic script):
> #!/bin/sh
> 
> TEMP="`mktemp`"
> trap "rm -f $TEMP" INT ABRT EXIT
> tee > $TEMP
> 
> QUESTION="User has asked for a return receipt. Send one? ([yes]/no): "
> echo -n $QUESTION
> read yn
> 
> (I know that this is far from beeing complete, but to test how things
> would work it is enough)

If you have used  I think your stdin has changed to the
messages you piped. And read expects your answer from that filehandle.
So you might try explicitly setting your tty with read yn 

Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

Do you mind formating your message with a width < 80 chars?

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:
> I want to write a script that _asks_ the user, if he wants to send a
> return receipt (note how that differs from your assumption that a
> macro would be suffice. For me it wouldn't because w/o the question
> _I_ would forget to send the return receipt). Something like this
> can automatically be triggered only by message hooks. But as the
> solution is extern (= a script), how do i call it from within the
> message hook? I added a hook like this:
> 
> message-hook "~h Return-Receipt-To:"
> "|/home/schoenfeld/.mutt/return_receipt"
> 
> And even though the specified file is a valid executable script mutt
> says (when I open this mail in the pager):
> 
> |/home/schoenfeld/.mutt/return_receipt: Unknown command

Depending on what your want try either  or 


regards,
Christian
-- 
f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng


Re: Howto run a command in message hooks

2007-10-24 Thread Patrick Schoenfeld
Hi Christian,

On Wed, Oct 24, 2007 at 04:56:13PM +0200, Christian Brabandt wrote:
> Do you mind formating your message with a width < 80 chars?

no, thats no problem.

> Depending on what your want try either  or 

Hm. That and what Dave Evans wrote works, at least partially. Now the
script is launched, but it does not work as expected.  It starts the
script which outputs:

User has asked for a return receipt. Send one? ([yes]/no): 

and waits for an input ("read yn"), but mutt adds its "Press any key to
continue...". So it seems that mutt already answers the question (what
it shouldn't do). Also if I do press return to that question, it
restarts the script and the game starts from the beginning. Endless,
until i somehow force it to quit (not that easy).

The (for now very basic script):
#!/bin/sh

TEMP="`mktemp`"
trap "rm -f $TEMP" INT ABRT EXIT
tee > $TEMP

QUESTION="User has asked for a return receipt. Send one? ([yes]/no): "
echo -n $QUESTION
read yn

(I know that this is far from beeing complete, but to test how things
would work it is enough)

Any hints?

Regards,
Patrick


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-24 Thread Patrick Schoenfeld
On Wed, Oct 24, 2007 at 04:53:23PM +0200, Patrick Schoenfeld wrote:
> What information do you expect me to presentate? Eventually my whole mutt
> configuration just to ask why one specific message-hook (which I presentated)
> is not working?

There is only one information that I see that I really missed to presentate:

[EMAIL PROTECTED] ~ % mutt -v
Mutt 1.5.16 (2007-06-11)

-Patrick


Re: Howto run a command in message hooks

2007-10-24 Thread Dave Evans
On Wed, Oct 24, 2007 at 04:40:33PM +0200, Patrick Schoenfeld wrote:
> message-hook "~h Return-Receipt-To:" "|/home/schoenfeld/.mutt/return_receipt"
> 
> And even though the specified file is a valid executable script mutt says 
> (when
> I open this mail in the pager):
> 
> |/home/schoenfeld/.mutt/return_receipt: Unknown command

I don't think there is a mutt command called
"|/home/schoenfeld/.mutt/return_receipt".  Maybe you wanted the "push"
command?

-- 
Dave Evans
http://djce.org.uk/
http://djce.org.uk/pgpkey


signature.asc
Description: Digital signature


Re: Howto run a command in message hooks (was: Re: How to send a

2007-10-24 Thread Patrick Schoenfeld
On Wed, Oct 24, 2007 at 10:47:58AM -0400, Patrick Shanahan wrote:
> * Patrick Schoenfeld <[EMAIL PROTECTED]> [10-24-07 10:42]:
> > And even though the specified file is a valid executable script mutt says 
> > (when
> > I open this mail in the pager):
>
> first *guess* w/b that ~/.mutt/return_receipt script was not

Whats so hard to understand about ".. is a valid executable script .. "?

> executable, but you have really presented little information.

What information do you expect me to presentate? Eventually my whole mutt
configuration just to ask why one specific message-hook (which I presentated)
is not working?

-Patrick


Re: Howto run a command in message hooks (was: Re: How to send a return receipt)

2007-10-24 Thread Patrick Shanahan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Patrick Schoenfeld <[EMAIL PROTECTED]> [10-24-07 10:42]:
> I want to write a script that _asks_ the user, if he wants to send a return
> receipt (note how that differs from your assumption that a macro would be
> suffice. For me it wouldn't because w/o the question _I_ would forget to send
> the return receipt). Something like this can automatically be triggered only 
> by message
> hooks. But as the solution is extern (= a script), how do i call it from 
> within
> the message hook? I added a hook like this:
> 
> message-hook "~h Return-Receipt-To:" "|/home/schoenfeld/.mutt/return_receipt"
> 
> And even though the specified file is a valid executable script mutt says 
> (when
> I open this mail in the pager):
> 
> |/home/schoenfeld/.mutt/return_receipt: Unknown command

first *guess* w/b that ~/.mutt/return_receipt script was not
executable, but you have really presented little information.
- -- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn4472 (GNU/Linux)

iD8DBQFHH1sdClSjbQz1U5oRAoShAJ0RkvztBrLo1jW8fqfKCWtR1EgaaQCgpm9x
7rhYW+Z8Cfdy2Tku3GQovZU=
=uIe1
-END PGP SIGNATURE-


Howto run a command in message hooks (was: Re: How to send a return receipt)

2007-10-24 Thread Patrick Schoenfeld
Hi,

as it does not seem to be integrated into mutt upstream (at least not in
a forseeable timeline) I'm currently trying to
figure who a scripted solution to my problem would look like.

On Tue, Oct 23, 2007 at 06:14:48PM +0200, Rado S wrote:
> It appears complex to you, but in fact it _is_ simple.

If thats true, then the problem I am currently stuck on should be fairly simple
to solve. So some explanations, then my question:

I want to write a script that _asks_ the user, if he wants to send a return
receipt (note how that differs from your assumption that a macro would be
suffice. For me it wouldn't because w/o the question _I_ would forget to send
the return receipt). Something like this can automatically be triggered only by 
message
hooks. But as the solution is extern (= a script), how do i call it from within
the message hook? I added a hook like this:

message-hook "~h Return-Receipt-To:" "|/home/schoenfeld/.mutt/return_receipt"

And even though the specified file is a valid executable script mutt says (when
I open this mail in the pager):

|/home/schoenfeld/.mutt/return_receipt: Unknown command

Why? According to what I read this works for macros, why shouldn't it work for
message hooks?

Regards
Patrick