Re: send-hook auto cc not working,

2009-04-07 Thread Zhengquan Zhang
On Wed, Apr 08, 2009 at 12:59:06AM -0500, Kyle Wheeler wrote:
> On Wednesday, April  8 at 12:26 AM, quoth Zhengquan Zhang:
> >I tried this minimal muttrc
> >
> >set edit_headers=yes
> >
> >set folder="~/.muttmail"
> >set spoolfile=+inbox #+is the shortcut of $FOLDER
> >set postponed=+postponed
> >set record=+sent
> >
> >set mbox_type=Maildir
> >
> >send-hook ccl '~t ccl-t...@ccl.northwestern.edu'"push 
> >',o...@ccl.northwestern.edu'"
> 
> Umm... just to make sure, that's a horrible typo, right? Your 
> send-hook here has two major things wrong with it: first, you have an 
> extraneous "ccl" at the beginning, and second, you need a space 
> between the "~t addr" part and the "push 'stuff'" part.
> 
> Otherwise, I tried that minimal muttrc and it worked fine for me.
> 
> BUT...I will say this: the CC addition did NOT make it into the 
> headers in my editor. That makes sense, of course: by using "push", 
> that command only gets executed after I finish editing the message. So 
> o...@ccl.northwestern.edu only gets added to the CC header after I've 
> finished editing the message and am ready to send it. I never noticed 
Thank you so much Kyle!
I just can not figure out why it does not work.
yes it does not show up in vim but after I quit vim it shows up before I
send the mail.
> the difference before, because I don't use the $edit_headers setting, 
> but... I can see that being confusing.
> 
> I don't know of a way to modify the CC header BEFORE the editor gets 
> it. The only thing I can think of to change this behavior would be to 
> use the value of $editor to send the editor commands that would modify 
> your CC header, such as this:
> 
>  send-hook '~t ccl-t...@ccl.northwestern.edu' \
>  set\ editor="vim +/cc: '+silent! s/cc:/Cc: 
> o...@ccl.northwestern.edu,/' +/^$"
> 
Thanks Thanks Thanks!
Zhengquan

> ~Kyle
> -- 
> I'm sick of following my dreams. I'm just going to ask them where 
> they're going and hook up with them later.
>-- Mitch Hedberg

-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wednesday, April  8 at 12:26 AM, quoth Zhengquan Zhang:
>I tried this minimal muttrc
>
>set edit_headers=yes
>
>set folder="~/.muttmail"
>set spoolfile=+inbox #+is the shortcut of $FOLDER
>set postponed=+postponed
>set record=+sent
>
>set mbox_type=Maildir
>
>send-hook ccl '~t ccl-t...@ccl.northwestern.edu'"push 
>',o...@ccl.northwestern.edu'"

Umm... just to make sure, that's a horrible typo, right? Your 
send-hook here has two major things wrong with it: first, you have an 
extraneous "ccl" at the beginning, and second, you need a space 
between the "~t addr" part and the "push 'stuff'" part.

Otherwise, I tried that minimal muttrc and it worked fine for me.

BUT...I will say this: the CC addition did NOT make it into the 
headers in my editor. That makes sense, of course: by using "push", 
that command only gets executed after I finish editing the message. So 
o...@ccl.northwestern.edu only gets added to the CC header after I've 
finished editing the message and am ready to send it. I never noticed 
the difference before, because I don't use the $edit_headers setting, 
but... I can see that being confusing.

I don't know of a way to modify the CC header BEFORE the editor gets 
it. The only thing I can think of to change this behavior would be to 
use the value of $editor to send the editor commands that would modify 
your CC header, such as this:

 send-hook '~t ccl-t...@ccl.northwestern.edu' \
 set\ editor="vim +/cc: '+silent! s/cc:/Cc: 
o...@ccl.northwestern.edu,/' +/^$"

~Kyle
- -- 
I'm sick of following my dreams. I'm just going to ask them where 
they're going and hook up with them later.
   -- Mitch Hedberg
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAkncPSoACgkQBkIOoMqOI170YwCeMC+CgjrhAc1ElZ/pkCWzC4qI
4goAn0568dFYgyw5QB0iaGngDdAxb4ZY
=uGMr
-END PGP SIGNATURE-


Re: send-hook auto cc not working,

2009-04-07 Thread Zhengquan Zhang
On Tue, Apr 07, 2009 at 11:07:57PM -0500, Kyle Wheeler wrote:
> On Tuesday, April  7 at 04:25 PM, quoth Zhengquan Zhang:
> >> Sounds like mutt didn't recognize the \ at the end of the line. 
> >> (did you leave some extra spaces in there?) Try making them single 
> >> lines. 
> > I made them single line and it still does not work... and it turned 
> > out that I was using an older mutt 1.5.13. Now I upgraded to 1.5.18 
> > and there is no error message.
> 
> Ah! Okay, well, whatever makes it go away. :)
> 
> > But the send-hook still does not work..
> 
> That's really weird. I'm just about out of ideas - that sort of hook 
> works fine for me...
> 
> Is it possible that elsewhere in your muttrc you may be unhooking the 
> hook? e.g. `unhook *` or `unhook send-hook` ?
> 
> ~Kyle

I tried this minimal muttrc

set edit_headers=yes

set folder="~/.muttmail"
set spoolfile=+inbox #+is the shortcut of $FOLDER
set postponed=+postponed
set record=+sent

set mbox_type=Maildir

send-hook ccl '~t ccl-t...@ccl.northwestern.edu'"push 
',o...@ccl.northwestern.edu'"

and it still does not work...

Thanks Kyle for the help all the way,
Zhengquan

 
> -- 
> Never think that war, no matter how necessary, no matter how 
> justified, is not a crime.
> -- Ernest Hemingway

-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday, April  7 at 04:25 PM, quoth Zhengquan Zhang:
>> Sounds like mutt didn't recognize the \ at the end of the line. 
>> (did you leave some extra spaces in there?) Try making them single 
>> lines. 
> I made them single line and it still does not work... and it turned 
> out that I was using an older mutt 1.5.13. Now I upgraded to 1.5.18 
> and there is no error message.

Ah! Okay, well, whatever makes it go away. :)

> But the send-hook still does not work..

That's really weird. I'm just about out of ideas - that sort of hook 
works fine for me...

Is it possible that elsewhere in your muttrc you may be unhooking the 
hook? e.g. `unhook *` or `unhook send-hook` ?

~Kyle
- -- 
Never think that war, no matter how necessary, no matter how 
justified, is not a crime.
-- Ernest Hemingway
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAkncIx0ACgkQBkIOoMqOI14ZXQCgtQmBXxHd0HdWWt/g36a+8yq2
Qv0AoIAGEN5z9aS+alznaGiqt8v47Q2w
=mWbM
-END PGP SIGNATURE-


Re: send-hook auto cc not working,

2009-04-07 Thread Zhengquan Zhang
On Wed, Apr 08, 2009 at 08:13:01AM +0800, bill lam wrote:
> On Tue, 07 Apr 2009, zhang zhengquan wrote:
> > send-hook a...@abc.edu \
> > "push ,o...@abc.eu"
> 
> may be you forget to escape the `.`, eg.
> 
> send-hook a...@abc\\.edu \
> "push ,o...@abc.eu"
I tried this but it is still not working, besides why do we need two
slashes to escape dot?
Thanks,
Zhengquan
> 
> HTH
> 
> -- 
> regards,
> 
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> 唐詩201 皇甫冉  春思
> 鶯啼燕語報新年  馬邑龍堆路幾千  家住層城鄰漢苑  心隨明月到胡天
> 機中錦字論長恨  樓上花枝笑獨眠  為問天戎竇車騎  何時返旆勒燕然

-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread bill lam
On Tue, 07 Apr 2009, zhang zhengquan wrote:
> send-hook a...@abc.edu \
> "push ,o...@abc.eu"

may be you forget to escape the `.`, eg.

send-hook a...@abc\\.edu \
"push ,o...@abc.eu"

HTH

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩201 皇甫冉  春思
鶯啼燕語報新年  馬邑龍堆路幾千  家住層城鄰漢苑  心隨明月到胡天
機中錦字論長恨  樓上花枝笑獨眠  為問天戎竇車騎  何時返旆勒燕然


Re: send-hook auto cc not working,

