Re: unset folder-hook

2023-07-17 Thread Ed Blackman
On Mon, Jul 17, 2023 at 07:02:34AM -0500, Ranjan Maitra wrote:
> On Sun Jul16'23 10:03:01PM, Ed Blackman wrote:
> > In my .muttrc I have:
> >
> > # Set $strict_threads in large mailboxes (which are likely to have 
> > duplicated subjects)
> > folder-hook .   set strict_threads=no
> > folder-hook =sent   set strict_threads=yes
> > folder-hook =.archive*  set strict_threads=yes
> 
> Thanks very much for this, however, I get an error, when I do the following:
> 
>  folder-hook .  'unset smtp_url'; 'set strict_threads=no'
>  folder-hook '(mutt|fedora|postfix|fetchmail|openbox)' 'set from =
> em...@address.com; set smtp_url="something"; set smtp_pass="somethingelse"; 
> set
>  envelope_from_address="em...@address.com"; set use_envelope_from=yes; set 
> from = "em...@address.com"; my_hdr Bcc:; set forward_format = "[FW frm 
> %a:%s]";set realname = "Real Name"; set ssl_force_tls = yes; set ssl_starttls 
> = yes'; 'set strict_threads=yes'

I think the syntax error you're getting is because the syntax is:
 folder-hook [!]regexp command

but you have two things after the regex.  Try:

 folder-hook .  'unset smtp_url; set strict_threads=no'

See how the command is all one quoted string?

You also have a ton of settings on that one line.  You might consider:

 folder-hook . 'source ~/.mutt/folder_defaults.rc'
 folder-hook '(mutt|fedora)'   'source ~/.mutt/folder_techlists.rc'  # or 
whatever name

Then make sure that *every* setting is set (or unset) in each RC file.  So if 
you set ssl_starttls in folder_techlists.rc, you'll need to set or unset it in 
folder_defaults.rc.  Otherwise, you will have different settings depending on 
which folders you have visited.

-- 
Ed Blackman


Re: unset folder-hook

2023-07-17 Thread Ranjan Maitra
On Sun Jul16'23 10:03:01PM, Ed Blackman wrote:
> From: Ed Blackman 
> Date: Sun, 16 Jul 2023 22:03:01 -0400
> To: mutt-users@mutt.org
> Subject: Re: unset folder-hook
>
> On Thu, Jul 13, 2023 at 09:44:30AM -0500, Ranjan Maitra wrote:
> > On Thu Jul13'23 02:10:02PM, Francesco Ariis wrote:
> > > In my .muttrc I have:
> > >
> > > folder-hook sent "set something foobar"
> > > folder-hook !sent "set something something_else"
> > >
> > > maybe you can use it too in your setup?
> >
> > What if I have three sets of folder hooks in addition to the default? Also, 
> > can I not just revert the !sent (in your case) to the default, without 
> > setting everything else? I wonder if there is be a way to do the hooks only 
> > for a specific set of folders and nothing else.
>
> In my .muttrc I have:
>
> # Set $strict_threads in large mailboxes (which are likely to have duplicated 
> subjects)
> folder-hook .   set strict_threads=no
> folder-hook =sent   set strict_threads=yes
> folder-hook =.archive*  set strict_threads=yes
>
> The "." applies to every folder, and sets a default.  The last two change the 
> setting for a specific folder, and a set of folders matching a regex.
>
> --
> Ed Blackman

Thanks very much for this, however, I get an error, when I do the following:

 folder-hook .  'unset smtp_url'; 'set strict_threads=no'
 folder-hook '(mutt|fedora|postfix|fetchmail|openbox)' 'set from =
em...@address.com; set smtp_url="something"; set smtp_pass="somethingelse"; set
 envelope_from_address="em...@address.com"; set use_envelope_from=yes; set from 
= "em...@address.com"; my_hdr Bcc:; set forward_format = "[FW frm %a:%s]";set 
realname = "Real Name"; set ssl_force_tls = yes; set ssl_starttls = yes'; 'set 
strict_threads=yes'

When I go to the mutt folder, I get:

 Error in /home/email/.muttrc, line 286: set strict_threads=no: unknown command
 Error in /home/email/.muttrc, line 288: set strict_threads=yes: unknown command
 source: errors in /home/email/.muttrc

Is my syntax incorrect here? Am I missing some other package/mutt helper?

Many thanks,
Ranjan



Re: unset folder-hook

2023-07-16 Thread Ed Blackman
On Thu, Jul 13, 2023 at 09:44:30AM -0500, Ranjan Maitra wrote:
> On Thu Jul13'23 02:10:02PM, Francesco Ariis wrote:
> > In my .muttrc I have:
> >
> > folder-hook sent "set something foobar"
> > folder-hook !sent "set something something_else"
> >
> > maybe you can use it too in your setup?
> 
> What if I have three sets of folder hooks in addition to the default? Also, 
> can I not just revert the !sent (in your case) to the default, without 
> setting everything else? I wonder if there is be a way to do the hooks only 
> for a specific set of folders and nothing else.

In my .muttrc I have:

# Set $strict_threads in large mailboxes (which are likely to have duplicated 
subjects)
folder-hook .   set strict_threads=no
folder-hook =sent   set strict_threads=yes
folder-hook =.archive*  set strict_threads=yes

The "." applies to every folder, and sets a default.  The last two change the 
setting for a specific folder, and a set of folders matching a regex.

-- 
Ed Blackman


Re: unset folder-hook

2023-07-16 Thread Ranjan Maitra
Hi,

Any more suggestions on this?

Many thanks and best wishes,
Ranjan

On Thu Jul13'23 09:44:30AM, Ranjan Maitra wrote:
> From: Ranjan Maitra 
> Date: Thu, 13 Jul 2023 09:44:30 -0500
> To: mutt-users@mutt.org
> Subject: Re: unset folder-hook
>
> Dear Francesco,
>
> Thanks!
>
> On Thu Jul13'23 02:10:02PM, Francesco Ariis wrote:
> > From: Francesco Ariis 
> > Date: Thu, 13 Jul 2023 14:10:02 +0200
> > To: mutt-users@mutt.org
> > Subject: Re: unset folder-hook
> >
> > Hello Ranjan,
> >
> > Il 13 luglio 2023 alle 07:03 Ranjan Maitra ha scritto:
> > > But I have noticed that when I go to another (default) folder (not in the 
> > > list above), after one of the folders above (mutt, say), I still have the 
> > > modified folder-hook settings go to the new folder.
> > >
> > > How do I automagically revert back to the default setting when I am done 
> > > visiting these special folders with folder hooks (such as mutt in the 
> > > example above)?
> >
> > In my .muttrc I have:
> >
> > folder-hook sent "set something foobar"
> > folder-hook !sent "set something something_else"
> >
> > maybe you can use it too in your setup?
> > —F
>
>
> What if I have three sets of folder hooks in addition to the default? Also, 
> can I not just revert the !sent (in your case) to the default, without 
> setting everything else? I wonder if there is be a way to do the hooks only 
> for a specific set of folders and nothing else.
>
> Many thanks again, and best wishes,
> Ranjan
>


Re: unset folder-hook

2023-07-13 Thread Ranjan Maitra
Dear Francesco,

Thanks!

On Thu Jul13'23 02:10:02PM, Francesco Ariis wrote:
> From: Francesco Ariis 
> Date: Thu, 13 Jul 2023 14:10:02 +0200
> To: mutt-users@mutt.org
> Subject: Re: unset folder-hook
>
> Hello Ranjan,
>
> Il 13 luglio 2023 alle 07:03 Ranjan Maitra ha scritto:
> > But I have noticed that when I go to another (default) folder (not in the 
> > list above), after one of the folders above (mutt, say), I still have the 
> > modified folder-hook settings go to the new folder.
> >
> > How do I automagically revert back to the default setting when I am done 
> > visiting these special folders with folder hooks (such as mutt in the 
> > example above)?
>
> In my .muttrc I have:
>
> folder-hook sent "set something foobar"
> folder-hook !sent "set something something_else"
>
> maybe you can use it too in your setup?
> —F


What if I have three sets of folder hooks in addition to the default? Also, can 
I not just revert the !sent (in your case) to the default, without setting 
everything else? I wonder if there is be a way to do the hooks only for a 
specific set of folders and nothing else.

Many thanks again, and best wishes,
Ranjan



Re: unset folder-hook

2023-07-13 Thread Francesco Ariis
Hello Ranjan,

Il 13 luglio 2023 alle 07:03 Ranjan Maitra ha scritto:
> But I have noticed that when I go to another (default) folder (not in the 
> list above), after one of the folders above (mutt, say), I still have the 
> modified folder-hook settings go to the new folder.
> 
> How do I automagically revert back to the default setting when I am done 
> visiting these special folders with folder hooks (such as mutt in the example 
> above)?

In my .muttrc I have:

folder-hook sent "set something foobar"
folder-hook !sent "set something something_else"

maybe you can use it too in your setup?
—F



unset folder-hook

2023-07-13 Thread Ranjan Maitra
I have a folder-hook set up which basically uses a particular email account 
when in a folder. I have it set up as:

 set envelope_from_address="addr...@email.com"
 set use_envelope_from=yes
 set from = "addr...@email.com"
 set realname = "Name, Real"
 set forward_format = "[FW frm %a:%s]"


 folder-hook .  'unset smtp_url'
 folder-hook '(mutt|fedora|postfix|fetchmail|openbox)' 'set from =
em...@address.com; set smtp_url="something"; set smtp_pass="somethingelse"; set 
envelope_from_address="em...@address.com"; set use_envelope_from=yes; set from 
= "em...@address.com"; my_hdr Bcc:; set forward_format = "[FW frm %a:%s]";set 
realname = "Real Name"; set ssl_force_tls = yes; set ssl_starttls = yes'

But I have noticed that when I go to another (default) folder (not in the list 
above), after one of the folders above (mutt, say), I still have the modified 
folder-hook settings go to the new folder.

How do I automagically revert back to the default setting when I am done 
visiting these special folders with folder hooks (such as mutt in the example 
above)?

Many thanks for your suggestions and best wishes,
Ranjan






Re: restrict folder hook to specific folder(s)

2023-05-03 Thread Alan D. Salewski

On 2023-05-03 12:54:45, Ranjan Maitra  spake thus:

On Wed May03'23 09:59:17AM, Will Yardley wrote:

From: Will Yardley 
Date: Wed, 3 May 2023 09:59:17 -0700
To: mutt-users@mutt.org
Subject: Re: restrict folder hook to specific folder(s)

On Wed, May 03, 2023 at 11:27:05AM -0500, Ranjan Maitra wrote:

> I have a folder called "R". There are other folders that have "R" in 
> their name. However, when I set up a

>
> folder-hook '(R)'
>
> it seems to apply to all folders with R in it, with embarrassing 
> consequences. How do I make sure that the hook applies to the R folder 
> and nothing else?


I've not used folder-hooks myself, but it looks like you may have to 
anchor one or both sides of the regex to get the behavior you want. 


http://www.mutt.org/doc/manual/#mailbox-hook

has some examples.

and
http://www.mutt.org/doc/manual/#regexp
has some info on the regex syntax



Thanks for this! I am a little lost on how to use these syntax for my specific 
use case. I was looking for a way to have mailhooks only apply to specific 
named folders.

I tried giving the complete pathname:

/home/user/Mail/R

but this is cumbersome to put for all the folders, one by one, and also this 
does not specifically exclude out folders such as /home/user/Mail/Rsomething

Is there a way to have a specific hook for only a specific folder?

Many thanks and best wishes,
Ranjan


Hi Ranjan,

To have your folder apply apply only to the 'R' mailbox, try:

folder-hook '(^/home/user/Mail/R$)'   ...

OR, even better (assuming $folder expands to '/home/user/Mail' (as 
it probably does, since the default is documented to be "~/Mail")):


folder-hook '+(R$)'   ...

OR, even better still (to allow the rule match explicitly when 
mailbox compression may or may not be in effect:


folder-hook '+(R($|[.]gz$))'   ...


Explanation:

You can have your folder-hook apply to only specific mailboxes, but 
the regular expression used to match the mailbox needs to be 
restrictive enough to match uniquely. As you found:


folder-hook '(R)' ...

matches any mailbox with a capital letter 'R' in it, anywhere. What
may be less obvious is that it is matching on the full path to the
mailbox, so if your $HOME directory were named /home/Ranjan, and the
default setting of Mutt's $folder variable consequently expanded to:

/home/Ranjan/Mail

then the above folder-hook would match every mailbox beneath that
location.

The syntax:

folder-hook '+(R)' ...

causes an implicit anchoring on the left side due to the "mailbox 
shortcut expansion" of the initial '+' character, so matches any 
mailbox in $folder whose name starts with a 'R' (rather than any 
mailbox path that happens to contain an 'R').


Using the '+' mailbox shortcut expansion also allows your regex to 
focus on just the part that matches the actual mailbox (mbox file or 
Maildir directory) name, and avoid explicitly spelling out 
'/home/user/Mail/' at the start of each.


Tightening that example further:

folder-hook '+(R$)' ...

adds an anchor to the right side, so matches only a mailbox named 
'R' that exists in $folder. That may work fine if the mailbox is in 
Maildir format, or in uncompressed mbox format, but would not work 
for a compressed mbox format mailbox named 'R.gz'. To match that, as 
well (which would avoid needing to change the folder-hook when 
switching between compressed or non-compressed mailbox setups), a 
regex alternation via the '|' character can be used to strictly 
match a mailbox named either 'R' or 'R.gz' (and still only in 
$folder due to the left-side implied anchor of '+'):


folder-hook '+(R($|[.]gz$))'   ...

One other thing to consider is that it is possible for multiple 
different folder-hooks can match a given mailbox regex, and each 
will be executed in the order in which it appears. Any visible 
effect of the folder-hooks will be that of the last one invoked, 
which will be the last one that matched, in the order in which they 
appear in your Mutt config file(s). Therefore, the hooks should 
generally be ordered from least-specific to most-specific. E.g.,:


folder-hook '+(.*R)'   'set index_format="HOOK-FOR-R-ANYWHERE: %2C | %Z 
[%d] %-30.30F (%-4.4c) %s"'
folder-hook '+(RR($|[.]gz$))'  'set index_format="HOOK-FOR-RR: %2C | %Z [%d] 
%-30.30F (%-4.4c) %s"'
folder-hook '+(R($|[.]gz$))'   'set index_format="HOOK-FOR-R: %2C | %Z [%d] 
%-30.30F (%-4.4c) %s"'

HTH,
-Al

--
a l a n   d.   s a l e w s k i
ads@salewski.email
salew...@att.net
https://github.com/salewski


[FW frm mlmai...@gmx.com:Re: restrict folder hook to specific folder(s)]

2023-05-03 Thread Ranjan Maitra
Sorry, meant to send this to the mailing list.


- Forwarded message from Ranjan Maitra  -

From: Ranjan Maitra 
Date: Wed, 3 May 2023 12:54:45 -0500
To: Will Yardley 
Subject: Re: restrict folder hook to specific folder(s)

On Wed May03'23 09:59:17AM, Will Yardley wrote:
> From: Will Yardley 
> Date: Wed, 3 May 2023 09:59:17 -0700
> To: mutt-users@mutt.org
> Subject: Re: restrict folder hook to specific folder(s)
>
> On Wed, May 03, 2023 at 11:27:05AM -0500, Ranjan Maitra wrote:
>
> > I have a folder called "R". There are other folders that have "R" in
> > their name. However, when I set up a
> >
> > folder-hook '(R)'
> >
> > it seems to apply to all folders with R in it, with embarrassing
> > consequences. How do I make sure that the hook applies to the R folder
> > and nothing else?
>
> I've not used folder-hooks myself, but it looks like you may have to
> anchor one or both sides of the regex to get the behavior you want.
>
> http://www.mutt.org/doc/manual/#mailbox-hook
>
> has some examples.
>
> and
> http://www.mutt.org/doc/manual/#regexp
> has some info on the regex syntax
>

Thanks for this! I am a little lost on how to use these syntax for my specific 
use case. I was looking for a way to have mailhooks only apply to specific 
named folders.

I tried giving the complete pathname:

/home/user/Mail/R

but this is cumbersome to put for all the folders, one by one, and also this 
does not specifically exclude out folders such as /home/user/Mail/Rsomething

Is there a way to have a specific hook for only a specific folder?

Many thanks and best wishes,
Ranjan




- End forwarded message -


Re: restrict folder hook to specific folder(s)

2023-05-03 Thread Ranjan Maitra
On Wed May03'23 09:59:17AM, Will Yardley wrote:
> From: Will Yardley 
> Date: Wed, 3 May 2023 09:59:17 -0700
> To: mutt-users@mutt.org
> Subject: Re: restrict folder hook to specific folder(s)
>
> On Wed, May 03, 2023 at 11:27:05AM -0500, Ranjan Maitra wrote:
>
> > I have a folder called "R". There are other folders that have "R" in
> > their name. However, when I set up a
> >
> > folder-hook '(R)'
> >
> > it seems to apply to all folders with R in it, with embarrassing
> > consequences. How do I make sure that the hook applies to the R folder
> > and nothing else?
>
> I've not used folder-hooks myself, but it looks like you may have to
> anchor one or both sides of the regex to get the behavior you want.
>
> http://www.mutt.org/doc/manual/#mailbox-hook
>
> has some examples.
>
> and
> http://www.mutt.org/doc/manual/#regexp
> has some info on the regex syntax
>

Thanks for this! I am a little lost on how to use these syntax for my specific 
use case. I was looking for a way to have mailhooks only apply to specific 
named folders.

I tried giving the complete pathname:

/home/user/Mail/R

but this is cumbersome to put for all the folders, one by one, and also this 
does not specifically exclude out folders such as /home/user/Mail/Rsomething

Is there a way to have a specific hook for only a specific folder?

Many thanks and best wishes,
Ranjan





Re: restrict folder hook to specific folder(s)

2023-05-03 Thread Will Yardley
On Wed, May 03, 2023 at 11:27:05AM -0500, Ranjan Maitra wrote:

> I have a folder called "R". There are other folders that have "R" in
> their name. However, when I set up a
> 
> folder-hook '(R)'
> 
> it seems to apply to all folders with R in it, with embarrassing
> consequences. How do I make sure that the hook applies to the R folder
> and nothing else?

I've not used folder-hooks myself, but it looks like you may have to
anchor one or both sides of the regex to get the behavior you want.

http://www.mutt.org/doc/manual/#mailbox-hook

has some examples.

and
http://www.mutt.org/doc/manual/#regexp
has some info on the regex syntax

w



restrict folder hook to specific folder(s)

2023-05-03 Thread Ranjan Maitra
Hello,

I have a folder called "R". There are other folders that have "R" in their 
name. However, when I set up a

folder-hook '(R)'

it seems to apply to all folders with R in it, with embarrassing consequences. 
How do I make sure that the hook applies to the R folder and nothing else?

Many thanks and best wishes,
Ranjan


Re: Deleting github commit messages: folder-hook/regex problem

2022-09-28 Thread Francesco Ariis
Kevin,

Il 28 settembre 2022 alle 10:05 Kevin J. McCarthy ha scritto:
> Or alternatively, add an escaped single quote around the second argument:
>   folder-hook fa-ml 'push '\''~b"^@[a-zA-Z0-9_]+ pushed 
> [0-9]+ commits?.$"!~F'\'

This worked, thanks.

“Parse time”/“run time” distinction is still a tricky bit of mutt to me.
—F


Re: Deleting github commit messages: folder-hook/regex problem

2022-09-27 Thread Kevin J. McCarthy

On Tue, Sep 27, 2022 at 04:13:21PM +0200, Francesco Ariis wrote:

2. wrote this folder-hook in my muttrc:
folder-hook fa-ml 'push ~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ 
commits?.$"!~F'


The third argument above, "push", will be evaluated twice by the 
muttrc parser.


The first time, when reading the line out of your muttrc file.  The 
parser will extract three arguments:

  folder-hook
  fa-ml
  push ~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ commits?.$"!~F

Note when the third argument was parsed, the single quotes are not 
included in the result - they are used to evaluate the argument in 
"single quotes" mode during parsing.


Mutt uses this to create a folder hook, matching against 'fa-ml', and 
will parse and run the third argument when the hook runs.


So, when the folder hook actually runs, the muttrc parser will extract
two arguments:
  push
  ~b^@[a-zA-Z0-9_]+ pushed [0-9]+ commits?.$!~F

Note the double quotes are not included in the result, they (again) are
used to evaluate their contents in "double quotes" mode during parsing.

You could try putting a backslash in front of each double quote:
  folder-hook fa-ml 'push ~b\"^@[a-zA-Z0-9_]+ pushed [0-9]+ 
commits?.$\"!~F'

Or alternatively, add an escaped single quote around the second argument:
  folder-hook fa-ml 'push '\''~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ 
commits?.$"!~F'\'

When this line is first parsed, it will be the three arguments:
  folder-hook
  fa-ml
  push '~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ commits?.$"!~F'

And when the hook is run, it will parse two arguments:
  push
  ~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ commits?.$"!~F

I haven't actually tested anything here (so there may be some typos), 
but hopefully that will get you going in the right direction to debug 
things.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Deleting github commit messages: folder-hook/regex problem

2022-09-27 Thread Francesco Ariis
Hello mutt users,

I want to automatically delete some github commit messages when I enter
a folder. So I:

1. tried a to `limit` messages with this pattern:
 Limit: ~b "^@[a-zA-Z0-9_]+ pushed [0-9]+ commits?.$" !~F
   The pattern works, displaying a bunch of messages

2. wrote this folder-hook in my muttrc:
     folder-hook fa-ml 'push ~b"^@[a-zA-Z0-9_]+ pushed [0-9]+ 
commits?.$"!~F'


Unfortunately 2. does not work (i.e. no message is marked with a ‘D’ when I
enter the folder).
What am I doing wrong? Thanks in advance
—F


send-hook and send2-hook, when are they called relative to creating a new message?

2022-01-19 Thread Chris Green
If I am composing a new message, I fill in the To: and Subject: fields
and then I'm dropped into my editor to actually write the message.

If I understand the description in the mutt documentation send-hook
will have been called *before* my editor is called, do I have this
right?  ... and send2-hook is called *after* composing the message in
the editor.

Is there any hook that's called after hitting the Send command to
actually fire the message off at sendmail (or whatever)?  ... or at
least a the same time?

I want to do some GUI manipulation (i.e. move to another desktop)
after composing and sending messages to a particular address.  I guess
I could use a wrapper program and use $sendmail to call it.

-- 
Chris Green


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Chris Green
On Tue, Jan 18, 2022 at 08:34:18PM +, Chris Green wrote:
> On Tue, Jan 18, 2022 at 12:28:42PM -0800, Kevin J. McCarthy wrote:
> > On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote:
> > > Is there a straightforward way to do this?  It's easy enough to use a
> > > message hook to catch the messages from the site but what do I need to
> > > do then to convert the messages and feed them into the pager?
> > 
> > You could use the mailcap 'test=' field combined with an environment
> > variable set/unset by the hook.
> > 
> > message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER'
> > message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes'
> > 
> > In .mailcap:
> > 
> > text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; 
> > nametemplate=%s.html
> > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
> > 
> > Another idea might be to swap $mailcap_path to use another mailcap file for
> > that mailing list.
> > 
> Thanks, yes, those are possibilities.  I'll experiment. :-)
> 
The .mailcap switching works perfectly, thank you.  My alternative
'lynx -dump' is just a wrapper for lynx so slots very nicely into a
.mailcap.

Thank you.

-- 
Chris Green


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Chris Green
On Tue, Jan 18, 2022 at 12:28:42PM -0800, Kevin J. McCarthy wrote:
> On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote:
> > Is there a straightforward way to do this?  It's easy enough to use a
> > message hook to catch the messages from the site but what do I need to
> > do then to convert the messages and feed them into the pager?
> 
> You could use the mailcap 'test=' field combined with an environment
> variable set/unset by the hook.
> 
> message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER'
> message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes'
> 
> In .mailcap:
> 
> text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; 
> nametemplate=%s.html
> text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
> 
> Another idea might be to swap $mailcap_path to use another mailcap file for
> that mailing list.
> 
Thanks, yes, those are possibilities.  I'll experiment. :-)

-- 
Chris Green


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Kevin J. McCarthy

On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote:

Is there a straightforward way to do this?  It's easy enough to use a
message hook to catch the messages from the site but what do I need to
do then to convert the messages and feed them into the pager?


You could use the mailcap 'test=' field combined with an environment 
variable set/unset by the hook.


message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER'
message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes'

In .mailcap:

text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; 
nametemplate=%s.html
text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html

Another idea might be to swap $mailcap_path to use another mailcap file 
for that mailing list.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Chris Green
On Tue, Jan 18, 2022 at 11:04:40PM +0300, Jean Louis wrote:
> * Chris Green  [2022-01-18 20:45]:
> > I have the fairly standard setup for viewing HTML messages in mutt:-
> > 
> > auto_view text/html
> > unalternative_order *
> > message-hook ~A "alternative_order text/html text/plain text"
> > 
> > (The unalternative_order is because I have one special case where I
> > switch the order of text/html text/plain)
> > 
> > ... and in ~/.mailcap:-
> > 
> > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
> > 
> > 
> > 
> > However I now have a requirement where I want to run HTML messages
> > from one particular mailing list (well, it's a forum actually, but I
> > get the messages by E-Mail) through a program other than lynx.
> > 
> > Is there a straightforward way to do this?  It's easy enough to use a
> > message hook to catch the messages from the site but what do I need to
> > do then to convert the messages and feed them into the pager?
> 
> I am sure you can, instead of individual program, run a dmenu or other
> similar menu in console, maybe such as fzf, or console dialogs and
> then choose by which program to open the html files.
> 
I don't want to have to interact with things at all, I just want
messages from one particular address to be filtered through a
different HTML parser than the default lynx.  The messages should just
appear in my mutt pager automatically like all other messages.

-- 
Chris Green


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Chris Green
On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote:
> I have the fairly standard setup for viewing HTML messages in mutt:-
> 
> auto_view text/html
> unalternative_order *
>     message-hook ~A "alternative_order text/html text/plain text"
> 
> (The unalternative_order is because I have one special case where I
> switch the order of text/html text/plain)
> 
> ... and in ~/.mailcap:-
> 
> text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
> 
> 
> 
> However I now have a requirement where I want to run HTML messages
> from one particular mailing list (well, it's a forum actually, but I
> get the messages by E-Mail) through a program other than lynx.
> 
> Is there a straightforward way to do this?  It's easy enough to use a
> message hook to catch the messages from the site but what do I need to
> do then to convert the messages and feed them into the pager?
> 
Could display_filter help?  I.e. can I use a message_hook to set
display_filter when the message is from the list in question and unset
display_filter by default (i.e. for all other messages)?

-- 
Chris Green


Re: How to 'hook' different programs to view text/html?

2022-01-18 Thread Jean Louis
* Chris Green  [2022-01-18 20:45]:
> I have the fairly standard setup for viewing HTML messages in mutt:-
> 
> auto_view text/html
> unalternative_order *
>     message-hook ~A "alternative_order text/html text/plain text"
> 
> (The unalternative_order is because I have one special case where I
> switch the order of text/html text/plain)
> 
> ... and in ~/.mailcap:-
> 
> text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
> 
> 
> 
> However I now have a requirement where I want to run HTML messages
> from one particular mailing list (well, it's a forum actually, but I
> get the messages by E-Mail) through a program other than lynx.
> 
> Is there a straightforward way to do this?  It's easy enough to use a
> message hook to catch the messages from the site but what do I need to
> do then to convert the messages and feed them into the pager?

I am sure you can, instead of individual program, run a dmenu or other
similar menu in console, maybe such as fzf, or console dialogs and
then choose by which program to open the html files.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


How to 'hook' different programs to view text/html?

2022-01-18 Thread Chris Green
I have the fairly standard setup for viewing HTML messages in mutt:-

auto_view text/html
unalternative_order *
message-hook ~A "alternative_order text/html text/plain text"

(The unalternative_order is because I have one special case where I
switch the order of text/html text/plain)

... and in ~/.mailcap:-

text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html



However I now have a requirement where I want to run HTML messages
from one particular mailing list (well, it's a forum actually, but I
get the messages by E-Mail) through a program other than lynx.

Is there a straightforward way to do this?  It's easy enough to use a
message hook to catch the messages from the site but what do I need to
do then to convert the messages and feed them into the pager?

-- 
Chris Green


Re: index-format-hook date pattern for current week

2021-11-04 Thread Ed Blackman
On Tue, Aug 31, 2021 at 05:54:23AM -0700, li...@ifohancroft.com wrote:
[...]
> index-format-hook date "~d<1d" "%[%H:%M]" # If it's from today - I only want
> the time
> index-format-hook date "~d<1w" "%[%d %a]" # If it's from this week - I only
> want the day and the date
[...]
> The rest works as I want it to and as I expect it to, besides the week
> pattern. If any email is from the last seven days, it gets caught by the
> week pattern. I don't want that. I want only emails from the current week to
> get caught by the week pattern, not all emails from the last 7 days.
> 
> Here's what is currently happening:
> 
> Today is Tuesday, August 31st. In my email, currently, the oldest email
> being caught by the week pattern is from Wednesday, August 25th.
> 
> Here's what I want to be happening:
> 
> Today is Tuesday, August 31st. In my email, the oldest email that should be
> getting caught by the week pattern should be from Monday, August 30th.

Sorry for the late response, and I don't have a direct answer to your question, 
but since I didn't see any direct answers I figured I'd share my solution that 
might be something that you can adapt.

I use a Mutt pipe variable to let me use a script to set the index format, 
passing the datetime of the message and the current datetime as variables.  I 
then have the script do date calcuations and echo an otherwise fixed index 
format that has a variable date format.

My current script does what your index-format-hook does: shows the weekday name 
if the difference between the message and the current datetime is between 7 and 
1 days.  But since it's a shell script, the test can be changed to something 
else to do what you want.

Despite running the shell script for each visible message, I don't notice any 
slowdown.

Here's an untested patch for what you're asking for, using GNU date supporting 
the %V format string (ISO week number with Monday as the first day of the 
%week).  Note that this runs two more commands ("date" twice) for dates that 
are less than 7 days old.  I doubt that will make it noticibly slower, but test 
it.

Replace
 format="%8[%a %-I%P]" # ' Thu 6pm'

with

 # use week day name only within the same ISO week number, with weeks starting 
on Monday
 if [ "$(date +%V -d "@$now")" = "$(date +%V -d "@$msg_date") ]; then
  format="%8[%a %-I%P]"# ' Thu 6pm'
 else
  format="%8[%b %d]"   # '  Jan 20'
 fi

In ~/.mutt/muttrc:

# Show different date/time formats in index based on message age
# WORKAROUND: '<%s>' used to work, but doesn't in NeoMutt 1.7.2. Width 
specifier fixes.
set index_format="/home/edgewood/.mutt/bin/format_date '%[%s]' '%1<%s>' |"

~/.mutt/bin/format_date:

#!/bin/bash
# format_date
#
# In .muttrc:
# set index_format="/path/to/format_date '%[%s]' '%<%s>' |"
#
# 
http://groups.google.com/group/de.comm.software.mailreader.misc/browse_thread/thread/ab966bddc0b424
 46/421549103438b830?q=#421549103438b830
# via Andreas Kneib 
# mutt-users Message-ID: <20110105233817.ga23...@andreas.kneib.biz>
# Improvements by
# David Champion 
# Ed Blackman 

# 2018-10-24: remove annoying ^N and spaces added by NeoMutt 1.7
# arguments are both epoch seconds, so limiting to just digits is safe

msg_date="${1//[!0-9]}" # datetime of message in local timezone 
in epoch seconds
now="${2//[!0-9]}"  # current time in local timezone in 
epoch seconds
msg_age="$(( ($now - $msg_date) / 86400 ))" # age of message in 
integer days

if [ $msg_age -ge 30 ]; then
 format="%[%m/%d/%y]"  # '01/20/11'
elif [ $msg_age -ge 7 ]; then
 format="%8[%b %d]"# '  Jan 20'
elif [ $msg_age -ge 1 ]; then
 format="%8[%a %-I%P]" # ' Thu 6pm'
else
 format="%[ %_I:%M%P]" # '  6:41pm'
fi

echo "%4C %Z $format %-15.15F (%?l?%4l&%4c?) %?H?[%H]?%s%"

-- 
Ed Blackman


Re: I can't seem to make a message-hook work, what am I doing wrong?

2021-10-31 Thread Chris Green
On Sun, Oct 31, 2021 at 09:19:47AM +, Chris Green wrote:
> On Sat, Oct 30, 2021 at 09:05:18PM +0100, Chris Green wrote:
> Well I now have:-
> 
> auto_view text/html
> unalternative_order
> message-hook ~A "alternative_order text/html text/plain text"
> 
> message-hook '~f ilovefreegle.org' 'unalternative_order'
> message-hook '~f ilovefreegle.org' 'alternative_order text/plain 
> text/html'
> 
> ... and it's still not working.  Obviously I'm still misunderstanding
> something!
> 
Got it!  It should be:-

auto_view text/html
unalternative_order *
message-hook ~A "alternative_order text/html text/plain text"

message-hook '~f ilovefreegle.org' 'unalternative_order *'
message-hook '~f ilovefreegle.org' 'alternative_order text/plain text/html'

Now I can actually see the messages I get from Freegle! :-)

Thanks all.

-- 
Chris Green


Re: I can't seem to make a message-hook work, what am I doing wrong?

2021-10-31 Thread Chris Green
On Sat, Oct 30, 2021 at 09:05:18PM +0100, Chris Green wrote:
> On Sat, Oct 30, 2021 at 10:06:41AM -0700, Kevin J. McCarthy wrote:
> > On Sat, Oct 30, 2021 at 10:56:12AM +0100, Chris Green wrote:
> > > So, I have the following lines in my muttrc file:-
> > > 
> > >auto_view text/html
> > >alternative_order text/html text/plain text
> > >message-hook '~f .*ilovefreegle.org.*' 'alternative_order text/plain 
> > > text/html'
> > 
> > Each invocation of alternative_order appends to the list - it doesn't erase
> > and reset the values.  You'll want to use 'unalternative_order *' to clear
> > out the list.
> > 
> That would explain it! Thank you.
> 
> 
> > Also, don't forget the message-hook you have above will affect that message
> > and all subsequent messages, unless you have a default message-hook to reset
> > values back.
> > 
> Yes, I was aware that I hadn't done that as required.
> 
Well I now have:-

auto_view text/html
unalternative_order
message-hook ~A "alternative_order text/html text/plain text"

message-hook '~f ilovefreegle.org' 'unalternative_order'
message-hook '~f ilovefreegle.org' 'alternative_order text/plain text/html' 
   

... and it's still not working.  Obviously I'm still misunderstanding
something!

Here's the relevant bit of the header of a message I'm trying to match
and use the text/plain part:-

From: Chris 
To: Chris 

... and just to prove there is a text/plain part to view:-

->   I 1
[multipa/alternativ, 7bit, 29K]
 I 2 ├─>  [text/plain, 
quoted, utf-8, 0.2K]
 I 3 └─>[text/html, 
base64, utf-8, 28K]

(you can see why I prefer the text/plain version!)


-- 
Chris Green


Re: I can't seem to make a message-hook work, what am I doing wrong?

2021-10-30 Thread Chris Green
On Sat, Oct 30, 2021 at 10:06:41AM -0700, Kevin J. McCarthy wrote:
> On Sat, Oct 30, 2021 at 10:56:12AM +0100, Chris Green wrote:
> > So, I have the following lines in my muttrc file:-
> > 
> >auto_view text/html
> >alternative_order text/html text/plain text
> >message-hook '~f .*ilovefreegle.org.*' 'alternative_order text/plain 
> > text/html'
> 
> Each invocation of alternative_order appends to the list - it doesn't erase
> and reset the values.  You'll want to use 'unalternative_order *' to clear
> out the list.
> 
That would explain it! Thank you.


> Also, don't forget the message-hook you have above will affect that message
> and all subsequent messages, unless you have a default message-hook to reset
> values back.
> 
Yes, I was aware that I hadn't done that as required.


-- 
Chris Green


Re: I can't seem to make a message-hook work, what am I doing wrong?

2021-10-30 Thread Kevin J. McCarthy

On Sat, Oct 30, 2021 at 10:56:12AM +0100, Chris Green wrote:

So, I have the following lines in my muttrc file:-

   auto_view text/html
   alternative_order text/html text/plain text
   message-hook '~f .*ilovefreegle.org.*' 'alternative_order text/plain 
text/html'


Each invocation of alternative_order appends to the list - it doesn't 
erase and reset the values.  You'll want to use 'unalternative_order *' 
to clear out the list.


Also, don't forget the message-hook you have above will affect that 
message and all subsequent messages, unless you have a default 
message-hook to reset values back.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


I can't seem to make a message-hook work, what am I doing wrong?

2021-10-30 Thread Chris Green
I am trying to match messages in a mailing list with a message-hook so
that I can change the alternative_order setting to prioritise plain
text for this one mailing list.


So, I have the following lines in my muttrc file:-

auto_view text/html
alternative_order text/html text/plain text
message-hook '~f .*ilovefreegle.org.*' 'alternative_order text/plain 
text/html'

But it's not working, messages from addresses with ilovefreegle.org in
the From: are still getting fed through my html viewer.

Here's the header from a message which *isn't* getting matched:-

Date: Wed, 27 Oct 2021 19:18:19 +0100
From: Chris 
To: Chris 
Subject: OFFER: HP Envy 4527 All-in-one printer (IP12) ~-~~~-~-~



Have I got the matching expression wrong?  ... or have I misunderstood
how message-hook works, I'm expecting to be able to look at saved
messages and have them matched by message-hook before viewing them.

... oh, yes, I have checked that there is a text/plain part in these
messages! :-)


-- 
Chris Green


Re: index-format-hook date pattern for current week

2021-08-31 Thread raf
On Tue, Aug 31, 2021 at 05:54:23AM -0700, li...@ifohancroft.com wrote:

> Hi,
> 
> I am using an index-format-hook inside of index_format, to change the way
> the date column is displayed based on how old the email is.
> 
> My current setting is the following:
> 
> # ID, Attachments, Flags, Subject, Correspondent, Date
> set index_format = "%4C %?X?&
> ?%-1.1@replied@%-2.2@encrypted@%-1.1@flagged@ %-92.92s
> %-64.64@correspondent@ %* %10@date@"
> 
> index-format-hook date "~d<1d" "%[%H:%M]" # If it's from today - I only want
> the time
> index-format-hook date "~d<1w" "%[%d %a]" # If it's from this week - I only
> want the day and the date
> index-format-hook date "~d<1y" "%[%b %d]" # If it's from this year, I only
> want the date and the month
> index-format-hook date "~A" "%[%d/%m/%Y]" # If it's from a past year I only
> want the date, the month and the year
> 
> The rest works as I want it to and as I expect it to, besides the week
> pattern. If any email is from the last seven days, it gets caught by the
> week pattern. I don't want that. I want only emails from the current week to
> get caught by the week pattern, not all emails from the last 7 days.
> 
> Here's what is currently happening:
> 
> Today is Tuesday, August 31st. In my email, currently, the oldest email
> being caught by the week pattern is from Wednesday, August 25th.
> 
> Here's what I want to be happening:
> 
> Today is Tuesday, August 31st. In my email, the oldest email that should be
> getting caught by the week pattern should be from Monday, August 30th.
> 
> Is there another week pattern or another pattern in general, that I can use
> to make that happen or perhaps a way to make the current pattern work like
> this?
> 
> Best Regards,
> IFo Hancroft

Perhaps you could use an actual date, and cron a weekly
update to your .muttrc file (and not leave mutt running
for too long).

cheers,
raf



index-format-hook date pattern for current week

2021-08-31 Thread lists

Hi,

I am using an index-format-hook inside of index_format, to change the 
way the date column is displayed based on how old the email is.


My current setting is the following:

# ID, Attachments, Flags, Subject, Correspondent, Date
set index_format = "%4C %?X?&  
?%-1.1@replied@%-2.2@encrypted@%-1.1@flagged@ %-92.92s 
%-64.64@correspondent@ %* %10@date@"


index-format-hook date "~d<1d" "%[%H:%M]" # If it's from today - I only 
want the time
index-format-hook date "~d<1w" "%[%d %a]" # If it's from this week - I 
only want the day and the date
index-format-hook date "~d<1y" "%[%b %d]" # If it's from this year, I 
only want the date and the month
index-format-hook date "~A" "%[%d/%m/%Y]" # If it's from a past year I 
only want the date, the month and the year


The rest works as I want it to and as I expect it to, besides the week 
pattern. If any email is from the last seven days, it gets caught by the 
week pattern. I don't want that. I want only emails from the current 
week to get caught by the week pattern, not all emails from the last 7 
days.


Here's what is currently happening:

Today is Tuesday, August 31st. In my email, currently, the oldest email 
being caught by the week pattern is from Wednesday, August 25th.


Here's what I want to be happening:

Today is Tuesday, August 31st. In my email, the oldest email that should 
be getting caught by the week pattern should be from Monday, August 
30th.


Is there another week pattern or another pattern in general, that I can 
use to make that happen or perhaps a way to make the current pattern 
work like this?


Best Regards,
IFo Hancroft


Re: subject-hook ?

2021-07-29 Thread Kevin J. McCarthy

On Thu, Jul 29, 2021 at 06:33:10PM +0200, Andy Spiegl wrote:

I was expecting that this would work:
send-hook '~s "URGENT"'   'my_hdr X-Priority: 1'


That does work.  Although you'll want to make sure it's turned off in 
other cases by having both lines:

  send-hook ~A  'unmy_hdr X-Priority'
  send-hook '~s URGENT' 'my_hdr X-Priority: 1'


but apparently (acc. to the man page) send-hook only matches the recipients.


A send-hook can't be use to modify the recipients or subject of the 
current email.  But it's fine for changing user headers.  See 
<http://www.mutt.org/doc/manual/#compose-flow> for an overview of the 
composition process.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


subject-hook ?

2021-07-29 Thread Andy Spiegl
Hi mutt-lovers,

I just found that there seems to be no such thing as a subject-hook.

I was expecting that this would work:
 send-hook '~s "URGENT"''my_hdr X-Priority: 1'
but apparently (acc. to the man page) send-hook only matches the recipients.

Do you know of any other way to hook to a matched subject?

Thanks,
 Andy


-- 
 The hardest thing in the world to understand is the income tax.
   (Albert Einstein)


Re: Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Chris Green
On Thu, Jun 24, 2021 at 09:18:25PM +0100, Chris Green wrote:
> On Thu, Jun 24, 2021 at 09:15:06PM +0100, Chris Green wrote:
> > On Thu, Jun 24, 2021 at 12:30:35PM -0400, Patrick Shanahan wrote:
> > > * Chris Green  [06-24-21 12:16]:
> > > > It's a bit difficult to explain this.
> > > > 
> > > > Is it possible for a folder-hook RE to apply to all mailboxes in a
> > > > sub-directory?
> > > > 
> > > > E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
> > > > All my actual mailboxes are two levels further down:-
> > > > 
> > > > ./folder/france
> > > > ./folder/france/jobs
> > > > ./folder/france/healthcare
> > > > ./folder/france/healthcare/tmp
> > > > ./folder/france/healthcare/new
> > > > ./folder/france/healthcare/cur
> > > > ./folder/france/healthcare/cur/1601033995.01.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.04.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.02.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.07.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.03.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.05.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.00.mbox:2,
> > > > ./folder/france/healthcare/cur/1601033995.06.mbox:2,
> > > > ./folder/france/houseSitting
> > > > ./folder/france/houseSitting/tmp
> > > > ./folder/france/houseSitting/new
> > > > ./folder/france/houseSitting/cur
> > > > ./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS
> > > > 
> > > > The mailboxes are jobs (though it's empty), healthcare and housesitting.
> > > > Obviously I actually have lots more mailboxes in lots more
> > > > sub-directories below ./folder.  Can a folder-hook RE select them all?
> > > > 
> > > > I.e. does 'folder/.*/.*' work?
> > > 
> > > 
> > > did you consider seting it and then trying?
> > > 
> > Well I have now and it doesn't appear to work.
> > 
> > I have put the following in my muttrc file:-
> > 
> > folder-hook . set mbox_type=maildir
> > folder-hook 'folder/.*' set mbox_type=mbox
> > 
> > ... and when I save mail in the folder hierarchy it's still in maildir
> > format.
> > 
> ... and I have also tried:-
> 
> folder-hook . set mbox_type=maildir
> folder-hook '~/mail/folder/.*' set mbox_type=mbox
> 
> It still doesn't work.
> 
On thinking about it this isn't likely to work as folder-hook gets
actioned when reading the mailbox.  I'm not reading the mailbox, I'm
saving to it.  What I want is a save-hook that allows me to set the
mbox_type.

-- 
Chris Green


Re: Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Chris Green
On Thu, Jun 24, 2021 at 09:15:06PM +0100, Chris Green wrote:
> On Thu, Jun 24, 2021 at 12:30:35PM -0400, Patrick Shanahan wrote:
> > * Chris Green  [06-24-21 12:16]:
> > > It's a bit difficult to explain this.
> > > 
> > > Is it possible for a folder-hook RE to apply to all mailboxes in a
> > > sub-directory?
> > > 
> > > E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
> > > All my actual mailboxes are two levels further down:-
> > > 
> > > ./folder/france
> > > ./folder/france/jobs
> > > ./folder/france/healthcare
> > > ./folder/france/healthcare/tmp
> > > ./folder/france/healthcare/new
> > > ./folder/france/healthcare/cur
> > > ./folder/france/healthcare/cur/1601033995.01.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.04.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.02.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.07.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.03.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.05.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.00.mbox:2,
> > > ./folder/france/healthcare/cur/1601033995.06.mbox:2,
> > > ./folder/france/houseSitting
> > > ./folder/france/houseSitting/tmp
> > > ./folder/france/houseSitting/new
> > > ./folder/france/houseSitting/cur
> > > ./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS
> > > 
> > > The mailboxes are jobs (though it's empty), healthcare and housesitting.
> > > Obviously I actually have lots more mailboxes in lots more
> > > sub-directories below ./folder.  Can a folder-hook RE select them all?
> > > 
> > > I.e. does 'folder/.*/.*' work?
> > 
> > 
> > did you consider seting it and then trying?
> > 
> Well I have now and it doesn't appear to work.
> 
> I have put the following in my muttrc file:-
> 
> folder-hook . set mbox_type=maildir
> folder-hook 'folder/.*' set mbox_type=mbox
> 
> ... and when I save mail in the folder hierarchy it's still in maildir
> format.
> 
... and I have also tried:-

folder-hook . set mbox_type=maildir
folder-hook '~/mail/folder/.*' set mbox_type=mbox

It still doesn't work.

-- 
Chris Green


Re: Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Chris Green
On Thu, Jun 24, 2021 at 12:30:35PM -0400, Patrick Shanahan wrote:
> * Chris Green  [06-24-21 12:16]:
> > It's a bit difficult to explain this.
> > 
> > Is it possible for a folder-hook RE to apply to all mailboxes in a
> > sub-directory?
> > 
> > E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
> > All my actual mailboxes are two levels further down:-
> > 
> > ./folder/france
> > ./folder/france/jobs
> > ./folder/france/healthcare
> > ./folder/france/healthcare/tmp
> > ./folder/france/healthcare/new
> > ./folder/france/healthcare/cur
> > ./folder/france/healthcare/cur/1601033995.01.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.04.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.02.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.07.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.03.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.05.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.00.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.06.mbox:2,
> > ./folder/france/houseSitting
> > ./folder/france/houseSitting/tmp
> > ./folder/france/houseSitting/new
> > ./folder/france/houseSitting/cur
> > ./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS
> > 
> > The mailboxes are jobs (though it's empty), healthcare and housesitting.
> > Obviously I actually have lots more mailboxes in lots more
> > sub-directories below ./folder.  Can a folder-hook RE select them all?
> > 
> > I.e. does 'folder/.*/.*' work?
> 
> 
> did you consider seting it and then trying?
> 
Well I have now and it doesn't appear to work.

I have put the following in my muttrc file:-

folder-hook . set mbox_type=maildir
folder-hook 'folder/.*' set mbox_type=mbox

... and when I save mail in the folder hierarchy it's still in maildir
format.

-- 
Chris Green


Re: Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Chris Green
On Thu, Jun 24, 2021 at 12:30:35PM -0400, Patrick Shanahan wrote:
> * Chris Green  [06-24-21 12:16]:
> > It's a bit difficult to explain this.
> > 
> > Is it possible for a folder-hook RE to apply to all mailboxes in a
> > sub-directory?
> > 
> > E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
> > All my actual mailboxes are two levels further down:-
> > 
> > ./folder/france
> > ./folder/france/jobs
> > ./folder/france/healthcare
> > ./folder/france/healthcare/tmp
> > ./folder/france/healthcare/new
> > ./folder/france/healthcare/cur
> > ./folder/france/healthcare/cur/1601033995.01.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.04.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.02.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.07.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.03.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.05.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.00.mbox:2,
> > ./folder/france/healthcare/cur/1601033995.06.mbox:2,
> > ./folder/france/houseSitting
> > ./folder/france/houseSitting/tmp
> > ./folder/france/houseSitting/new
> > ./folder/france/houseSitting/cur
> > ./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS
> > 
> > The mailboxes are jobs (though it's empty), healthcare and housesitting.
> > Obviously I actually have lots more mailboxes in lots more
> > sub-directories below ./folder.  Can a folder-hook RE select them all?
> > 
> > I.e. does 'folder/.*/.*' work?
> 
> 
> did you consider seting it and then trying?
> 
It's not that straightforward though is it?!  I'd have to have
something that changes very obviously with the folder-hook setting.

I was just hoping someone would simply know the answer and say 'yes'
or 'no'.

OK, if no one has tried such a thing previously I'm quite happy to try.

-- 
Chris Green


Re: Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Patrick Shanahan
* Chris Green  [06-24-21 12:16]:
> It's a bit difficult to explain this.
> 
> Is it possible for a folder-hook RE to apply to all mailboxes in a
> sub-directory?
> 
> E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
> All my actual mailboxes are two levels further down:-
> 
> ./folder/france
> ./folder/france/jobs
> ./folder/france/healthcare
> ./folder/france/healthcare/tmp
> ./folder/france/healthcare/new
> ./folder/france/healthcare/cur
> ./folder/france/healthcare/cur/1601033995.01.mbox:2,
> ./folder/france/healthcare/cur/1601033995.04.mbox:2,
> ./folder/france/healthcare/cur/1601033995.02.mbox:2,
> ./folder/france/healthcare/cur/1601033995.07.mbox:2,
> ./folder/france/healthcare/cur/1601033995.03.mbox:2,
> ./folder/france/healthcare/cur/1601033995.05.mbox:2,
> ./folder/france/healthcare/cur/1601033995.00.mbox:2,
> ./folder/france/healthcare/cur/1601033995.06.mbox:2,
> ./folder/france/houseSitting
> ./folder/france/houseSitting/tmp
> ./folder/france/houseSitting/new
> ./folder/france/houseSitting/cur
> ./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS
> 
> The mailboxes are jobs (though it's empty), healthcare and housesitting.
> Obviously I actually have lots more mailboxes in lots more
> sub-directories below ./folder.  Can a folder-hook RE select them all?
> 
> I.e. does 'folder/.*/.*' work?


did you consider seting it and then trying?


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


Can folder-hook refer to a sub-directory mailbox?

2021-06-24 Thread Chris Green
It's a bit difficult to explain this.

Is it possible for a folder-hook RE to apply to all mailboxes in a
sub-directory?

E.g. can one produce an RE for all the sub-directories of ~/mail/folder?
All my actual mailboxes are two levels further down:-

./folder/france
./folder/france/jobs
./folder/france/healthcare
./folder/france/healthcare/tmp
./folder/france/healthcare/new
./folder/france/healthcare/cur
./folder/france/healthcare/cur/1601033995.01.mbox:2,
./folder/france/healthcare/cur/1601033995.04.mbox:2,
./folder/france/healthcare/cur/1601033995.02.mbox:2,
./folder/france/healthcare/cur/1601033995.07.mbox:2,
./folder/france/healthcare/cur/1601033995.03.mbox:2,
./folder/france/healthcare/cur/1601033995.05.mbox:2,
./folder/france/healthcare/cur/1601033995.00.mbox:2,
./folder/france/healthcare/cur/1601033995.06.mbox:2,
./folder/france/houseSitting
./folder/france/houseSitting/tmp
./folder/france/houseSitting/new
./folder/france/houseSitting/cur
./folder/france/houseSitting/cur/1601033995.00.mbox:2,RS

The mailboxes are jobs (though it's empty), healthcare and housesitting.
Obviously I actually have lots more mailboxes in lots more
sub-directories below ./folder.  Can a folder-hook RE select them all?

I.e. does 'folder/.*/.*' work?

-- 
Chris Green


Re: fcc-hook

2021-01-16 Thread Victor Sudakov
Kevin J. McCarthy wrote:
> On Sat, Jan 16, 2021 at 01:21:08PM +0700, Victor Sudakov wrote:
> > I'd like to disable fcc when sending to certain domains/addresses.
> > What's the correct syntax? I've come up with
> > 
> > fcc-hook @example.com /dev/null
> > 
> > but this /dev/null thing looks kind of ugly. I with I could just unset
> > fcc for some addresses.
> 
> For an fcc-hook, that is the correct syntax.  In fact, Mutt explicitly
> checks for "/dev/null", and will skip the whole Fcc process in that case.

Thank you! That is what I call an intuitive interface.



-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: fcc-hook

2021-01-16 Thread Kevin J. McCarthy

On Sat, Jan 16, 2021 at 01:21:08PM +0700, Victor Sudakov wrote:

I'd like to disable fcc when sending to certain domains/addresses.
What's the correct syntax? I've come up with

fcc-hook @example.com /dev/null

but this /dev/null thing looks kind of ugly. I with I could just unset
fcc for some addresses.


For an fcc-hook, that is the correct syntax.  In fact, Mutt explicitly 
checks for "/dev/null", and will skip the whole Fcc process in that 
case.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


fcc-hook

2021-01-15 Thread Victor Sudakov
Dear Colleagues,

I'd like to disable fcc when sending to certain domains/addresses.
What's the correct syntax? I've come up with 

fcc-hook @example.com /dev/null

but this /dev/null thing looks kind of ugly. I with I could just unset
fcc for some addresses.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread ಚಿರಾಗ್ ನಟರಾಜ್
For a more generic solution that I just setup in my config file:

1. Use the following send-hook: send-hook ~l "set from='Name 
'"
2. Declare all of the mailing lists to be caught by the ~l parameter using 
lists: lists mutt-users@mutt.org gnupg-us...@gnupg.org

Now, whenever I reply to a mailing list, my From address is set using the 
send-hook. Of course, this is only desirable if, in fact, you want the same 
hook run for all mailing lists (my case). Otherwise, you can use my previous 
solution, which uses the ~t limiter to specify the pattern of To 
addresses that the send-hook should be run on.

Also, running this based on the To header (rather than the From header) is 
better because if you use the list-reply function (bound to L in the index by 
default), then you _know_ what the To address will be (the mailing address of 
the list) (remember, this is the To address of the email you're _sending_). The 
slight downside is that you might need a from-address-based pattern if you 
regularly reply to individuals who sent the email (rather than sending the 
email to the mailing list), since this type of pattern won't catch that. In 
that case, simply change it to ~f, but keep in mind that it's the From 
address _of the email you're sending_, *not* of the received email (the one 
you're replying to).

HTH!

- Chiraag
-- 
ಚಿರಾಗ್ ನಟರಾಜ್
Pronouns: he/him/his

25/11/20 13:46 ನಲ್ಲಿ, ಚಿರಾಗ್ ನಟರಾಜ್  ಬರೆದರು:
> The way I did it for this list is:
> 
> send-hook ~tmutt-us...@mutt.org "set from='ಚಿರಾಗ್ ನಟರಾಜ್ 
> '"
> 
> You should be able to edit the mutt-users@mutt.org to be *@groups.io or 
> something (you may have to escape the asterisk?) and then use set from='Name 
> ' as the command to run.
> 
> HTH!
> 
> - Chiraag
> -- 
> ಚಿರಾಗ್ ನಟರಾಜ್
> Pronouns: he/him/his
> 
> 25/11/20 09:26 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> > 
> > Is there some sort of action/command I can run from send-hook that
> > would allow 'editing' of a header?
> > 
> > E.g. for the case I was recently enquiring about where groups.io munge
> > certain senders' addresses the requirement would be to have a
> > send-hook match on "via groups.io" in the From:  header and would then
> > change  to .
> > 
> > It's a fairly easy sort of search/replace but I can't see any obvious
> > way to implement it in mutt.
> > 
> > It can be done for specific From: addresses by matching the address
> > with a send-hook and using my_hdr to write a new From: (will that
> > remove the orginal From: ?).  However this would require a send-hook
> > for every individual address.
> > 
> > --
> > Chris Green





publickey - mailinglist@chiraag.me - b0c8d720.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread ಚಿರಾಗ್ ನಟರಾಜ್
The way I did it for this list is:

send-hook ~tmutt-us...@mutt.org "set from='ಚಿರಾಗ್ ನಟರಾಜ್ 
'"

You should be able to edit the mutt-users@mutt.org to be *@groups.io or 
something (you may have to escape the asterisk?) and then use set from='Name 
' as the command to run.

HTH!

- Chiraag
-- 
ಚಿರಾಗ್ ನಟರಾಜ್
Pronouns: he/him/his

25/11/20 09:26 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> 
> Is there some sort of action/command I can run from send-hook that
> would allow 'editing' of a header?
> 
> E.g. for the case I was recently enquiring about where groups.io munge
> certain senders' addresses the requirement would be to have a
> send-hook match on "via groups.io" in the From:  header and would then
> change  to .
> 
> It's a fairly easy sort of search/replace but I can't see any obvious
> way to implement it in mutt.
> 
> It can be done for specific From: addresses by matching the address
> with a send-hook and using my_hdr to write a new From: (will that
> remove the orginal From: ?).  However this would require a send-hook
> for every individual address.
> 
> --
> Chris Green


publickey - mailinglist@chiraag.me - b0c8d720.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread Chris Green
Is there some sort of action/command I can run from send-hook that
would allow 'editing' of a header?

E.g. for the case I was recently enquiring about where groups.io munge
certain senders' addresses the requirement would be to have a
send-hook match on "via groups.io" in the From:  header and would then
change  to .

It's a fairly easy sort of search/replace but I can't see any obvious
way to implement it in mutt.

It can be done for specific From: addresses by matching the address
with a send-hook and using my_hdr to write a new From: (will that
remove the orginal From: ?).  However this would require a send-hook
for every individual address.

-- 
Chris Green


Re: Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread Cameron Simpson
On 24Nov2020 12:09, Ian Zimmerman  wrote:
>On 2020-11-24 17:22, Chris Green wrote:
>> > > I'm on a couple of mailing lists that have recently moved from
>> > > Yahoo Groups to groups.io.  For DMARC (so they claim) groups.io
>> > > change the senders E-mail address as follows:-
>> > >
>> > > Sender Name 
>> > >
>> > > becomes:-
>> > >
>> > > "Sender Name via groups.io" 
>
>> It only happens to users from some domains. [...]
>
>It is because those senders subscribed with an address covered by a
>strict DMARC policy. If their address is not munged by the list, their
>messages will be bounced back to the list by almost everyone if they
>fail a DKIM check (and that's almost always). [...]
>
>There's no good automatic solution to build into a MUA for this, as far
>as I know. The best you can do is write a macro to extract the true
>sender, and feel lucky for using a MUA that allows that :-)

I have an unmangle step in my mail filer. I'll list the rules at the 
bottom of this message.

Basicly, for particular sources I hack the From: line around. For yahoo 
lists the original address was embedded in the From: header itself, for 
mercur...@mercurial-scm.org the Reply-To: header holds the original 
author, for us...@lists.fedoraproject.org the X-Old-From: header holds 
it, for core-mentors...@python.org it is in the X-MailFrom: and so 
forth. So there's a suite of special purpose rules below.

The rule syntax below is "target condition...", so each of the:

from:s/this/that/

lines is a "target" and the other lines constraint which messages it is 
applied to.

I imagine you could do something with procmail like this. See the 
"formail" command. If formail won't do it, a sed script probably will.

Note that this of course mangles the headers, a price I've been willing 
to pay for sanity.

Cheers,
Cameron Simpson 

# undo Yahoo Groups DKIM/DMARC mangling
# if we ever check the validity of this stuff it will need to be before this 
step
from:s/"(?P.*\S)\s+(?P\S+@\S+)\s+\[(?P[^ 
]*)\]".*<(?P=listname)(-noreply)?@yahoogroups.com>/"$fullname" <$coreaddr>/
sender:/@yahoogroups.com
from:/@yahoogroups.com>
from:s/"(?P.*\S)\s+(?P\S+@\S+)\s+\[(?P[^ 
]*)\]".*<(?P=listname)@yahoogroups.com>/"$fullname" <$coreaddr>/
sender:/@yahoogroups.com
from:/@yahoogroups.com>
from:s/"(?P\S+@\S+)\s+\[(?P[^ 
]*)\]".*<(?P=listname)@yahoogroups.com>/<$coreaddr>/
sender:/@yahoogroups.com
from:/@yahoogroups.com>

from:s/.*/$reply_to/
sender:mercurial-boun...@mercurial-scm.org
from:/ via Mercurial 

# undo Linux Australia header mangling
from:s/.*/$reply_to/
sender:linux-aus-boun...@lists.linux.org.au
from:linux-...@lists.linux.org.au

from:s/.*/$x_mailfrom/  from:core-mentors...@python.org
x-mailfrom:/@
list-id:/core-mentorship.python.org/
from:s/.*/$reply_to/

from:(python-l...@python.org|python-id...@python.org|python-...@python.org|tu...@python.org)

# fedoraproject.org x-mailfrom
from:s/ via users / <$x_mailfrom>/
from:(us...@lists.fedoraproject.org)

# googlegroups x-original-from
from:s/ via users / <$x_original_from>/
from:vim_...@googlegroups.com


Re: Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread Ian Zimmerman
On 2020-11-24 17:22, Chris Green wrote:

> > > I'm on a couple of mailing lists that have recently moved from
> > > Yahoo Groups to groups.io.  For DMARC (so they claim) groups.io
> > > change the senders E-mail address as follows:-
> > > 
> > > Sender Name 
> > > 
> > > becomes:-
> > > 
> > > "Sender Name via groups.io" 

> It only happens to users from some domains.  I have seen it only with
> btinternet.com and ntlworld.com.  Like you I can send replies off-list
> to senders from other domains such as gmail and my own isbd.net.
> 
> There is a faq entry about it on the groups.io web site, that's where
> I found it has something to do with DMARC.

It is because those senders subscribed with an address covered by a
strict DMARC policy. If their address is not munged by the list, their
messages will be bounced back to the list by almost everyone if they
fail a DKIM check (and that's almost always).

This is just a perfect storm of sh*t - DMARC misguided by itself (IMO)
plus the ancient but misguided (also IMO) practice of lists munging or
adding to message contents.

There's no good automatic solution to build into a MUA for this, as far
as I know. The best you can do is write a macro to extract the true
sender, and feel lucky for using a MUA that allows that :-)

-- 
Ian


Re: Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread Chris Green
On Tue, Nov 24, 2020 at 05:06:54PM +0100, Francesco Ariis wrote:
> Il 24 novembre 2020 alle 15:59 Chris Green ha scritto:
> > I don't know if anyone else has seen this problem but was hoping that
> > someone has and thus has a ready made fix.
> > 
> > I'm on a couple of mailing lists that have recently moved from Yahoo
> > Groups to groups.io.  For DMARC (so they claim) groups.io change the
> > senders E-mail address as follows:-
> > 
> > Sender Name 
> > 
> > becomes:-
> > 
> > "Sender Name via groups.io" 
> > 
> > 
> > So a R[eply] to sender doesn't work because the address is simply
> > wrong, I get an error back from groups.io when I use R[eply].
> 
> Hello Chris, I myself follow a group that moved to groups.io from yahoo
> (abcusers).
> But I cannot reproduce your problem! The headers seem fine
> 
> Date: Wed, 28 Oct 2020 17:35:41 -0700
> From: Pat Anderson 
> To: abcus...@groups.io
> Subject: [abcusers] We Need a Linux Snap, Flatpak, or AppISomage for 
> EasyABC!
> User-Agent: GROUPS.IO Web Poster
> 
> and when I press `r` I am prompted
> 
> Reply to abcus...@groups.io? ([yes]/no):
> 
> then after `n` I edit the message and everything is fine in «To:».
> Am I understanding the problem correctly?  Maybe your group admin changed
> some settings?

It only happens to users from some domains.  I have seen it only with
btinternet.com and ntlworld.com.  Like you I can send replies off-list
to senders from other domains such as gmail and my own isbd.net.

There is a faq entry about it on the groups.io web site, that's where
I found it has something to do with DMARC.

-- 
Chris Green


Re: Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread Francesco Ariis
Il 24 novembre 2020 alle 15:59 Chris Green ha scritto:
> I don't know if anyone else has seen this problem but was hoping that
> someone has and thus has a ready made fix.
> 
> I'm on a couple of mailing lists that have recently moved from Yahoo
> Groups to groups.io.  For DMARC (so they claim) groups.io change the
> senders E-mail address as follows:-
> 
> Sender Name 
> 
> becomes:-
> 
> "Sender Name via groups.io" 
> 
> 
> So a R[eply] to sender doesn't work because the address is simply
> wrong, I get an error back from groups.io when I use R[eply].

Hello Chris, I myself follow a group that moved to groups.io from yahoo
(abcusers).
But I cannot reproduce your problem! The headers seem fine

Date: Wed, 28 Oct 2020 17:35:41 -0700
From: Pat Anderson 
To: abcus...@groups.io
Subject: [abcusers] We Need a Linux Snap, Flatpak, or AppISomage for 
EasyABC!
User-Agent: GROUPS.IO Web Poster

and when I press `r` I am prompted

Reply to abcus...@groups.io? ([yes]/no):

then after `n` I edit the message and everything is fine in «To:».
Am I understanding the problem correctly?  Maybe your group admin changed
some settings?
—F


Re: Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread cl
On Tue, Nov 24, 2020 at 11:01:37AM -0500, John Hawkinson wrote:
> Chris Green  wrote on Tue, 24 Nov 2020
> at 10:59:12 EST in <20201124155912.GL887493@esprimo>:
> 
> 
> > Date: Tue, 24 Nov 2020 15:59:12 +
> > From: Chris Green 
> > To: mutt-users@mutt.org
> > Subject: Can I fix this groups.io problem with a send hook or something
> > Message-ID: <20201124155912.GL887493@esprimo>
> > Mail-Followup-To: mutt-users@mutt.org
> > Sender: Mutt-users 
> > 
> > I don't know if anyone else has seen this problem but was hoping that
> > someone has and thus has a ready made fix.
> > 
> > I'm on a couple of mailing lists that have recently moved from Yahoo
> > Groups to groups.io.  For DMARC (so they claim) groups.io change the
> > senders E-mail address as follows:-
> > 
> > Sender Name 
> > 
> > becomes:-
> > 
> > "Sender Name via groups.io" 
> > 
> > 
> > So a R[eply] to sender doesn't work because the address is simply
> > wrong, I get an error back from groups.io when I use R[eply].
> > 
> > 
> > Is there a (fairly) simple send_hook (or something else) that I can
> > use to mend the address?  Surely this isn't a new problem so I am
> > hoping someone else here may have got an answer already! :-)
> > 
> > -- 
> > Chris Green
> The groups.io lists I'm on set Reply-To to the original address, so that 
> in practice this is not a problem when mutt is allowed to honor Reply-To. 
> Perhaps this is a list-specific configuration setting, though. 
> 
I looked at one of the groups I have the problem with and Reply-To: is:-

Reply-To: starbase-...@groups.ioo

I.e. it's set to the name of the group.


-- 
Chris Green


Can I fix this groups.io problem with a send hook or something

2020-11-24 Thread Chris Green
I don't know if anyone else has seen this problem but was hoping that
someone has and thus has a ready made fix.

I'm on a couple of mailing lists that have recently moved from Yahoo
Groups to groups.io.  For DMARC (so they claim) groups.io change the
senders E-mail address as follows:-

Sender Name 

becomes:-

"Sender Name via groups.io" 


So a R[eply] to sender doesn't work because the address is simply
wrong, I get an error back from groups.io when I use R[eply].


Is there a (fairly) simple send_hook (or something else) that I can
use to mend the address?  Surely this isn't a new problem so I am
hoping someone else here may have got an answer already! :-)

-- 
Chris Green


Re: suggesting screen-hook

2020-11-20 Thread Franck Richter
Thanks Felix for your comments.

> I use the basic scheme you have of manually toggling visibility, and it is 
> plenty fast and easy.  I use it for the same reason: copying multi-line text.
Yeap, we share same experience.
I used to manually toggle sidebar visibility too for a while. Then I started to 
think 'would be great when mutt does that for me'. Something oriented 'This one 
just sucks less.' you know :-)
Hence my 1st mail.


> I've never needed any of the folder-hooks.
They are of course not necessary and used for other purposes:
- having 'deleted' emails moved at first into a Trash can. Emails only get 
really deleted when deleted from within the Trash can. I don't remember from 
who I copied that, but I find that handy as mistakes happen.
- having F12 key moving emails from inbox to oldbox & vice versa.
I added inside the 'set sidebar_visible=yes' inside those hooks to reduce the 
manual toggling.
Unfortunately it just reduces but does not eliminate the necessity of manual 
toggling, and it makes .muttrc less readable (although I don't read it often).


> (It annoys me no end that gnome-terminal-server does not recognize that URLs 
> can span multiple lines for the right click copy/open menu.)
Agreed, same experience here using xfce4-terminal.

F.


Re: suggesting screen-hook

2020-11-15 Thread Felix Finch

On 20201115, Franck Richter wrote:

I wish to hide the sidebar when viewing emails, because copying >1 line of text 
with the mouse unfortunately includes the content of the sidebar in the copy 
buffer.

Currently I am using following tricks that unfortunately fail time to time to 
show the sidebar again :
 message-hook ~A 'set sidebar_visible=no'
 macro pager q 'set sidebar_visible=yes'
 (adapted from 
https://jhutar.blogspot.com/2018/09/hide-sidebar-when-viewing-message-in.html)

 macro index \CB 'toggle sidebar_visible'
 macro pager \CB 'toggle sidebar_visible'

To increase the cases where sidebar_visible=yes happens, I had to make other 
hooks I use more complex, ex:
 folder-hook "$my_mailboxname/in$" macro index d 
'+$my_mailboxname/trash"set 
sidebar_visible=yes"'
 folder-hook "$my_mailboxname/trash$" macro index d '"set 
sidebar_visible=yes"'
 folder-hook "$my_mailboxname/old$" macro index  
'+$my_mailboxname/in"set sidebar_visible=yes"'
 folder-hook "$my_mailboxname/in$" macro index  
'+$my_mailboxname/old"set sidebar_visible=yes"'
 folder-hook "$my_mailboxname/trash$" macro index  
'+$my_mailboxname/in"set sidebar_visible=yes"'
Even with above, when manually saving mails in other mailboxes (via 's' or 
';s'), I have to manually make sidebar visible again.


[ Name alternatives ]
screen-hook, context-hook, mode-hook... (doesn't matter)


I use the basic scheme you have of manually toggling visibility, and it is 
plenty fast and easy.  I use it for the same reason: copying multi-line text.

   # b toggles sidebar visibility
   macro index b 'toggle sidebar_visible'
   macro pager b 'toggle sidebar_visible'

   # Remap bounce-message function to "B"
   bind index B bounce-message

I've never needed any of the folder-hooks.  The sidebar is always visible 
unless I've toggled it off.

(It annoys me no end that gnome-terminal-server does not recognize that URLs 
can span multiple lines for the right click copy/open menu.)

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / fe...@crowfix.com
 GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


suggesting screen-hook

2020-11-15 Thread Franck Richter
Hi All,

Would it be possible/useful to add a type of hook that get triggered depending 
of the screen currently displayed ?
ex:
  to get sidebar visible when seeing index screen
screen-hook index '"set sidebar_visible=yes"'
  to hide sidebar when seeing pager screen
    screen-hook pager '"set sidebar_visible=no"'

or even better:
screen-hook !pager '"set sidebar_visible=yes"'
screen-hook pager  '"set sidebar_visible=no"'

How do you think ?


[ Background ]
If I missed a simple way to achieve above, let me know, I would be happy to 
hear about it :-)
I wish to hide the sidebar when viewing emails, because copying >1 line of text 
with the mouse unfortunately includes the content of the sidebar in the copy 
buffer.

Currently I am using following tricks that unfortunately fail time to time to 
show the sidebar again :
  message-hook ~A 'set sidebar_visible=no'
  macro pager q 'set sidebar_visible=yes'
  (adapted from 
https://jhutar.blogspot.com/2018/09/hide-sidebar-when-viewing-message-in.html)

  macro index \CB 'toggle sidebar_visible'
  macro pager \CB 'toggle sidebar_visible'

To increase the cases where sidebar_visible=yes happens, I had to make other 
hooks I use more complex, ex:
  folder-hook "$my_mailboxname/in$" macro index d 
'+$my_mailboxname/trash"set 
sidebar_visible=yes"'
  folder-hook "$my_mailboxname/trash$" macro index d 
'"set sidebar_visible=yes"'
  folder-hook "$my_mailboxname/old$" macro index  
'+$my_mailboxname/in"set 
sidebar_visible=yes"'
  folder-hook "$my_mailboxname/in$" macro index  
'+$my_mailboxname/old"set 
sidebar_visible=yes"'
  folder-hook "$my_mailboxname/trash$" macro index  
'+$my_mailboxname/in"set 
sidebar_visible=yes"'
Even with above, when manually saving mails in other mailboxes (via 's' or 
';s'), I have to manually make sidebar visible again.


[ Name alternatives ]
screen-hook, context-hook, mode-hook... (doesn't matter)

Kind regards,
Franck Richter


Re: Always CC specific messages to some people (send-hook and my_hdr)

2020-11-12 Thread Gregory Heytings





When emailing to someone with mutt, I would like to have my messages 
automatically CC'd to someone. Typically, we are a team of academics 
working with a student, and I would like my exchanges with the student 
to be sent to others.


Mutt aliases seems to be on a "per field" basis. So I could use it to 
put my coworkers in an alias, but they would be in the "To:" field, not 
"CC".


I wanted to use a send-hook and the my_hdr variable, but it works for 
other fields (such as adding a "Organization: A Really Big Company, 
Anytown, USA", from the manual). But not for the CC field (the manual 
says: "note that my_hdr commands which modify recipient headers, or the 
message's subject, don't have any effect on the current message when 
executed from a send-hook").


Is there a workaround? Perhaps with the recent muttlisp?

Setting edit_headers to yes for all my messages(and having a nice macro 
in my editor) would not help, since I'd like such a behavior for only a 
fraction of my communication.




I would do this as follows:

# rebinds "r"
macro index,pager r 'set my_wait_key=$wait_key; set 
nowait_key;autocc.shsource 
~/.mutt/autocc.outset wait_key=$my_wait_key' "smart reply"

and the autocc.sh script:

#!/bin/sh
echo unmy_hdr Cc > ~/.mutt/autocc.out
MAIL=$(mktemp)
cat - > $MAIL
# check (with grep or another tool of your choice) if the sender appears in the 
email headers, and if so:
echo my_hdr Cc: ... >> ~/.mutt/autocc.out
rm -f $MAIL


Re: Always CC specific messages to some people (send-hook and my_hdr)

2020-11-12 Thread raf
On Thu, Nov 12, 2020 at 05:58:01PM +0100, Raphaël Fournier-S'niehotta 
 wrote:

> Hello fellow mutt users,
> 
> When emailing to someone with mutt, I would like to have my messages
> automatically CC'd to someone. Typically, we are a team of academics
> working with a student, and I would like my exchanges with the student
> to be sent to others.
> 
> Mutt aliases seems to be on a "per field" basis. So I could use it to
> put my coworkers in an alias, but they would be in the "To:" field,
> not "CC".
> 
> I wanted to use a send-hook and the my_hdr variable, but it works for
> other fields (such as adding a "Organization: A Really Big Company,
> Anytown, USA", from the manual). But not for the CC field (the manual
> says: "note that my_hdr commands which modify recipient headers, or
> the message's subject, don't have any effect on the current message
> when executed from a send-hook").
> 
> Is there a workaround? Perhaps with the recent muttlisp?
> 
> Setting edit_headers to yes for all my messages(and having a nice
> macro in my editor) would not help, since I'd like such a behavior for
> only a fraction of my communication.
> 
> Thanks in advance!
> -- 
> Raphaël Fournier-S'niehotta
> http://raphael.fournier-sniehotta.fr/apropos

Hi,

I needed to do something very much like this. I needed
to automatically Cc: all my work-related emails. But I
found that the problem with doing it entirely in mutt
was that the hooks that looked most likely to assist
couldn't affect the recipient addresses (due to the
order in which things happen inside mutt). That's the
same limitation that you encountered.

I had configured mutt to automatically set my from
address, depending on where the email is being sent to.
For example, when sending to this list, From: is
m...@raf.org. When sending to a work-related address
(e.g. colleague, vendor, government), From: is my work
address. e.g.:

  send-hook '~t @work\.com\.au'   'my_hdr From: Me '
  send-hook '~t @vendor\.com\.au' 'my_hdr From: Me '
  send-hook '~t @ato\.gov\.au''my_hdr From: My Self '

Then, the auto-cc is handled by an editor script:

  set editor = "~/bin/mutt-editor"

Editing headers is a requirement:

  set edit_hdrs

But no in-editor macros are needed.

The editor script looks like this (~/bin/mutt-editor):

  #!/bin/sh

  # mutt-editor - Preprocessor/editor/postprocessor for mutt

  # Delete empty recipient headers
  perl -pi -e '$_ = "" if /^(Cc|Bcc|Reply-To): $/' "$@"

  # Add Cc: headers automatically when necessary
  mutt-autocc d...@work.com.au "$@"
  mutt-autocc k...@work.com.au "$@"
  mutt-autocc s...@work.com.au "$@"

  # Launch the editor
  ${VISUAL:-${EDITOR:-vi}} "$@"

  # Add Cc: headers automatically when necessary
  mutt-autocc d...@work.com.au "$@"
  mutt-autocc k...@work.com.au "$@"
  mutt-autocc s...@work.com.au "$@"

The mutt-autocc script automatically adds a Cc: header
if the From: address is my work address, or if the To:
or Cc: headers contain work-related domains, and if the
intended new recipient isn't already going to receive
the email. It looks like this (~/bin/mutt-autocc):

  #!/usr/bin/perl -i
  use warnings;
  use strict;

  # mutt-autocc - Mail message preprocesor/filter
  # to automatically add a Cc: header when
  # sending/replying/forwarding from my work domain
  # or to an obviously work-related domain.
  #
  # usage: mutt-autocc cc@address filename

  my $cc_address = shift @ARGV;
  my $from_domain = qr/\@work\.com\.au\b/;
  my $to_domains = qr/\@(?:work\.com\.au|vendor\.com\.au|ato\.gov\.au)\b/;
  my $from_match = 0;
  my $to_match = 0;
  my $already = 0;

  while (<>)
  {
  # Does the From: header contain the from_domain?
  $from_match = 1 if /^From: .*$from_domain/i;
  # Do the To/Cc headers contain any of the to_domains?
  $to_match = 1 if /^(?:To|Cc): .*$to_domains/i;
  # Is the cc_address already going to receive the email?
  $already = 1 if /^(?:To|Cc|Bcc): .*\b\Q$cc_address\E\b/i;
  $already = 1 if /^  .*\b\Q$cc_address\E\b/i;
  # Add Cc: header if necessary once we've seen the recipient headers
  $already = 1, print("Cc: $cc_address\n") if /^Subject: / && ($from_match 
|| $to_match) && !$already;
  # Print all lines
  print;
  }

  # vi:set ts=4 sw=4:

Calling it before the real editor would usually be
enough to add the Cc: headers before I start editing
the email. But if I have missed any destination
addresses in my send hooks, and I need to manually
change the From: address to my work address, then the
postprocessing phase will handle the rest. The same
is true if the email wasn't originally being sent
to the relevant recipient, but they are added manually
during the editor session.

Warning: As Cameron

Re: Always CC specific messages to some people (send-hook and my_hdr)

2020-11-12 Thread Cameron Simpson
On 12Nov2020 17:58, Raphaël Fournier-S'niehotta  
wrote:
>When emailing to someone with mutt, I would like to have my messages 
>automatically CC'd to someone. Typically, we are a team of academics 
>working with a student, and I would like my exchanges with the student 
>to be sent to others.
>
>Mutt aliases seems to be on a "per field" basis. So I could use it to put my 
>coworkers in an alias, but they would be in the "To:" field, not "CC".
>
>I wanted to use a send-hook and the my_hdr variable, but it works for other 
>fields (such as adding a "Organization: A Really Big Company, Anytown, USA", 
>from the manual). But not for the CC field (the manual says: "note that my_hdr 
>commands which modify recipient headers, or the message's subject, don't have 
>any effect on the current message when executed from a send-hook").
>
>Is there a workaround? Perhaps with the recent muttlisp?

Well, this doesn't work for an original message, but I have a shared 
email address with the SO, and have my reply-hooks set to CC the shared 
address for that:

    reply-hook . "my_hdr BCC: $my_cs"
reply-hook . 'set from="$NAME <$EMAIL>"'
reply-hook "! ~p ~C $my_shared" 'set from="$my_SHARED"'
reply-hook "! ~p ~C $my_shared" 'my_hdr CC: $my_SHARED'
reply-hook "! ~p ~C $my_shared2" 'set from="$my_SHARED2"'
reply-hook "! ~p ~C $my_shared2" 'my_hdr CC: $my_SHARED2'

So when I reply, the following happen:

- I BCC myself and set my preferred from
- stuff _not_ to my personal address which _is_ to/cc my shared address 
  gets the shared From: address and a shared CC: header
- repeat for the other flavour of my shared address

For clarity, $my_shared is our shared address (both-of-us@our-domain) 
and $my_SHARED is "My Name and Her Name ".

I'd be a little leery of automatic CCs, some email is genuinely personal 
and you're kind of making your reply public. Provided you get to 
manually vet that before sending you're probably fine.

Cheers,
Cameron Simpson 


Always CC specific messages to some people (send-hook and my_hdr)

2020-11-12 Thread Raphaël Fournier-S'niehotta
Hello fellow mutt users,

When emailing to someone with mutt, I would like to have my messages 
automatically CC'd to someone. Typically, we are a team of academics working 
with a student, and I would like my exchanges with the student to be sent to 
others.

Mutt aliases seems to be on a "per field" basis. So I could use it to put my 
coworkers in an alias, but they would be in the "To:" field, not "CC". 

I wanted to use a send-hook and the my_hdr variable, but it works for other 
fields (such as adding a "Organization: A Really Big Company, Anytown, USA", 
from the manual). But not for the CC field (the manual says: "note that my_hdr 
commands which modify recipient headers, or the message's subject, don't have 
any effect on the current message when executed from a send-hook").

Is there a workaround? Perhaps with the recent muttlisp?

Setting edit_headers to yes for all my messages(and having a nice macro in my 
editor) would not help, since I'd like such a behavior for only a fraction of 
my communication. 

Thanks in advance!
-- 
Raphaël Fournier-S'niehotta
http://raphael.fournier-sniehotta.fr/apropos



Re: Is there a hook for modifying a To: field?

2020-08-26 Thread Kurt Hackenberg

On 2020-08-26 15:29, Ian Zimmerman wrote:


It would be easy if List-Post: was always present and the other was
sometimes there.


Right, in my case the List-Post is consistent and is the only address
"subscribed" in mutt.

If the List-Post is _not_ consistent, I'd really call it a buggy list
and try to get the listmasters' attention.



Agreed, I also call that a list bug. The set of List-* headers should be 
present in every message from the list.


Re: Is there a hook for modifying a To: field?

2020-08-26 Thread Ian Zimmerman
On 2020-08-26 10:00, Chris Green wrote:

> > I am on a few lists that behave like this. I think they might be
> > rather more common than you suspect. But, I have never had a problem
> > posting - list reply always uses only the address in List-Post. (I
> > use neomutt, maybe it is different in this respect?)
> > 
> Do you have both 'list' addresses in the lists and subscribe entries
> in muttrc?  If the List-Post: entry was always present on my list then
> I could remove the other from lists/subscribe, but it isn't always
> there.
> 
> It would be easy if List-Post: was always present and the other was
> sometimes there.

Right, in my case the List-Post is consistent and is the only address
"subscribed" in mutt.

If the List-Post is _not_ consistent, I'd really call it a buggy list
and try to get the listmasters' attention.

-- 
Ian


Re: Is there a hook for modifying a To: field?

2020-08-26 Thread Chris Green
On Tue, Aug 25, 2020 at 02:52:00PM -0700, Ian Zimmerman wrote:
> On 2020-08-25 15:37, Kurt Hackenberg wrote:
> 
> > >To: "'David Eyre'" ,
> > >   "'ixion'" 
> > ...
> > >List-Post: 
> > 
> > Two different addresses for the list.  Which one is correct?
> > 
> > Do all messages from the list have this mismatch, or only messages
> > from this sender?  If all of them, I suspect misconfiguration of the
> > mailing list software.  If only those from this sender, I suspect that
> > he has an incorrect list address stored locally.
> 
> I am on a few lists that behave like this. I think they might be rather
> more common than you suspect. But, I have never had a problem posting -
> list reply always uses only the address in List-Post. (I use neomutt,
> maybe it is different in this respect?)
> 
Do you have both 'list' addresses in the lists and subscribe entries
in muttrc?  If the List-Post: entry was always present on my list then
I could remove the other from lists/subscribe, but it isn't always
there.

It would be easy if List-Post: was always present and the other was
sometimes there.

-- 
Chris Green


Re: Is there a hook for modifying a To: field?

2020-08-26 Thread Chris Green
On Tue, Aug 25, 2020 at 03:37:57PM -0400, Kurt Hackenberg wrote:
> On Tue, Aug 25, 2020 at 01:46:52PM +0100, Chris Green wrote:
> 
> >Here's the headers, rather verbose I'm afraid:-
> ...
> >From: NWY6 
> ...
> >To: "'David Eyre'" ,
> > "'ixion'" 
> ...
> >List-Post: 
> 
> Two different addresses for the list.  Which one is correct?
> 
> Do all messages from the list have this mismatch, or only messages
> from this sender?  If all of them, I suspect misconfiguration of the
> mailing list software.  If only those from this sender, I suspect that
> he has an incorrect list address stored locally.

It's basically pretty random.  Some senders use one address, some use
the other, so I have to treat both addresses as list addresses.
Removing ix...@ixion.org.uk from lists/subscribe in my muttrc means
that L[ist reply] won't work with all messages to the list.

-- 
Chris Green


Re: Is there a hook for modifying a To: field?

2020-08-25 Thread Ian Zimmerman
On 2020-08-25 15:37, Kurt Hackenberg wrote:

> >To: "'David Eyre'" ,
> > "'ixion'" 
> ...
> >List-Post: 
> 
> Two different addresses for the list.  Which one is correct?
> 
> Do all messages from the list have this mismatch, or only messages
> from this sender?  If all of them, I suspect misconfiguration of the
> mailing list software.  If only those from this sender, I suspect that
> he has an incorrect list address stored locally.

I am on a few lists that behave like this. I think they might be rather
more common than you suspect. But, I have never had a problem posting -
list reply always uses only the address in List-Post. (I use neomutt,
maybe it is different in this respect?)

-- 
Ian


Re: Is there a hook for modifying a To: field?

2020-08-25 Thread raf
On Tue, Aug 25, 2020 at 01:05:39PM +0100, Chris Green  wrote:

> On Tue, Aug 25, 2020 at 09:15:55AM +1000, raf wrote:
> > On Mon, Aug 24, 2020 at 10:32:56AM +0100, Chris Green  wrote:
> > 
> > > I am on a mailing list which has two addresses, occasionally when one
> > > does L[ist reply] the To: address is:-
> > > 
> > > ix...@ixiemaster.ixion.org.uk, Ixilist 
> > > 
> > > At present I normally notice this and remove one of the addresses but
> > > it would be nice if I could automate this.  Is there a hook (send_hook
> > > maybe) that can be used to change this?  It can't just change every
> > > case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
> > > most of the time a L[ist reply] only gets a single address.
> > > 
> > > -- 
> > > Chris Green
> > 
> > It seems odd that a mailing list would have two
> > addresses. Presumably the are interchangeable. If so,
> > perhaps you could use procmail or imapfilter to replace
> > all instances of one of the addresses with the other as
> > the email arrives. That way, when you read it, mutt
> > only sees one of the addresses.
> > 
> It's the only list I'm on that's like this.  I have a custom filter
> program handling incoming mail so I *could* add a special rule but it
> would have to step outside the normal logic of the filter.
> 
> If I replace all occurrences of one address with the other won't mutt
> then simply send a L[ist reply] to the same address twice? ... or does
> mutt have internal logic such that it won't send mail to duplicated
> addresses?
> 
> -- 
> Chris Green

You could apply the transformation to one email manually, and test that.

cheers,
raf



Re: Is there a hook for modifying a To: field?

2020-08-25 Thread Kurt Hackenberg
On Tue, Aug 25, 2020 at 01:46:52PM +0100, Chris Green wrote:

>Here's the headers, rather verbose I'm afraid:-
...
>From: NWY6 
...
>To: "'David Eyre'" ,
>   "'ixion'" 
...
>List-Post: 

Two different addresses for the list.  Which one is correct?

Do all messages from the list have this mismatch, or only messages
from this sender?  If all of them, I suspect misconfiguration of the
mailing list software.  If only those from this sender, I suspect that
he has an incorrect list address stored locally.


Re: Is there a hook for modifying a To: field?

2020-08-25 Thread Chris Green
On Tue, Aug 25, 2020 at 09:52:01AM +1000, Cameron Simpson wrote:
> On 24Aug2020 10:32, Chris Green  wrote:
> >I am on a mailing list which has two addresses, occasionally when one
> >does L[ist reply] the To: address is:-
> >
> >ix...@ixiemaster.ixion.org.uk, Ixilist 
> >
> >At present I normally notice this and remove one of the addresses but
> >it would be nice if I could automate this.  Is there a hook (send_hook
> >maybe) that can be used to change this?  It can't just change every
> >case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
> >most of the time a L[ist reply] only gets a single address.
> 
> Can you show the headers of such a message which produces this To: 
> header? And do you have any mutt list subscription settings for these 
> lists?
> 
> [ Personally I use (g)roup-reply and then edit the headers, but I'm 
> weird. ]
> 
Here's the headers, rather verbose I'm afraid:-

`
>From MAILER-DAEMON Tue Aug 25 12:32:32 2020
Return-Path: 
X-Original-To: ch...@zbmc.eu
Delivered-To: ch...@zbmc.eu
Received: from gh-forwarders.misp.co.uk (gh-forwarders.misp.co.uk 
[31.170.120.82])
by esprimo.zbmc.eu (Postfix) with ESMTPS id 2E3D22C01CD
for ; Tue, 25 Aug 2020 13:32:32 +0100 (BST)
Received: from exim by mail3.eqx.gridhost.co.uk with spam-scanned (Exim 4.94)
(envelope-from )
id 1kAY7r-0005xx-Jq
for c...@isbd.net; Tue, 25 Aug 2020 13:32:31 +0100
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on spam4.gridhost.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=4.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,
DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RDNS_NONE,
SPF_HELO_NONE,SPF_NONE,SUBJ_ALL_CAPS autolearn=ham version=3.3.2
X-Spam-RelaysUntrusted: [ ip=35.176.9.206 rdns= helo=ixiemaster.ixion.org.uk
by=mail3.eqx.gridhost.co.uk ident=
envfrom=ixion-boun...@ixiemaster.ixion.org.uk intl=0 id=1kAY7q-0005vF-Kz
auth= msa=0 ] [ ip=127.0.0.1 rdns=localhost helo=!35.176.9.206!
by=ixiemaster.ixion.org.uk ident=
envfrom=ixion-boun...@ixiemaster.ixion.org.uk intl=0 id=1kAY7k-0004KQ-KZ
auth= msa=0 ] [ ip=209.85.128.41 rdns=mail-wm1-f41.google.com
helo=mail-wm1-f41.google.com by=ixiemaster.ixion.org.uk ident=
envfrom=nowayhos...@gmail.com intl=0 id=1kAY7g-0004KH-4P auth= msa=0 ] [
ip=212.159.87.235 rdns=osbornedance.plus.com. helo=OSDA00 
by=smtp.gmail.com
ident= envfrom= intl=0 id=w1sm5645301wmc.18.2020.08.25.05.32.13 
auth=ESMTPSA
msa=0 ]
Received: from [35.176.9.206] (helo=ixiemaster.ixion.org.uk)
by mail3.eqx.gridhost.co.uk with esmtps  (TLS1.2) tls 
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94)
(envelope-from )
id 1kAY7q-0005vF-Kz; Tue, 25 Aug 2020 13:32:30 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; 
d=ixion.org.uk; s=20180418;

h=Subject:Sender:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:In-Reply-To:References:To:From;
 bh=ONaoaCWQ475ZCazJeIgpXfZEbUo1TaB1lNwbIHSGmSg=;

b=cFxIfP5RMcqxWOeVx7y2nm2EDR20RzeLrPb5uZe7YkXq9k/TgSXBZl9AXnXA9JlhOXiHMafzLaYAQSy0HQu6AhAOFS0LsxdW5LV3b3uAoDZvacsVytN9M4iuBNLRWNoEEt+obt9i4GubaS7948fM6OQrSk7YHlLbUpVssD7kpi0=;
Received: from localhost ([127.0.0.1] helo=[35.176.9.206])
by ixiemaster.ixion.org.uk with esmtp (Exim 4.84_2)
(envelope-from )
id 1kAY7k-0004KQ-KZ; Tue, 25 Aug 2020 13:32:26 +0100
Received: from mail-wm1-f41.google.com ([209.85.128.41])
 by ixiemaster.ixion.org.uk with esmtp (Exim 4.84_2)
 (envelope-from ) id 1kAY7g-0004KH-4P
 for ix...@ixion.org.uk; Tue, 25 Aug 2020 13:32:21 +0100
Received: by mail-wm1-f41.google.com with SMTP id y8so1036793wma.0
 for ; Tue, 25 Aug 2020 05:32:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:references:in-reply-to:subject:date:message-id:mime-version
 :content-transfer-encoding:thread-index:content-language
 :disposition-notification-to;
 bh=ONaoaCWQ475ZCazJeIgpXfZEbUo1TaB1lNwbIHSGmSg=;
 b=OnZ/ZLddh37VN4tJkpoZBU6PuLqcuZETfnoq9YfXTAjazPlGdJPut72mXddTc26b4j
 lO4sK06OfE55WU7fHwbBGqF542IWm2LCqxbuNdKA4NC+Rmfnhkij+WtIysLALXN3BGS1
 I754BhGAWQkwmWlTbN9TPQ+L8aLR+FiB7RK/Z+zb8KQOHzXA6JM6vFWzLtQFQzmNVAXy
 /XA2VbPVphgvPe4ifP6Q4wJ62aj1TcxQzABnDmQo9myYEMQLnecF8kzDXAvS19GRtBKm
 FlHTcpqNjifcLg05k+IOvy2zzVlNT05X1kuM1LNaYwqYgwp2XFEJ3WnyPB++Edmxh/ss
 3+LA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:references:in-reply-to:subject:date
 :message-id:mime-version:content-transfer-encoding:thread-index
 :content-language:disposition-notification-to;
 bh=ONaoaCWQ475ZCazJeIgpXfZEbUo1TaB1lNwbIHSGmSg=;
 b=qIMOmEX8zodnWO68oqcgOkafe0uUhjosvqBIqbBpJ338Ta

Re: Is there a hook for modifying a To: field?

2020-08-25 Thread Chris Green
On Tue, Aug 25, 2020 at 09:15:55AM +1000, raf wrote:
> On Mon, Aug 24, 2020 at 10:32:56AM +0100, Chris Green  wrote:
> 
> > I am on a mailing list which has two addresses, occasionally when one
> > does L[ist reply] the To: address is:-
> > 
> > ix...@ixiemaster.ixion.org.uk, Ixilist 
> > 
> > At present I normally notice this and remove one of the addresses but
> > it would be nice if I could automate this.  Is there a hook (send_hook
> > maybe) that can be used to change this?  It can't just change every
> > case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
> > most of the time a L[ist reply] only gets a single address.
> > 
> > -- 
> > Chris Green
> 
> It seems odd that a mailing list would have two
> addresses. Presumably the are interchangeable. If so,
> perhaps you could use procmail or imapfilter to replace
> all instances of one of the addresses with the other as
> the email arrives. That way, when you read it, mutt
> only sees one of the addresses.
> 
It's the only list I'm on that's like this.  I have a custom filter
program handling incoming mail so I *could* add a special rule but it
would have to step outside the normal logic of the filter.

If I replace all occurrences of one address with the other won't mutt
then simply send a L[ist reply] to the same address twice? ... or does
mutt have internal logic such that it won't send mail to duplicated
addresses?

-- 
Chris Green


Re: Is there a hook for modifying a To: field?

2020-08-24 Thread Cameron Simpson
On 24Aug2020 10:32, Chris Green  wrote:
>I am on a mailing list which has two addresses, occasionally when one
>does L[ist reply] the To: address is:-
>
>ix...@ixiemaster.ixion.org.uk, Ixilist 
>
>At present I normally notice this and remove one of the addresses but
>it would be nice if I could automate this.  Is there a hook (send_hook
>maybe) that can be used to change this?  It can't just change every
>case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
>most of the time a L[ist reply] only gets a single address.

Can you show the headers of such a message which produces this To: 
header? And do you have any mutt list subscription settings for these 
lists?

[ Personally I use (g)roup-reply and then edit the headers, but I'm 
weird. ]

Cheers,
Cameron Simpson 


Re: Is there a hook for modifying a To: field?

2020-08-24 Thread raf
On Mon, Aug 24, 2020 at 10:32:56AM +0100, Chris Green  wrote:

> I am on a mailing list which has two addresses, occasionally when one
> does L[ist reply] the To: address is:-
> 
> ix...@ixiemaster.ixion.org.uk, Ixilist 
> 
> At present I normally notice this and remove one of the addresses but
> it would be nice if I could automate this.  Is there a hook (send_hook
> maybe) that can be used to change this?  It can't just change every
> case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
> most of the time a L[ist reply] only gets a single address.
> 
> -- 
> Chris Green

It seems odd that a mailing list would have two
addresses. Presumably the are interchangeable. If so,
perhaps you could use procmail or imapfilter to replace
all instances of one of the addresses with the other as
the email arrives. That way, when you read it, mutt
only sees one of the addresses.

cheers,
raf



Is there a hook for modifying a To: field?

2020-08-24 Thread Chris Green
I am on a mailing list which has two addresses, occasionally when one
does L[ist reply] the To: address is:-

ix...@ixiemaster.ixion.org.uk, Ixilist 

At present I normally notice this and remove one of the addresses but
it would be nice if I could automate this.  Is there a hook (send_hook
maybe) that can be used to change this?  It can't just change every
case of either ix...@ixiemaster.ixion.org.uk or ix...@ixion.org.uk as
most of the time a L[ist reply] only gets a single address.

-- 
Chris Green


Re: I need some clarification of what 'reply-hook' does please

2018-10-15 Thread Chris Green
On Mon, Oct 15, 2018 at 12:34:18PM -0700, Kevin J. McCarthy wrote:
> On Mon, Oct 15, 2018 at 07:46:00PM +0100, Chris Green wrote:
> > When the documentation says "reply-hook is matched against the message
> > you are replying to," does that mean I can use it to hook all messages
> > sent to just one of my 'alternates' addresses?
> > 
> > I want to execute an action only when I am replying to an E-Mail which
> > has been sent to 'c...@isbd.net' and not one sent to any of my other
> > addresses.  Will reply-hook do this for me?
> 
> Yes, pattern operators will be matched against the message you are
> replying to.
> 
> They will be matched using the order specified in your muttrc, so you
> should apply default settings first, and then more specific overrides
> afterwards:
> 
>   reply-hook ~A 'unset bar' # Default bar off
>   reply-hook '~t ^cl@\.net$' 'set bar'  # Except for this address
> 
Thank you, that's brilliant.

-- 
Chris Green


Re: I need some clarification of what 'reply-hook' does please

2018-10-15 Thread Kevin J. McCarthy
On Mon, Oct 15, 2018 at 07:46:00PM +0100, Chris Green wrote:
> When the documentation says "reply-hook is matched against the message
> you are replying to," does that mean I can use it to hook all messages
> sent to just one of my 'alternates' addresses?
> 
> I want to execute an action only when I am replying to an E-Mail which
> has been sent to 'c...@isbd.net' and not one sent to any of my other
> addresses.  Will reply-hook do this for me?

Yes, pattern operators will be matched against the message you are
replying to.

They will be matched using the order specified in your muttrc, so you
should apply default settings first, and then more specific overrides
afterwards:

  reply-hook ~A 'unset bar' # Default bar off
  reply-hook '~t ^cl@\.net$' 'set bar'  # Except for this address

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


I need some clarification of what 'reply-hook' does please

2018-10-15 Thread Chris Green
When the documentation says "reply-hook is matched against the message
you are replying to," does that mean I can use it to hook all messages
sent to just one of my 'alternates' addresses?

I want to execute an action only when I am replying to an E-Mail which
has been sent to 'c...@isbd.net' and not one sent to any of my other
addresses.  Will reply-hook do this for me?

-- 
Chris Green


Re: mailing list hook

2018-10-08 Thread Will Yardley
On Sun, Oct 07, 2018 at 09:58:31PM -0700, Ian Zimmerman wrote:
> On 2018-10-07 22:45, Ben Fitzgerald wrote:
> 
> > when I configure a list with "lists", list-reply knows to
> > reply to the mailing list. All great.
> 
> In fact the "lists" command is not relevant or necessary for this.  List
> reply simply selects the address in the List-Post header.  I remember I
> was confused about this too when I was learning mutt.

I think that's true in the case where the list adds rfc2369 headers.

However, it's still probably a good idea to configure lists / subscribe
either way.
 
w



Re: mailing list hook

2018-10-07 Thread Ian Zimmerman
On 2018-10-07 22:45, Ben Fitzgerald wrote:

> when I configure a list with "lists", list-reply knows to
> reply to the mailing list. All great.

In fact the "lists" command is not relevant or necessary for this.  List
reply simply selects the address in the List-Post header.  I remember I
was confused about this too when I was learning mutt.

> When I select a folder for a given mailing list and then
> want to mail the start of a new thread, simply hitting "m"
> (bound to ) ought, in my mind, to auto-populate the
> mailing list.

> How can I achieve this with a folder-hook to bind a macro?

I used to have a myhdr command in a folder hook for each mailing list.
But now I find it easier and simpler to just have aliases for them.  It
also means I can post to any list from any folder, which makes for a
less "modal" interface.

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.


mailing list hook

2018-10-07 Thread Ben Fitzgerald
Hi,

when I configure a list with "lists", list-reply knows to
reply to the mailing list. All great.

When I select a folder for a given mailing list and then
want to mail the start of a new thread, simply hitting "m"
(bound to ) ought, in my mind, to auto-populate the
mailing list.

How can I achieve this with a folder-hook to bind a macro?

I started with a macro but it's mailing to us...@mutt.org

macro index m "mutt-users@mutt.org"

regards,

-- 
Ben Fitzgerald


Re: limit in folder hook?

2018-08-22 Thread Alexander Dahl
Hei hei,

On Wed, Aug 22, 2018 at 03:40:15PM +0200, Francesco Ariis wrote:
> On Wed, Aug 22, 2018 at 03:36:54PM +0200, Alexander Dahl wrote:
> >   folder-hook .   push "."
> >   folder-hook =Lists/buildroot'push "!=s \"git commit\""'
> 
> Can't test now, but first one looks not correct, it should be
> 
> folder-hook . 'push .'
> # quoting is before `push`
> 
> Does this work?

I think so, at least it brought me on the right track. What I got now
is this line only (with my own mailserver of course):

folder-hook imaps://a...@mail.example.com/Lists/buildroot 'push "!=s 
\"git commit\""'

First thing I got wrong was the regex for the folder, apparently I
need something like the above. Second thing was the quoting. The above
seems to work like I want it to. Third thing: no "reset" is necessary,
when changing folders/mailboxes with the key c the limit is reset by
mutt anyway.

Thanks and Greets
Alex

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
 X  AGAINST  | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL| (Jean-Luc Picard, quoting Judge Aaron Satie)


signature.asc
Description: PGP signature


Re: limit in folder hook?

2018-08-22 Thread Francesco Ariis
Hello Alexander,

On Wed, Aug 22, 2018 at 03:36:54PM +0200, Alexander Dahl wrote:
>   folder-hook .   push "."
>   folder-hook =Lists/buildroot'push "!=s \"git commit\""'

Can't test now, but first one looks not correct, it should be

folder-hook . 'push .'
# quoting is before `push`

Does this work?


limit in folder hook?

2018-08-22 Thread Alexander Dahl
Hei hei,

I have a limit pattern which works interactively, but which I can not
get to work as a folder hook. This is what I use when hitting the l
key in the index, and which works fine:

  !=s "git commit"

If I want to set that as a folder hook, from the manual I understood,
that I must use push and , but I don't get the escaping right.
mutt always says:

  : 'unknown command'
  
So I guess I'm doing the quoting wrong. This is what I have in my
~/.mutt/muttrc and in the separate folder-hooks file:

  source ~/.mutt/folder-hooks


  folder-hook .   push "."
  folder-hook =Lists/buildroot'push "!=s \"git commit\""'

The first hook is to reset the limit on all folders, the second to set
the limit pattern on the folder for the buildroot mailing list.

Could someone please enlighten me?

Greets
Alex

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
 X  AGAINST  | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL| (Jean-Luc Picard, quoting Judge Aaron Satie)


signature.asc
Description: PGP signature


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

2017-12-31 Thread Arkadiusz Drabczyk
On Sat, Dec 30, 2017 at 11:42:41PM +0300, Oleg A. Mamontov wrote:
> Thank you for suggestion and explanation, but do I understand right that
> there is no way to create internal mutt variable ($my_foo) as
> modification of another one ($my_bar)?

None that I'm aware of.
-- 
Arkadiusz Drabczyk 


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

2017-12-30 Thread Oleg A. Mamontov

On Fri, Dec 29, 2017 at 07:27:14AM +, Arkadiusz Drabczyk wrote:

On Thu, Dec 28, 2017 at 07:07:57PM +0300, Oleg A. Mamontov wrote:

Hello,

On Tue, Dec 26, 2017 at 03:23:50PM +, 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 for sharing such an interesting approach. How can it be extended to
remove the '=' starting character? I've tried to do following:

folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=`echo 
$record | sed s/=//`; set record=$my_oldrecord'

But unfortunately it doesn't work for some reason.


The best I could come up with:

folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
set record=$my_oldrecord'
folder-hook . 'push "!touch /tmp/$(echo ${my_folder} | sed 's,^=,,)-touched\n"'

The reason the solution you tried doesn't work is probably because
mutt performs shell substitution before parsing the line as said in
the manual:

"It is also possible to substitute the output of a Unix command in an
initialization file. This is accomplished by enclosing the command in
backticks (``). In Example 3.5, "Using external command's output in
configuration files", the output of the Unix command "uname -a" will
be substituted before the line is parsed."

So what shell sees is:

$ echo | sed s/=//


Thank you for suggestion and explanation, but do I understand right that 
there is no way to create internal mutt variable ($my_foo) as

modification of another one ($my_bar)?



--
Arkadiusz Drabczyk <arkadi...@drabczyk.org>


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

skype:  lonerr11
cell:   +7 (903) 798-1352


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

2017-12-28 Thread Arkadiusz Drabczyk
On Thu, Dec 28, 2017 at 07:07:57PM +0300, Oleg A. Mamontov wrote:
> Hello,
> 
> On Tue, Dec 26, 2017 at 03:23:50PM +, 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 for sharing such an interesting approach. How can it be extended to
> remove the '=' starting character? I've tried to do following:
> 
> folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=`echo 
> $record | sed s/=//`; set record=$my_oldrecord'
> 
> But unfortunately it doesn't work for some reason.

The best I could come up with:

folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
set record=$my_oldrecord'
folder-hook . 'push "!touch /tmp/$(echo ${my_folder} | sed 's,^=,,)-touched\n"'

The reason the solution you tried doesn't work is probably because
mutt performs shell substitution before parsing the line as said in
the manual:

"It is also possible to substitute the output of a Unix command in an
initialization file. This is accomplished by enclosing the command in
backticks (``). In Example 3.5, "Using external command's output in
configuration files", the output of the Unix command "uname -a" will
be substituted before the line is parsed."

So what shell sees is:

$ echo | sed s/=//

-- 
Arkadiusz Drabczyk <arkadi...@drabczyk.org>


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

2017-12-28 Thread Oleg A. Mamontov

Hello,

On Tue, Dec 26, 2017 at 03:23:50PM +, 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 for sharing such an interesting approach. How can it be extended 
to remove the '=' starting character? I've tried to do following:


folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=`echo 
$record | sed s/=//`; set record=$my_oldrecord'

But unfortunately it doesn't work for some reason.

--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

skype:  lonerr11
cell:   +7 (903) 798-1352


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 <arkadi...@drabczyk.org>


reference the folder name in a folder-hook push command

2017-12-25 Thread Yubin Ruan
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?

(actually I just want to pass as argument the name of a mbox to some external
shell command)


Regards,
Yubin


Re: Need some help with send-hook and folder-hook, their order in muttrc

2017-11-11 Thread Jason
On Tue, Nov 07, 2017 at 10:17:04AM +, Chris Green wrote:
> I want messages sent from one particular folder to have a different
> From: address.
> 
> Currently the only settings I have in my muttrc that affect the From:
> address are:-
> 
> send-hook .  'my_hdr From: Chris Green <ch...@isbd.co.uk>'
> ...
> ...
> send-hook ~l 'my_hdr From: Chris Green <c...@isbd.net>'
> 
> 
> I use the c...@isbd.net address for all my mailing lists.
> 
> 
> I'd like to make it so that when I'm in a particular folder (which
> will probably be called 'cl') my From: address will also be
> c...@isbd.net. 
> 
> So I need to add something like:-
> 
> folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'
> 
> However I'm a little unclear what else I need, do I need something
> like:-
> 
> folder-hook . 'my_hdr From: Chris Green <ch...@isbd.co.uk>'
> 
> and does it go before or after the specific 'cl one?  Plus, do these
> two settings make the send-hook setting of my From: address redundant?
> I still need the 'send hook ~l' one of course.
> 

Couldn't you just do something like this:

folder-hook . 'set from=ch...@isbd.co.uk; set realname="Chris Green"'
folder-hook /path/to/cl 'set from=c...@isbd.net; set realname="Chris Green"'

The first line sets the default and the second line sets it for the cl
folder. Although I'm not sure how this interacts with your send-hook
lines; maybe you'd need to remove the 'send-hook . ' line.

-- 
Jason



Re: Need some help with send-hook and folder-hook, their order in muttrc

2017-11-10 Thread Chris Green
On Tue, Nov 07, 2017 at 09:32:09PM +, David Woodfall wrote:
> > On Tue, Nov 07, 2017 at 08:49:06AM -0800, Ian Zimmerman wrote:
> > > On 2017-11-07 10:17, Chris Green wrote:
> > > 
> > > > I'd like to make it so that when I'm in a particular folder (which
> > > > will probably be called 'cl') my From: address will also be
> > > > c...@isbd.net.
> > > >
> > > > So I need to add something like:-
> > > >
> > > > folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'
> > > >
> > > > However I'm a little unclear what else I need,
> > > 
> > > If you use my_hdr in folder hooks at all, you probably need something
> > > like this line, from my own .muttrc:
> > > 
> > > folder-hook . "unmy_hdr to from reply-to bcc newsgroups x-loosely-listed"
> > > 
> > > >From my experience, you'll never be able to keep track of them
> > > individually and add the return-to-default hook for each header 
> > > separately.
> > > 
> > OK, it seems to get rather messy.
> > 
> > I think it may be easier to have a macro which
> > 
> >Changes my_hdr
> >Sends the message
> >    Changes my_hdr back
> > 
> > -- 
> > Chris Green
> 
> What I do is have a hooks file which runs other hooks files depending
> on the folder:
> 
Ah, now that's clever, it might well do exactly what I need in a way
that I can understand, thanks.


> My .mutt/hooks:
> 
> folder-hook 'imaps://domain/.*' source ~/.mutt/default
> folder-hook =lists/* source ~/.mutt/listhook
> 
> My .mutt/default
> 
> my_hdr From: David Woodfall <d...@somedomain.net>
> set sort=threads
> 
> My .mutt/listhook:
> 
> set collapse-all
> set sort=threads
> my_hdr From: David Woodfall <d...@dawoodfall.net>
> 
Thanks for that, it looks very close to the sort of thing I want to do.

-- 
Chris Green


Re: Need some help with send-hook and folder-hook, their order in muttrc

2017-11-07 Thread David Woodfall

On Tue, Nov 07, 2017 at 08:49:06AM -0800, Ian Zimmerman wrote:

On 2017-11-07 10:17, Chris Green wrote:

> I'd like to make it so that when I'm in a particular folder (which
> will probably be called 'cl') my From: address will also be
> c...@isbd.net.
>
> So I need to add something like:-
>
> folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'
>
> However I'm a little unclear what else I need,

If you use my_hdr in folder hooks at all, you probably need something
like this line, from my own .muttrc:

folder-hook . "unmy_hdr to from reply-to bcc newsgroups x-loosely-listed"

>From my experience, you'll never be able to keep track of them
individually and add the return-to-default hook for each header separately.


OK, it seems to get rather messy.

I think it may be easier to have a macro which

   Changes my_hdr
   Sends the message
   Changes my_hdr back

--
Chris Green


What I do is have a hooks file which runs other hooks files depending
on the folder:

My .mutt/hooks:

folder-hook 'imaps://domain/.*' source ~/.mutt/default
folder-hook =lists/* source ~/.mutt/listhook

My .mutt/default

my_hdr From: David Woodfall <d...@somedomain.net>
set sort=threads

My .mutt/listhook:

set collapse-all
set sort=threads
my_hdr From: David Woodfall <d...@dawoodfall.net>

The default file will set the header back after it has been changed in
the lists folder.


Re: Need some help with send-hook and folder-hook, their order in muttrc

2017-11-07 Thread Chris Green
On Tue, Nov 07, 2017 at 08:49:06AM -0800, Ian Zimmerman wrote:
> On 2017-11-07 10:17, Chris Green wrote:
> 
> > I'd like to make it so that when I'm in a particular folder (which
> > will probably be called 'cl') my From: address will also be
> > c...@isbd.net. 
> > 
> > So I need to add something like:-
> > 
> > folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'
> > 
> > However I'm a little unclear what else I need, 
> 
> If you use my_hdr in folder hooks at all, you probably need something
> like this line, from my own .muttrc:
> 
> folder-hook . "unmy_hdr to from reply-to bcc newsgroups x-loosely-listed"
> 
> >From my experience, you'll never be able to keep track of them
> individually and add the return-to-default hook for each header separately.
> 
OK, it seems to get rather messy.

I think it may be easier to have a macro which

Changes my_hdr
Sends the message
Changes my_hdr back

-- 
Chris Green


Re: Need some help with send-hook and folder-hook, their order in muttrc

2017-11-07 Thread Ian Zimmerman
On 2017-11-07 10:17, Chris Green wrote:

> I'd like to make it so that when I'm in a particular folder (which
> will probably be called 'cl') my From: address will also be
> c...@isbd.net. 
> 
> So I need to add something like:-
> 
> folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'
> 
> However I'm a little unclear what else I need, 

If you use my_hdr in folder hooks at all, you probably need something
like this line, from my own .muttrc:

folder-hook . "unmy_hdr to from reply-to bcc newsgroups x-loosely-listed"

>From my experience, you'll never be able to keep track of them
individually and add the return-to-default hook for each header separately.

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.


Need some help with send-hook and folder-hook, their order in muttrc

2017-11-07 Thread Chris Green
I want messages sent from one particular folder to have a different
From: address.

Currently the only settings I have in my muttrc that affect the From:
address are:-

send-hook .  'my_hdr From: Chris Green <ch...@isbd.co.uk>'
...
...
    send-hook ~l 'my_hdr From: Chris Green <c...@isbd.net>'


I use the c...@isbd.net address for all my mailing lists.


I'd like to make it so that when I'm in a particular folder (which
will probably be called 'cl') my From: address will also be
c...@isbd.net. 

So I need to add something like:-

    folder-hook cl 'my_hdr From: Chris Green <c...@isbd.net>'

However I'm a little unclear what else I need, do I need something
like:-

folder-hook . 'my_hdr From: Chris Green <ch...@isbd.co.uk>'

and does it go before or after the specific 'cl one?  Plus, do these
two settings make the send-hook setting of my From: address redundant?
I still need the 'send hook ~l' one of course.

-- 
Chris Green


Re: message-hook to run scripts

2016-09-01 Thread Matthias Beyer
Hey,

wow, this is an awesome idea!

While I do not care about marking github issues read/unread, this is 
still a good inspiration for a message hooks I might develop to notify 
myself about new mail in certain cases, using notify-send! Thanks a 
lot for sharing!

Matthias

On 11-08-2016 20:50:08, Keith Smiley wrote:
> Hey everyone,
> 
> I've had a long running problem with my mutt configuration when using
> message-hook to run a script for unread messages. The configuration looks like
> this:
> 
> ```
> message-hook '~U !~T ~f notifications@github\.com' \
>   "push 'set my_old_pipe_decode=\$pipe_decode \
>   nopipe_decode \
>   ghnotification.sh \
>   set pipe_decode=\$my_old_pipe_decode'"
> ```
> 
> Full code here:
> 
> https://github.com/keith/dotfiles/commit/2071bd80f5d2b44189a1ed6d2aaf00085eaf719f
> 
> The intention here is to run a script that curls the magic image in GitHub
> emails to mark them as read on GitHub. Doing this for unread (and as an
> optimization for the problem, also untagged) messages works fine from the 
> index.
> If I open a message from the index, the script is executed correctly. The
> problem comes when I *delete* an *unread* email from the index. In this case 
> it
> seems that the command is interpreted as a series of key presses. This results
> in a directory being created locally called:
> 
> ```
> enter-command>set my_old_pipe_decode (etc)
> ```
> 
> It seems that the problem is in how I'm executing the command doesn't work 
> with
> my delete command:
> 
> ```
> macro index,pager d "+gmail/trash" "Delete message"
> ```
> 
> Any advice on how to work around this would be greatly appreciated!
> 
> 
> Thanks for reading!
> 
> --
> Keith Smiley
> 

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.


signature.asc
Description: PGP signature


Re: send2-hook can't change Reply-To

2016-08-26 Thread Gabriel Philippe
On Wed, Aug 24, 2016 at 10:48 PM, Michael Elkins <m...@sigpipe.org> wrote:
> On Wed, Aug 24, 2016 at 01:28:22PM +0200, Gabriel Philippe wrote:
>>
>> From the manual: "Also note that my_hdr commands which modify
>> recipient headers, or the message's subject, don't have any effect on
>> the current message when executed from a send-hook."
>
>
> The manual is correct on this point.  send2-hook can't be used to modify the
> message header, because Mutt is not smart enough to be able to avoid
> overwriting modifications the user may make in their editor.

I understand, thanks for your answer.

Maybe the manual is not accurate:
- it should indicate send2-hook and not send-hook,
- it should not only limit the remark to "recipient headers" and "subject".

-- 
Gabriel


Re: send2-hook can't change Reply-To

2016-08-24 Thread Michael Elkins

On Wed, Aug 24, 2016 at 01:28:22PM +0200, Gabriel Philippe wrote:

From the manual: "Also note that my_hdr commands which modify
recipient headers, or the message's subject, don't have any effect on
the current message when executed from a send-hook."


The manual is correct on this point.  send2-hook can't be used to modify the
message header, because Mutt is not smart enough to be able to avoid
overwriting modifications the user may make in their editor.  The `my_hdr`
commands are only processed initially when the message is first constructed
(after `send-hook` is processed, which is why that version works).

me


[SPAM?] send2-hook can't change Reply-To

2016-08-24 Thread Gabriel Philippe
I have been using send-hooks to add reply-to headers.

send-hook . unmy_hdr 'Reply-To:'
send-hook "~C l...@whatever.tld" my_hdr 'Reply-To: l...@whatever.tld'

This works (and maybe shouldn't, according to the manual). But I would
like using send2-hooks instead, and... no success. I have tried
removing "~C " in the hook (pattern/regexp matching).

>From the manual: "Also note that my_hdr commands which modify
recipient headers, or the message's subject, don't have any effect on
the current message when executed from a send-hook."

Any idea?

-- 
Gabriel


message-hook to run scripts

2016-08-11 Thread Keith Smiley
Hey everyone,

I've had a long running problem with my mutt configuration when using
message-hook to run a script for unread messages. The configuration looks like
this:

```
message-hook '~U !~T ~f notifications@github\.com' \
  "push 'set my_old_pipe_decode=\$pipe_decode \
  nopipe_decode \
  ghnotification.sh \
  set pipe_decode=\$my_old_pipe_decode'"
```

Full code here:

https://github.com/keith/dotfiles/commit/2071bd80f5d2b44189a1ed6d2aaf00085eaf719f

The intention here is to run a script that curls the magic image in GitHub
emails to mark them as read on GitHub. Doing this for unread (and as an
optimization for the problem, also untagged) messages works fine from the index.
If I open a message from the index, the script is executed correctly. The
problem comes when I *delete* an *unread* email from the index. In this case it
seems that the command is interpreted as a series of key presses. This results
in a directory being created locally called:

```
enter-command>set my_old_pipe_decode (etc)
```

It seems that the problem is in how I'm executing the command doesn't work with
my delete command:

```
macro index,pager d "+gmail/trash" "Delete message"
```

Any advice on how to work around this would be greatly appreciated!


Thanks for reading!

--
Keith Smiley



folder-hook and mutt -f flag

2016-08-03 Thread mszamot
Hello,

When I open a mailbox with `mutt -f mailbox` none of folder-hook's is
executing.  Is there a way to make them run?

And a second question: when I exit mutt, usually by pressing CTRL-C, the
mailbox is not saved, i.e. if I don't save it explicitly I loose flags
that were set, for example that a message was read.  Is there a way to
save a mailbox by default on exit.

Thanks for help,
Marcin


signature.asc
Description: Digital signature


SOLVED (was: Re: how to escape complex pattern for folder-hook?)

2016-07-30 Thread Gregor Zattler
Hi Andre, mutt users,
* Andre Majorel <aym-t...@teaser.fr> [28. Jul. 2016]:
> On 2016-07-25 23:44 +0200, Gregor Zattler wrote:
> 
>> I get status emails in some mail folder which I occasionally
>> delete with delete-pattern (bound to "D") and this pattern: 
>> 
>> ~s"Cron <grfz@len> nice ionice -c 3 ~/bin/my-notmuch-new-and-tagging"   
>> ~b^"No new mail." !~b"^Processed"
>> 
>> 
>> I would like to do this via a folder-hook like this:
>> 
>> folder-hook +root 'push ~s"Cron <grfz@len> nice ionice -c 3 
>> ~/bin/my-notmuch-new-and-tagging"   ~b^"No new mail." !~b"^Processed"'
>> 
>> but I don't know how to quote or escape the second argument.  I
>> always get error messages "too many arguments".
>> 
>> Can anyone please explain what I'm doung wrong?
> 
> Ah, the joys of nested quoting. "push" takes only one argument

that's it!

> so you must find a way to make everything from « <delete » to
> « Processed" » look like one argument. You could try adding
> backslashes before every white space character therein.

I did so and had to also quote '"': 
folder-hook +root   'push ~s\"Cron\ <grfz@len>\ nice\ 
ionice\ -c\ 3\ ~/bin/my-notmuch-new-and-tagging\"\ ~b^"No\ new\ mail.\"\ 
!~b^Processed'

Thank you for your helpful explanation.
Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



Re: how to escape complex pattern for folder-hook?

2016-07-28 Thread Andre Majorel
On 2016-07-25 23:44 +0200, Gregor Zattler wrote:

> I get status emails in some mail folder which I occasionally
> delete with delete-pattern (bound to "D") and this pattern: 
> 
> ~s"Cron <grfz@len> nice ionice -c 3 ~/bin/my-notmuch-new-and-tagging"   
> ~b^"No new mail." !~b"^Processed"
> 
> 
> I would like to do this via a folder-hook like this:
> 
> folder-hook +root 'push ~s"Cron <grfz@len> nice ionice -c 3 
> ~/bin/my-notmuch-new-and-tagging"   ~b^"No new mail." !~b"^Processed"'
> 
> but I don't know how to quote or escape the second argument.  I
> always get error messages "too many arguments".
> 
> Can anyone please explain what I'm doung wrong?

Ah, the joys of nested quoting. "push" takes only one argument
so you must find a way to make everything from « <delete » to
« Processed" » look like one argument. You could try adding
backslashes before every white space character therein.

-- 
André Majorel http://www.teaser.fr/~amajorel/


  1   2   3   4   5   6   7   8   9   10   >