Re: set Bcc when To: is not myself

2017-12-26 Thread Patrick Shanahan
* Yubin Ruan  [12-26-17 20:40]:
> On Mon, Dec 18, 2017 at 02:16:22PM +0800, Yubin Ruan wrote:
> > How can I set the Bcc: to myself when To: is not myself?
> > 
> > I try something like this but it does not work:
> > send-hook "!~t ablacktsh...@gmail.com" 'my_hdr Bcc: Yubin Ruan 
> > '
> > 
> > Then I try this and it work when I try to send a fresh email:
> > 
> > send-hook "~t ablacktshirt" 'my_hdr Bcc:'
> > send-hook . 'my_hdr Bcc: Yubin Ruan '
> > 
> > however when I reply to somebody, it does not work. Frustrating! ;-(
> 
> Ah I still cannot figure out why these hook only work at sometime. Maybe I
> just misunderstand the meaning of each hook.
> 
> Anyway, I found a configuration option that can solve my problem neatly:
> 
> set metoo=yes
> 
> Attribute goes to this SO thread:
> https://stackoverflow.com/questions/12924804/mutt-reply-hook-cant-set-cc

back to the books, err docs I guess.  hooks do not all work the same and
some only work under specific conditions and in certain order.

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
Registered Linux User #207535@ http://linuxcounter.net
Photos: http://wahoo.no-ip.org/piwigo   paka @ IRCnet freenode


Re: set Bcc when To: is not myself

2017-12-26 Thread Yubin Ruan
On Mon, Dec 18, 2017 at 02:16:22PM +0800, Yubin Ruan wrote:
> How can I set the Bcc: to myself when To: is not myself?
> 
> I try something like this but it does not work:
> send-hook "!~t ablacktsh...@gmail.com" 'my_hdr Bcc: Yubin Ruan 
> '
> 
> Then I try this and it work when I try to send a fresh email:
> 
> send-hook "~t ablacktshirt" 'my_hdr Bcc:'
> send-hook . 'my_hdr Bcc: Yubin Ruan '
> 
> however when I reply to somebody, it does not work. Frustrating! ;-(

Ah I still cannot figure out why these hook only work at sometime. Maybe I
just misunderstand the meaning of each hook.

Anyway, I found a configuration option that can solve my problem neatly:

set metoo=yes

Attribute goes to this SO thread:
https://stackoverflow.com/questions/12924804/mutt-reply-hook-cant-set-cc

Yubin


Re: reference the folder name in a folder-hook push command

2017-12-26 Thread Yubin Ruan
On Tue, Dec 26, 2017 at 04:23:50PM +0100, Arkadiusz Drabczyk wrote:
> On Tue, Dec 26, 2017 at 06:36:20AM +0800, Yubin Ruan wrote:
> > Hi,
> > 
> > I have a folder hook like this:
> > 
> > folder-hook =somembox 'push "!touch /tmp/\1-touched\n"'
> > 
> > where I would like to create a file "/tmp/somebox-touched" when I select and
> > enter a mailbox. As you can see, \1 here should represent the name of the 
> > mbox
> > (as in many Regex). Is there a way to do this so that I do not have to write
> > rules for all the mbox one by one?
> 
> Like that:
> 
> folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
> set record=$my_oldrecord'
> folder-hook . 'push "!touch /tmp/${my_folder}-touched\n"'

Thanks! I didn't know that ^ represent the current folder name. A greate trick
;-)

Yubin


Re: reference the folder name in a folder-hook push command

2017-12-26 Thread Arkadiusz Drabczyk
On Tue, Dec 26, 2017 at 06:36:20AM +0800, Yubin Ruan wrote:
> Hi,
> 
> I have a folder hook like this:
> 
> folder-hook =somembox 'push "!touch /tmp/\1-touched\n"'
> 
> where I would like to create a file "/tmp/somebox-touched" when I select and
> enter a mailbox. As you can see, \1 here should represent the name of the mbox
> (as in many Regex). Is there a way to do this so that I do not have to write
> rules for all the mbox one by one?

Like that:

folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
set record=$my_oldrecord'
folder-hook . 'push "!touch /tmp/${my_folder}-touched\n"'

-- 
Arkadiusz Drabczyk