2009-04-07 Thread Zhengquan Zhang
On Tue, Apr 07, 2009 at 03:52:40PM -0500, Kyle Wheeler wrote:
> On Tuesday, April  7 at 02:47 PM, quoth zhang zhengquan:
> >> When you do not specify a simple pattern operator, mutt uses the 
> >> value
> >> of $default_hook to construct the pattern. I don't know what yours is,
> >> but... the default value of $default_hook is "~f %s !~P | (~P ~C %s)",
> >> but who knows what it is on your system. It's better to be explicit:
> >>
> >>     send-hook '~t a...@abc.edu' \
> >>         "push ',o...@abc.edu'"
> >I put
> >
> >send-hook '~t ccl-t...@ccl.northwestern.edu' \
> >"push ',o...@ccl.northwestern.edu'"
> >
> >send2-hook '~t ccl-t...@ccl.northwestern.edu !~C o...@ccl.northwestern.edu' \
> >"push ',o...@ccl.northwestern.edu'"
> >
> >in my muttrc and when I launch mutt I have
> >Error in /home/zhengquan/.mutt/muttrc, line 51: push
> >',o...@ccl.northwestern.edu': unknown command
> >Error in /home/zhengquan/.mutt/muttrc, line 54: push
> >',o...@ccl.northwestern.edu': unknown command
> 
> Sounds like mutt didn't recognize the \ at the end of the line. (did 
> you leave some extra spaces in there?) Try making them single lines.
I made them single line and it still does not work... and it turned out
that I was using an older mutt 1.5.13. Now I upgraded to 1.5.18 and
there is no error message. But the send-hook still does not work..

I wonder if there are more ways of doing this...?

Thank you very much.
Zhengquan

> 
> ~Kyle
> -- 
> Suppose ye that I am come to give peace on earth? I tell you, Nay; but 
> rather division: For henceforth there shall be five in one house 
> divided, three against two, and two against three. The father shall be 
> divided against the son, and the son against the father; the mother 
> against the daughter, and the daughter against the mother; the mother 
> in law against her daughter in law, and the daughter in law against 
> her mother in law.
>-- Prince of Peace, Jesus Christ (Luke 12:51-53)

-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday, April  7 at 02:47 PM, quoth zhang zhengquan:
>> When you do not specify a simple pattern operator, mutt uses the 
>> value
>> of $default_hook to construct the pattern. I don't know what yours is,
>> but... the default value of $default_hook is "~f %s !~P | (~P ~C %s)",
>> but who knows what it is on your system. It's better to be explicit:
>>
>>     send-hook '~t a...@abc.edu' \
>>         "push ',o...@abc.edu'"
>I put
>
>send-hook '~t ccl-t...@ccl.northwestern.edu' \
>"push ',o...@ccl.northwestern.edu'"
>
>send2-hook '~t ccl-t...@ccl.northwestern.edu !~C o...@ccl.northwestern.edu' \
>"push ',o...@ccl.northwestern.edu'"
>
>in my muttrc and when I launch mutt I have
>Error in /home/zhengquan/.mutt/muttrc, line 51: push
>',o...@ccl.northwestern.edu': unknown command
>Error in /home/zhengquan/.mutt/muttrc, line 54: push
>',o...@ccl.northwestern.edu': unknown command

Sounds like mutt didn't recognize the \ at the end of the line. (did 
you leave some extra spaces in there?) Try making them single lines.

~Kyle
- -- 
Suppose ye that I am come to give peace on earth? I tell you, Nay; but 
rather division: For henceforth there shall be five in one house 
divided, three against two, and two against three. The father shall be 
divided against the son, and the son against the father; the mother 
against the daughter, and the daughter against the mother; the mother 
in law against her daughter in law, and the daughter in law against 
her mother in law.
   -- Prince of Peace, Jesus Christ (Luke 12:51-53)
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAknbvRgACgkQBkIOoMqOI17wQgCeI1/VKXJnn3u+QbY4IJYtQ3ST
14IAnRWFyvBWHOFi6YfrzSwxC4mYuDlS
=MZ4h
-END PGP SIGNATURE-


Re: send-hook auto cc not working,

2009-04-07 Thread zhang zhengquan
and I am using vim as my editor. I don't know if it is related with the
problem.
Thanks,


-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread zhang zhengquan
2009/4/7 Kyle Wheeler :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Tuesday, April  7 at 02:09 PM, quoth zhang zhengquan:
>>I would like to auto cc somebody when I send mail to a recipient
>
> Okay, easy enough.
>
>>I googled and put this in to my send_hooks file
>>
>>send-hook a...@abc.edu \
>>        "push ,o...@abc.eu"
>
> You aren't being explicit about the pattern matching.
>
>>Did I do something wrong here?
>
> When you do not specify a simple pattern operator, mutt uses the value
> of $default_hook to construct the pattern. I don't know what yours is,
> but... the default value of $default_hook is "~f %s !~P | (~P ~C %s)",
> but who knows what it is on your system. It's better to be explicit:
>
>     send-hook '~t a...@abc.edu' \
>         "push ',o...@abc.edu'"
>
> If that doesn't work, try this:
>
>     send2-hook '~t a...@abc.edu !~C o...@abc.edu' \
>         "push ',o...@abc.edu'"
I put

send-hook '~t ccl-t...@ccl.northwestern.edu' \
"push ',o...@ccl.northwestern.edu'"

send2-hook '~t ccl-t...@ccl.northwestern.edu !~C o...@ccl.northwestern.edu' \
"push ',o...@ccl.northwestern.edu'"

in my muttrc and when I launch mutt I have
Error in /home/zhengquan/.mutt/muttrc, line 51: push
',o...@ccl.northwestern.edu': unknown command
Error in /home/zhengquan/.mutt/muttrc, line 54: push
',o...@ccl.northwestern.edu': unknown command

I am running debian sid and mutt
here is output of mutt -v
Mutt 1.5.18 (2008-05-17)
Copyright (C) 1996-2008 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.26-1-686 (i686)
ncurses: ncurses 5.7.20090404 (compiled with 5.7)
libidn: 1.12 (compiled with 1.10)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Aug 27 2008 09:23:18)
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  +USE_SMTP  +USE_GSS  -USE_SSL_OPENSSL
+USE_SSL_GNUTLS  +USE_SASL  +HAVE_GETADDRINFO
+HAVE_REGCOMP  -USE_GNU_REGEX
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME
-EXACT_ADDRESS  -SUN_ATTACHMENT
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS
+HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to .
To report a bug, please visit http://bugs.mutt.org/.

patch-1.5.13.cd.ifdef.2
patch-1.5.13.cd.purge_message.3.4
patch-1.5.13.nt+ab.xtitles.4
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.6.dw.maildir-mtime.1
patch-1.5.8.hr.sensible_browser_position.3


Thanks, Kyle, I don't know what is wrong here..
>
> ~Kyle
> - --
> Patriotism means to stand by the country. It does not mean to stand by
> the President.
>                                                  -- Theodore Roosevelt
> -BEGIN PGP SIGNATURE-
> Comment: Thank you for using encryption!
>
> iEYEARECAAYFAknbqScACgkQBkIOoMqOI17PKgCfY8ACV1jBjabHXppnnr8/fIOS
> kw4AoPazuZy1yuYZz7qUBeqsexRz5iEU
> =76iH
> -END PGP SIGNATURE-
>






-- 
Zhengquan


Re: send-hook auto cc not working,

2009-04-07 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday, April  7 at 02:09 PM, quoth zhang zhengquan:
>I would like to auto cc somebody when I send mail to a recipient

Okay, easy enough.

>I googled and put this in to my send_hooks file
>
>send-hook a...@abc.edu \
>"push ,o...@abc.eu"

You aren't being explicit about the pattern matching.

>Did I do something wrong here?

When you do not specify a simple pattern operator, mutt uses the value 
of $default_hook to construct the pattern. I don't know what yours is, 
but... the default value of $default_hook is "~f %s !~P | (~P ~C %s)", 
but who knows what it is on your system. It's better to be explicit:

 send-hook '~t a...@abc.edu' \
 "push ',o...@abc.edu'"

If that doesn't work, try this:

 send2-hook '~t a...@abc.edu !~C o...@abc.edu' \
 "push ',o...@abc.edu'"

~Kyle
- -- 
Patriotism means to stand by the country. It does not mean to stand by 
the President.
  -- Theodore Roosevelt
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iEYEARECAAYFAknbqScACgkQBkIOoMqOI17PKgCfY8ACV1jBjabHXppnnr8/fIOS
kw4AoPazuZy1yuYZz7qUBeqsexRz5iEU
=76iH
-END PGP SIGNATURE-