send-hooks and save_name

2001-03-08 Thread Rich Lafferty

Hi,

I'm having trouble figuring out how to change the behavior of mutt's
save_name feature.

What I'm trying to do is to get mutt to do the save_name thing, except
instead of having it save in =username, I want it to save in
=work/username if any recipient's address contains "concordia.ca", and
in =personal/username if no recipient's address contains "concordia.ca".

I tried playing with changing the value of "folder" with a send-hook,
but since it doesn't reset immediately after, it mungs up normal
operations (since I still want "folder" to just be "~/mail/").

Is there a straightforward way to do such a thing?

  -Rich

-- 
-- Rich Lafferty ---
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC (514) 848-7625
- [EMAIL PROTECTED] --



Re: send-hooks and save_name

2001-03-08 Thread Gary Johnson

On Thu, Mar 08, 2001 at 11:02:03AM -0500, Rich Lafferty wrote:

 I tried playing with changing the value of "folder" with a send-hook,
 but since it doesn't reset immediately after, it mungs up normal
 operations (since I still want "folder" to just be "~/mail/").
 
 Is there a straightforward way to do such a thing?

If your send-hooks work except for the resetting problem, the solution
is easy.  Just add the following lint to your muttrc _above_ the other
send-hooks so that it will be executed before the others.

send-hook . 'set folder=~/Mail'

Gary

-- 
Gary Johnson   | Agilent Technologies
[EMAIL PROTECTED]   | RF Communications PGU
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA



Re: send-hooks and save_name

2001-03-08 Thread Rich Lafferty

On Thu, Mar 08, 2001 at 08:14:49AM -0800, Gary Johnson ([EMAIL PROTECTED]) 
wrote:
 On Thu, Mar 08, 2001 at 11:02:03AM -0500, Rich Lafferty wrote:
 
  I tried playing with changing the value of "folder" with a send-hook,
  but since it doesn't reset immediately after, it mungs up normal
  operations (since I still want "folder" to just be "~/mail/").
  
  Is there a straightforward way to do such a thing?
 
 If your send-hooks work except for the resetting problem, the solution
 is easy.  Just add the following lint to your muttrc _above_ the other
 send-hooks so that it will be executed before the others.
 
 send-hook . 'set folder=~/Mail'

Well, with that I end up with
 
  send-hook . 'set folder=~/Mail'
  send-hook concordia.ca 'set folder=~/Mail/conu'
  send-hook !concordia.ca 'set folder=~/Mail/personal'

and, as you can see, that first condition never happens. :-) But this
helped me realize what the problem is -- with your default send-hook,
it resets "folder" as soon as I go to *send* again. What I need is for
"folder" to be set as I go to send, and to be reset to "~/Mail/" as
soon as the message I'm sending is on its way.

Hrm. This gets me very close:

  folder-hook . 'set folder=~/mail'
  send-hook concordia.ca 'set folder=~/mail/conu'
  send-hook !concordia.ca 'set folder=~/mail/personal'

except that going from the send screen to the index doesn't trigger a
folder-hook. (That'd be handy if it did, though, wishlist folks.)

I'm beginning to think that there *is* no hook that takes place after
a message is sent, so I can't think of any way to improve on the
above.

   -Rich

-- 
-- Rich Lafferty ---
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC (514) 848-7625
- [EMAIL PROTECTED] --



Re: send-hooks and save_name

2001-03-08 Thread Peter Kovacs

On Thu, Mar 08, 2001 at 11:29:23AM -0500, Rich Lafferty wrote:
   folder-hook . 'set folder=~/mail'
   send-hook concordia.ca 'set folder=~/mail/conu'
   send-hook !concordia.ca 'set folder=~/mail/personal'
 
how about:
send-hook . 'set folder=~/mail/personal'
send-hook concordia.ca 'set folder=~/mail/conu'


Peter

-- 
Peter D. Kovacs [EMAIL PROTECTED]
Software Developer
Webmachines, Inc. http://webmachines.com



Re: send-hooks and save_name

2001-03-08 Thread Rich Lafferty

On Thu, Mar 08, 2001 at 11:47:00AM -0500, Peter Kovacs ([EMAIL PROTECTED]) wrote:
 On Thu, Mar 08, 2001 at 11:29:23AM -0500, Rich Lafferty wrote:
folder-hook . 'set folder=~/mail'
send-hook concordia.ca 'set folder=~/mail/conu'
send-hook !concordia.ca 'set folder=~/mail/personal'
  
 how about:
   send-hook . 'set folder=~/mail/personal'
   send-hook concordia.ca 'set folder=~/mail/conu'

I think I'm actually going to have to just actively set Fcc as I
go. The problem with your suggestion is that with that the folder is
*never* reset to ~/mail, and I've a lot more subdirectories than just
conu/ and personal/ (it's just that those two are the only ones I'd
want mail *automagically* saved into).

  -Rich

-- 
-- Rich Lafferty ---
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC (514) 848-7625
- [EMAIL PROTECTED] --



Re: send-hooks and save_name

2001-03-08 Thread Ben Rosenberg

How about using Procmail rules to put your mail where you like?

* Rich Lafferty ([EMAIL PROTECTED]) [010308 08:56]:
=On Thu, Mar 08, 2001 at 11:47:00AM -0500, Peter Kovacs ([EMAIL PROTECTED]) wrote:
= On Thu, Mar 08, 2001 at 11:29:23AM -0500, Rich Lafferty wrote:
=folder-hook . 'set folder=~/mail'
=send-hook concordia.ca 'set folder=~/mail/conu'
=send-hook !concordia.ca 'set folder=~/mail/personal'
=  
= how about:
= send-hook . 'set folder=~/mail/personal'
= send-hook concordia.ca 'set folder=~/mail/conu'
=
=I think I'm actually going to have to just actively set Fcc as I
=go. The problem with your suggestion is that with that the folder is
=*never* reset to ~/mail, and I've a lot more subdirectories than just
=conu/ and personal/ (it's just that those two are the only ones I'd
=want mail *automagically* saved into).
=

-- 
Ben Rosenberg
mailto:[EMAIL PROTECTED]
-
If two men agree on everything, you can
be sure that only one of them is doing
the thinking.



Re: send-hooks and save_name

2001-03-08 Thread Gary Johnson

On Thu, Mar 08, 2001 at 11:29:23AM -0500, Rich Lafferty wrote:

 Well, with that I end up with
  
   send-hook . 'set folder=~/Mail'
   send-hook concordia.ca 'set folder=~/Mail/conu'
   send-hook !concordia.ca 'set folder=~/Mail/personal'
 
 and, as you can see, that first condition never happens. :-) But this
 helped me realize what the problem is -- with your default send-hook,
 it resets "folder" as soon as I go to *send* again. What I need is for
 "folder" to be set as I go to send, and to be reset to "~/Mail/" as

 I'm beginning to think that there *is* no hook that takes place after
 a message is sent, so I can't think of any way to improve on the
 above.

OK, now I think I understand the problem.  I can't think of any hooks
that work the way you want, either.  I did think of something else that
might work, though.

macro compose y "send-message:push :set folder=~/Mail"

I have not tried that to see if it actually works.  One problem with
this approach is that you really need to create such macros for every
command that leaves the compose menu, such as 'q' and 'P', and such a
macro for 'q' would not work if 'postpone' was set to 'ask-yes' or
'ask-no'.

Gary

-- 
Gary Johnson   | Agilent Technologies
[EMAIL PROTECTED]   | RF Communications PGU
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA