Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread raf
On Mon, Feb 15, 2021 at 06:04:03PM -0600, boB Stepp  
wrote:

> On 21/02/16 12:28AM, Øyvind A. Holm wrote:
> > On 2021-02-16 00:17:22, Øyvind A. Holm wrote:
> > > On 2021-02-15 16:01:06, boB Stepp wrote:
> > > > > On Monday, 15 February at 21:53, boB Stepp wrote:
> > > > > > And from reading the Mutt manual I have encountered the
> > > > > > alternates option, but now I am not sure what it is useful for
> > > > > > and how to most effectively use it.
> > > >
> > > > And "alternates" is still a mystery...
> > > 
> > > It is used if you have any alternate or old email addresses.
> > > `alternates` makes it possible for Mutt to mark messages in the index
> > > with "F" (from one of your addresses), "+" or "T" (to one of your
> > > addresses), etc. For example,
> > > 
> > >alternates job_em...@example.net
> > >alternates old_em...@example.com
> > >alternates another_...@example.org
> > > 
> > > Now Mutt knows that all these addresses belong to you.
> > 
> > A small correction (even though the above example will work). The
> > parameter after `alternates` is a regexp, so a more correct way to write
> > them would be
> > 
> >alternates ^job_email@example\.net$
> >alternates ^old_email@example\.com$
> >alternates ^another_old@example\.org$
> > 
> > to avoid false positives with for example "yet_another_...@example.org".
> 
> So is this mostly to provide labeling information in the index?  I suppose it
> might be usable for some sort of filtering purposes...
> 
> -- 
> Wishing you only the best,
> 
> boB Stepp

Alternates is also relevant for the reverse_name setting:

   reverse_name
 Type: boolean
 Default: no

 It may sometimes arrive that you receive mail to a
 certain  machine,  move  the  messages  to
 another machine, and reply to some the messages
 from there.  If this variable is set, the default
 From: line of the reply messages is built using
 the address where you received the messages you
 are  replying  to  if that  address  matches  your
 “alternates”.  If the variable is unset, or the
 address that would be used doesn't match your
 “alternates”, the From: line will use your address
 on the current machine.

 Also see the “alternates” command.

Very handy when you have hundreds of email addresses.

cheers,
raf



Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread Øyvind A . Holm
On 2021-02-15 18:04:03, boB Stepp wrote:
> On 21/02/16 00:28, Øyvind A. Holm wrote:
> > On 2021-02-16 00:17:22, Øyvind A. Holm wrote:
> > > On 2021-02-15 16:01:06, boB Stepp wrote:
> > > > And "alternates" is still a mystery...
> > >
> > > It is used if you have any alternate or old email addresses. 
> > > `alternates` makes it possible for Mutt to mark messages in the 
> > > index with "F" (from one of your addresses), "+" or "T" (to one of 
> > > your addresses), etc. For example,
> > >
> > >alternates job_em...@example.net
> > >alternates old_em...@example.com
> > >alternates another_...@example.org
> > >
> > > Now Mutt knows that all these addresses belong to you.
> >
> > A small correction (even though the above example will work). The 
> > parameter after `alternates` is a regexp, so a more correct way to 
> > write them would be
> >
> >alternates ^job_email@example\.net$
> >alternates ^old_email@example\.com$
> >alternates ^another_old@example\.org$
> >
> > to avoid false positives with for example 
> > "yet_another_...@example.org".
>
> So is this mostly to provide labeling information in the index?  I 
> suppose it might be usable for some sort of filtering purposes...

Yes, it also works with limiting ("l") and search ("/") in the index. 
For example,

~P|~p

will search for or limit the view to all mails to/from you. It also 
makes reply a bit more intelligent. For example, when I replied to the 
first mail I sent it didn't address it to me, but either you ("r") or 
the list ("L").

Regards,
Øyvind

geo:60.38,5.33;u=500
OpenPGP fingerprint: A006 05D6 E676 B319 55E2  E77E FB0C BEE8 94A5 06E5
21039562-6feb-11eb-9c1a-5582e081d110


Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread boB Stepp

On 21/02/16 12:28AM, Øyvind A. Holm wrote:

On 2021-02-16 00:17:22, Øyvind A. Holm wrote:

On 2021-02-15 16:01:06, boB Stepp wrote:
> > On Monday, 15 February at 21:53, boB Stepp wrote:
> > > And from reading the Mutt manual I have encountered the
> > > alternates option, but now I am not sure what it is useful for
> > > and how to most effectively use it.
>
> And "alternates" is still a mystery...

It is used if you have any alternate or old email addresses.
`alternates` makes it possible for Mutt to mark messages in the index
with "F" (from one of your addresses), "+" or "T" (to one of your
addresses), etc. For example,

   alternates job_em...@example.net
   alternates old_em...@example.com
   alternates another_...@example.org

Now Mutt knows that all these addresses belong to you.


A small correction (even though the above example will work). The
parameter after `alternates` is a regexp, so a more correct way to write
them would be

   alternates ^job_email@example\.net$
   alternates ^old_email@example\.com$
   alternates ^another_old@example\.org$

to avoid false positives with for example "yet_another_...@example.org".


So is this mostly to provide labeling information in the index?  I suppose it
might be usable for some sort of filtering purposes...

--
Wishing you only the best,

boB Stepp


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 07:13:05PM +0100, Genética wrote:

On Mon, Feb 15, 2021 at 09:43:39AM -0800, Kevin J. McCarthy wrote:

On Mon, Feb 15, 2021 at 10:35:25AM +0100, Angel M Alganza wrote:

# Need to upgrade to > 1.8.0 (setenv)
folder-hook . 'set my_folder=$folder;set folder="XXX";set visual=^'
folder-hook . 'setenv MYSYNCFOLDER $visual'
folder-hook . 'set folder=$my_folder'
macro index \! "!/usr/bin/mbsync \$MYSYNCFOLDER\n"



That somehow works, as does:

 macro index \" "!/usr/bin/mbsync \$MYSYNCFOLDER\n"

But, when I use it, I get:

 No channel or group named '~/mail/mutt/' defined.

It seems that the folder hooks are fetching the current maildir name 
relative to my home, but mbsync would need its name relative to 
~/mail/?
Maybe adding some grep rule into the hooks would make that ~/mail/ part 
go away?


:echo $visual shows now:

  =mutt   or   =inbox

I only need to get rid of the trailing =, but I can't find the way to do 
it with grep.  I think that this should do it:


  folder-hook . 'set box = `echo $visual | sed \'s/=//g\'`'

But it doesn't.  I get a too many parameters error.  I guess it has to 
do with the nested quotation marks, but I don't see how to do it.


Cheers,
Ángel


Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread Øyvind A . Holm
On 2021-02-16 00:17:22, Øyvind A. Holm wrote:
> On 2021-02-15 16:01:06, boB Stepp wrote:
> > > On Monday, 15 February at 21:53, boB Stepp wrote:
> > > > And from reading the Mutt manual I have encountered the 
> > > > alternates option, but now I am not sure what it is useful for 
> > > > and how to most effectively use it.
> >
> > And "alternates" is still a mystery...
>
> It is used if you have any alternate or old email addresses. 
> `alternates` makes it possible for Mutt to mark messages in the index 
> with "F" (from one of your addresses), "+" or "T" (to one of your 
> addresses), etc. For example,
>
>alternates job_em...@example.net
>alternates old_em...@example.com
>alternates another_...@example.org
>
> Now Mutt knows that all these addresses belong to you.

A small correction (even though the above example will work). The 
parameter after `alternates` is a regexp, so a more correct way to write 
them would be

alternates ^job_email@example\.net$
alternates ^old_email@example\.com$
alternates ^another_old@example\.org$

to avoid false positives with for example "yet_another_...@example.org".

Regards,
Øyvind

geo:60.38,5.33;u=500
OpenPGP fingerprint: A006 05D6 E676 B319 55E2  E77E FB0C BEE8 94A5 06E5
b12c0f9a-6fe4-11eb-8623-5582e081d110


Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread Øyvind A . Holm
On 2021-02-15 16:01:06, boB Stepp wrote:
> > On Monday, 15 February at 21:53, boB Stepp wrote:
> > > And from reading the Mutt manual I have encountered the alternates 
> > > option, but now I am not sure what it is useful for and how to 
> > > most effectively use it.
>
> And "alternates" is still a mystery...

It is used if you have any alternate or old email addresses. 
`alternates` makes it possible for Mutt to mark messages in the index 
with "F" (from one of your addresses), "+" or "T" (to one of your 
addresses), etc. For example,

   alternates job_em...@example.net
   alternates old_em...@example.com
   alternates another_...@example.org

Now Mutt knows that all these addresses belong to you.

HTH,
Øyvind

geo:60.38,5.33;u=500
OpenPGP fingerprint: A006 05D6 E676 B319 55E2  E77E FB0C BEE8 94A5 06E5
ea237272-6fe2-11eb-8f99-5582e081d110


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Patrick Shanahan
* Cameron Simpson  [02-15-21 17:06]:
> On 15Feb2021 17:07, Chris Green  wrote:
> >Does no one else ever delete mail messges? :-)
> 
> Hmm:
> 
> [~/mail]fleet2*1> ls -ldh spam*
> -rw-rw-r--  1 cameron  cameron   1.7G 16 Feb 08:43 spam
> -rw-rw-r--  1 cameron  cameron   609M 16 Feb 08:46 spam-definite
> 
> Possibly not.
> 
> Can you tell mairix to not index the Junk folders?

certainly
omit=
in .mairixrc


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


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Tue, Feb 16, 2021 at 01:14:31AM +0300, Oleg A. Mamontov wrote:


'full' is the name of my mbsync channel defined in ~/.mbsynrc:
---
# full set of mailboxes
Channel full
...
---
It was just an example that you need to correct according to your mbsync
setup.


I see.  I group different channels on .mbsyncrc as groups:

  Group new
  Channel inbox
  Channel mutt

I don't understand the logic of your Channel full grouping other 
channels?  And I can't find any examples in the documentation.


Ángel


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Tue, Feb 16, 2021 at 01:02:38AM +0300, Oleg A. Mamontov wrote:


I guess your folder names differ from mine. You can debug step by step,
start from keeping only the first assignment:
---
set record = ^
---
Launch mutt and check the result pressing :echo $record
Then, you can adjust the sed pattern as needed and check the result 
again.


Ah, nice.  We are getting there!  :echo $record  shows:

  =inbox   or   =mutt

The trailing = needs to go!

Ángel


Re: Macro to apply on current mailbox

2021-02-15 Thread Oleg A. Mamontov

On Mon, Feb 15, 2021 at 10:58:22PM +0100, Angel M Alganza wrote:

On Mon, Feb 15, 2021 at 10:40:18PM +0100, Genética wrote:

On Tue, Feb 16, 2021 at 12:26:54AM +0300, Oleg A. Mamontov wrote:


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.


Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager o "mbsync full:$record"


Nice.  It shows that:

Shell command: mbsync full:


OK, now, I realized that the last two lines on your macro were 
actually a single line.  I fixed that and now I get:


 No channel or group named 'full' defined.


'full' is the name of my mbsync channel defined in ~/.mbsynrc:
---
# full set of mailboxes
Channel full
...
---
It was just an example that you need to correct according to your mbsync
setup.


Ángel


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

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


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Cameron Simpson
On 16Feb2021 09:05, Cameron Simpson  wrote:
>On 15Feb2021 17:07, Chris Green  wrote:
>>Does no one else ever delete mail messges? :-)
>
>Hmm:
>[~/mail]fleet2*1> ls -ldh spam*
>-rw-rw-r--  1 cameron  cameron   1.7G 16 Feb 08:43 spam
>-rw-rw-r--  1 cameron  cameron   609M 16 Feb 08:46 spam-definite

The other thing of note here is that these are mbox folders (like many 
of my less visited folders, for compactness). You could just move them 
sideways and remove "old" sideways folders? I guess that works for 
Maildir too, now that I think about it.

Cheers,
Cameron Simpson 


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Cameron Simpson
On 15Feb2021 17:07, Chris Green  wrote:
>Does no one else ever delete mail messges? :-)

Hmm:

[~/mail]fleet2*1> ls -ldh spam*
-rw-rw-r--  1 cameron  cameron   1.7G 16 Feb 08:43 spam
-rw-rw-r--  1 cameron  cameron   609M 16 Feb 08:46 spam-definite

Possibly not.

Can you tell mairix to not index the Junk folders?

Cheers,
Cameron Simpson 


Re: Macro to apply on current mailbox

2021-02-15 Thread Oleg A. Mamontov

On Mon, Feb 15, 2021 at 10:40:18PM +0100, Angel M Alganza wrote:

On Tue, Feb 16, 2021 at 12:26:54AM +0300, Oleg A. Mamontov wrote:


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.


Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager o "mbsync full:$record"


Nice.  It shows that:

 Shell command: mbsync full:

So, I must be doing something wrong.


Yes, it seems so :)
I guess your folder names differ from mine. You can debug step by step,
start from keeping only the first assignment:
---
set record = ^
---
Launch mutt and check the result pressing :echo $record
Then, you can adjust the sed pattern as needed and check the result again.


Ángel


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

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


Re: not to set message id in outgoing email

2021-02-15 Thread Cameron Simpson
On 15Feb2021 21:53, Shehu Dikko  wrote:
>* Peng Yu [20210203 20:23:18]:
>>I want the first MTA add one, instead of using the one generated by
>>mutt.
>
>One way to get what you want is to use esmtp:
>
># muttrc
>set sendmail="/usr/bin/esmtp"
>
># esmtprc
>identity = u...@ho.st
>  hostname = smtp.ho.st:587
>  username = u...@ho.st
>  password = password
>  starttls = enabled
>  message_id = disabled
>
># man esmtprc
>message_id
>
>  Whether to set the Message-ID field of the message before sending.
>  Normally the receiving MTA sets the Message-ID if missing, so you can
>  turn this off if your sending host does not have a fully qualified
>  domain name.
>
>  Allowed values are either enabled or disabled. It defaults to 
>  enabled.

Does that actually strip the one from mutt, or just prevent esmtp from 
_adding on if missing_. Peng Yu is trying to stop mutt adding a message 
id.

Maybe the objective can be achieved by stripping the mutt-provided 
message-id in the sendmail setting before it reaches the MTA?

Untested:

set sendmail="sed '1,/^\$/{/^Message-ID:/d'}' | /usr/bins/sendmail"

(The backslash if for mutt, not sed or the shell.)

Cheers,
Cameron Simpson 


Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread boB Stepp

On 21/02/15 10:33PM, Wim wrote:

On Monday, 15 February at 21:53, boB Stepp wrote:


...BTW, typing "Mu" into the "To:" field
and then hitting  does *not* fill in the email address; instead, it
brings up a browser view where I have to hit  before the address is
inserted.  Is there a way, when there are no conflicting "Mu" entries, to just
*immediately* have hitting  insert the address?


If you change your alias line to:

alias Mu Mutt-Users 

typing Mu and  will work, not .


Ah!  I was misunderstanding the function of  in expanding things.


I haven't done it yet, but what I would like to do is have different groups
that I can type a shortcut and have all the email addresses inserted.  For
instance, I would like to have a group "Kids" which when typed would
auto-expand into my kids' email addresses.  Also, I would like to be able to
type in abbreviations like "Jess" and have that expand to my daughter's email
address.  How would I go about doing this without having a browser view come
up with numbered entries?


I think what you want is this. Given the kids' email addresses:

alias Joe Josephine Murphy 
alias Moe Moe Murphy 

you can alias them as:

alias fam Joe Moe

and typing fam and  will auto-expand.


Yep, this works.  Thanks!

So what is the purpose of "group"?  How can it help me?



And from reading the Mutt manual I have encountered the alternates option, but
now I am not sure what it is useful for and how to most effectively use it.


And "alternates" is still a mystery...

--
Wishing you only the best,

boB Stepp


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 10:40:18PM +0100, Genética wrote:

On Tue, Feb 16, 2021 at 12:26:54AM +0300, Oleg A. Mamontov wrote:


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.


Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager o "mbsync full:$record"


Nice.  It shows that:

 Shell command: mbsync full:


OK, now, I realized that the last two lines on your macro were actually 
a single line.  I fixed that and now I get:


  No channel or group named 'full' defined.

Ángel


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Tue, Feb 16, 2021 at 12:26:54AM +0300, Oleg A. Mamontov wrote:


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.


Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager o "mbsync full:$record"


Nice.  It shows that:

  Shell command: mbsync full:

So, I must be doing something wrong.

Ángel


Re: Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread Wim
Hi boB,

On Monday, 15 February at 21:53, boB Stepp wrote:

> The current ongoing thread about lists and subscribe have led to my email.  I
> don't think I am understanding the differences and interactions to these
> different Mutt configuration possibilities.
>
> From the other thread if I am understanding correctly for those mailing lists
> that I am subscribed to and actively participating in in real life, it is to 
> my benefit to set these up with
> setting subscribe for each such list.  For these lists there is no point in my
> using the lists configuration option.  If I a just following a list, then
> using lists configuration option is probably more appropriate.
>
> As to the group option I was under the impression that I could give a nice
> shortcut name and assign a list of email addresses to it and then use it as an
> alias.  But that does not appear to be the case.  For instance I had forgotten
> to explicitly subscribe to Mutt-Users, so today added to my muttrc:
>
> subscribe -group Mutt-Users mutt-users@mutt.org
>

I've got a simple 'subscribe mutt-users' in my muttrc. It works.

Subscribing to a list allow replying to that list with 'L'.

> and had the expectation that since I used "-group", I could type "Mu" and hit
>  in the "To:" field and get the Mutt-Users address inserted.  I was sadly
> mistaken!  I had to explicitly add
>
> alias Mutt-Users 
>
> to my aliases file before that would occur.  So I am not seeing how to use
> "group".  Can someone explain please?  BTW, typing "Mu" into the "To:" field
> and then hitting  does *not* fill in the email address; instead, it
> brings up a browser view where I have to hit  before the address is
> inserted.  Is there a way, when there are no conflicting "Mu" entries, to just
> *immediately* have hitting  insert the address?
>

If you change your alias line to:

alias Mu Mutt-Users 

typing Mu and  will work, not .

> I haven't done it yet, but what I would like to do is have different groups
> that I can type a shortcut and have all the email addresses inserted.  For
> instance, I would like to have a group "Kids" which when typed would
> auto-expand into my kids' email addresses.  Also, I would like to be able to
> type in abbreviations like "Jess" and have that expand to my daughter's email
> address.  How would I go about doing this without having a browser view come
> up with numbered entries?

I think what you want is this. Given the kids' email addresses:

alias Joe Josephine Murphy 
alias Moe Moe Murphy 

you can alias them as:

alias fam Joe Moe

and typing fam and  will auto-expand.

>
> And from reading the Mutt manual I have encountered the alternates option, but
> now I am not sure what it is useful for and how to most effectively use it.
>
> I think that sums up most of my current head scratching.
>
> --
> Wishing you only the best,
>
> boB Stepp

--
  |\  _,,,---,,_
ZZZzz /,`.-'`'-.  ;-;;,_
 |,4-  ) )-,_. ,\ (  `'-'
'---''(_/--'  `-'\_)


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Felix Finch

On 20210215, Angel M Alganza wrote:

On Mon, Feb 15, 2021 at 12:49:53PM -0800, Felix Finch wrote:

On 20210215, Kevin J. McCarthy wrote:

You could write a script, I guess, something like:

cd $header_cache_dir
rm -f *


How well would that play with existing mutt sessions?  I run several 
mutts inside tmux (local mail, work IMAP mail, etc), and sessions 
will run for weeks.


With no problem.  When it doesn't find a cache, it'll make a new one.


Right, but what if it discovers the new cache while half-built?  Or what if it 
discovers no cache between the rm and the build, and they try to build it at 
the same time?

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
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


Re: Macro to apply on current mailbox

2021-02-15 Thread Oleg A. Mamontov

On Mon, Feb 15, 2021 at 10:16:33PM +0100, Angel M Alganza wrote:

On Tue, Feb 16, 2021 at 12:00:35AM +0300, Oleg A. Mamontov wrote:


The below approach works for me, probably it can be helpful somehow:

.muttrc
---
# the very first folder-hook
folder-hook . "source ~/.mutt/on-folder-change.muttrc"
---

# .mutt/on-folder-change.muttrc
---
set record = ^
set record = `echo $record | sed 's#.*/##'`
macro index,pager o ":unset wait_keyclear; mbsync 
full:$record:set wait_key" "sync current folder"
---


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.


Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager o "mbsync full:$record"
---
And check the resulting shell command before pressing Enter.


Thanks,
Ángel


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

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


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Tue, Feb 16, 2021 at 12:00:35AM +0300, Oleg A. Mamontov wrote:


The below approach works for me, probably it can be helpful somehow:

.muttrc
---
# the very first folder-hook
folder-hook . "source ~/.mutt/on-folder-change.muttrc"
---

# .mutt/on-folder-change.muttrc
---
set record = ^
set record = `echo $record | sed 's#.*/##'`
macro index,pager o ":unset wait_keyclear; mbsync 
full:$record:set wait_key" "sync current folder"
---


Then what should I do to mbsync the current maildir?
Hitting ESC-o doesn't seem to do it.

Thanks,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 12:49:53PM -0800, Felix Finch wrote:

On 20210215, Kevin J. McCarthy wrote:

You could write a script, I guess, something like:

cd $header_cache_dir
rm -f *


How well would that play with existing mutt sessions?  I run several 
mutts inside tmux (local mail, work IMAP mail, etc), and sessions will 
run for weeks.


With no problem.  When it doesn't find a cache, it'll make a new one.

Cheers,
Ángel


Re: Macro to apply on current mailbox

2021-02-15 Thread Oleg A. Mamontov

On Mon, Feb 15, 2021 at 07:13:05PM +0100, Angel M Alganza wrote:

On Mon, Feb 15, 2021 at 09:43:39AM -0800, Kevin J. McCarthy wrote:

On Mon, Feb 15, 2021 at 10:35:25AM +0100, Angel M Alganza wrote:

# Need to upgrade to > 1.8.0 (setenv)
folder-hook . 'set my_folder=$folder;set folder="XXX";set visual=^'
folder-hook . 'setenv MYSYNCFOLDER $visual'
folder-hook . 'set folder=$my_folder'
macro index \! "!/usr/bin/mbsync \$MYSYNCFOLDER\n"


You've overridden , bound to '!' by default, with your 
macro.  But then you are trying to use '!' inside the macro.  That's 
a loop - instead of calling  you are calling your 
macro inside the macro.


Oh boy!  That's embarrassing (even though I didn't write the macro, 
but I got it somewhere or from someone).  LOL


Also, I don't want to override  at all!  I was just 
using ! because it happens to be beside the " in my (Spanish) keyboard 
and now I'm using " in a macro to fetch my inbox like so:


 macro index  \" "!/usr/bin/mbsync inbox\n"
 macro pager  \" "!/usr/bin/mbsync inbox\n"

But, actually, I won't be needing that when I can fetch the current 
maildir I'm working in with the new macros I'm trying to get working, 
so, I'll be using " for that (in case I'm not missing something with 
overriding ", too).



Try (untested):
macro index \! "/usr/bin/mbsync \$MYSYNCFOLDER\n"


That somehow works, as does:

 macro index \" "!/usr/bin/mbsync \$MYSYNCFOLDER\n"

But, when I use it, I get:

 No channel or group named '~/mail/mutt/' defined.

It seems that the folder hooks are fetching the current maildir name 
relative to my home, but mbsync would need its name relative to 
~/mail/?
Maybe adding some grep rule into the hooks would make that ~/mail/ 
part go away?


The below approach works for me, probably it can be helpful somehow:

.muttrc
---
# the very first folder-hook
folder-hook . "source ~/.mutt/on-folder-change.muttrc"
---

# .mutt/on-folder-change.muttrc
---
set record = ^
set record = `echo $record | sed 's#.*/##'`
macro index,pager o ":unset wait_keyclear; mbsync 
full:$record:set wait_key" "sync current folder"
---


Cheers,
Ángel


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

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


Differences and interactions between subscribe, lists, group, alternates and alias.

2021-02-15 Thread boB Stepp

The current ongoing thread about lists and subscribe have led to my email.  I
don't think I am understanding the differences and interactions to these
different Mutt configuration possibilities.

From the other thread if I am understanding correctly for those mailing lists
that I am subscribed to and actively participating in in real life, it is to my 
benefit to set these up with
setting subscribe for each such list.  For these lists there is no point in my
using the lists configuration option.  If I a just following a list, then
using lists configuration option is probably more appropriate.

As to the group option I was under the impression that I could give a nice
shortcut name and assign a list of email addresses to it and then use it as an
alias.  But that does not appear to be the case.  For instance I had forgotten
to explicitly subscribe to Mutt-Users, so today added to my muttrc:

subscribe -group Mutt-Users mutt-users@mutt.org

and had the expectation that since I used "-group", I could type "Mu" and hit
 in the "To:" field and get the Mutt-Users address inserted.  I was sadly
mistaken!  I had to explicitly add

alias Mutt-Users 

to my aliases file before that would occur.  So I am not seeing how to use
"group".  Can someone explain please?  BTW, typing "Mu" into the "To:" field
and then hitting  does *not* fill in the email address; instead, it
brings up a browser view where I have to hit  before the address is
inserted.  Is there a way, when there are no conflicting "Mu" entries, to just
*immediately* have hitting  insert the address?

I haven't done it yet, but what I would like to do is have different groups
that I can type a shortcut and have all the email addresses inserted.  For
instance, I would like to have a group "Kids" which when typed would
auto-expand into my kids' email addresses.  Also, I would like to be able to
type in abbreviations like "Jess" and have that expand to my daughter's email
address.  How would I go about doing this without having a browser view come
up with numbered entries?

And from reading the Mutt manual I have encountered the alternates option, but
now I am not sure what it is useful for and how to most effectively use it.

I think that sums up most of my current head scratching.

--
Wishing you only the best,

boB Stepp


Re: not to set message id in outgoing email

2021-02-15 Thread Shehu Dikko
* Peng Yu [20210203 20:23:18]:
>On Wed, Feb 3, 2021 at 11:23 AM Will Yardley
> wrote:
>>
>> On Wed, Feb 03, 2021 at 08:57:32AM -0600, Peng Yu wrote:
>> >
>> > When I use mutt to construct an outgoing email, is there a way not
>> > to set the message id? Thanks.
>>
>> Even if Mutt doesn't set one, the first MTA it hits will add one.
>
>I want the first MTA add one, instead of using the one generated by
>mutt.

One way to get what you want is to use esmtp:

# muttrc
set sendmail="/usr/bin/esmtp"

# esmtprc
identity = u...@ho.st
  hostname = smtp.ho.st:587
  username = u...@ho.st
  password = password
  starttls = enabled
  message_id = disabled

# man esmtprc
message_id

  Whether to set the Message-ID field of the message before sending.
  Normally the receiving MTA sets the Message-ID if missing, so you can
  turn this off if your sending host does not have a fully qualified
  domain name.

  Allowed values are either enabled or disabled. It defaults to enabled.


regards,

s h e h u


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Felix Finch

On 20210215, Kevin J. McCarthy wrote:

You could write a script, I guess, something like:

cd $header_cache_dir
rm -f *

cd $mutt_folder_dir
for mb in *; do
 mutt -e 'set quit=yes; push ""' -f $mb
done


How well would that play with existing mutt sessions?  I run several mutts 
inside tmux (local mail, work IMAP mail, etc), and sessions will run for weeks.

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
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


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 08:04:10PM +, Chris Green wrote:


I have (for example) about 6000 messages in my sentmail folder, it
loads in less than a second.  It is a *lot* faster since I installed
an NVME SSD.


Well, in that case it might not be such an improvement to use the header 
cache and it could even be counterproductive to write more on the SSD.


Now, I wonder if would be worth to keep the cache in a ram disk.  I 
guess it would be much faster and don't touch the disk (better for SSD).


Well... I've gone ahead and try setting my header cache like:

  set header_cache=/tmp/ama/mutt/cache/

Since I have /tmp/ on a RAM disk, that'd do it.  It's working faster (I 
don't have the luxury of a powerful box or a SSD disk, hehe) and it will 
be deleted @reboot, so I won't have to care about deleting it manually 
from time to time.  I'm keeping it at least for now, to test it further.


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 08:51:35PM +0100, Angel M Alganza wrote:
> On Mon, Feb 15, 2021 at 07:40:58PM +, Chris Green wrote:
> 
> > Where does mutt keep these header caches then?
> 
> I have 'set header_cache=~/.mutt/cache/'.
> 
> > I don't have set header_cache set for the good reason that mutt doesn't
> > download mail from anywhere, it's all here on my desktop.
> 
> The cache is for the headers, so that Mutt loads even local maildirs much
> faster.  So, I think even it might not be an issue, everybody might benefit
> from the cache.  Perhaps if you have small maildirs and/or a very powerful
> computer it doesn't make much a difference?
> 
I have (for example) about 6000 messages in my sentmail folder, it
loads in less than a second.  It is a *lot* faster since I installed
an NVME SSD.

-- 
Chris Green


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Kevin J. McCarthy

On Mon, Feb 15, 2021 at 10:12:50AM -0800, Felix Finch wrote:

On 20210215, Kevin J. McCarthy wrote:

once in a while you may want to regenerate your header caches.


Is there any way to do that from the command line?


You could write a script, I guess, something like:

cd $header_cache_dir
rm -f *

cd $mutt_folder_dir
for mb in *; do
  mutt -e 'set quit=yes; push ""' -f $mb
done


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


signature.asc
Description: PGP signature


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 07:40:58PM +, Chris Green wrote:


Where does mutt keep these header caches then?


I have 'set header_cache=~/.mutt/cache/'.

I don't have set header_cache set for the good reason that mutt doesn't 
download mail from anywhere, it's all here on my desktop.


The cache is for the headers, so that Mutt loads even local maildirs 
much faster.  So, I think even it might not be an issue, everybody might 
benefit from the cache.  Perhaps if you have small maildirs and/or a 
very powerful computer it doesn't make much a difference?


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 11:17:42AM -0800, Kevin J. McCarthy wrote:


at a certain point the cache will lose some efficiency by sheer size.


From time to time I simply delete the whole contents of my ~/.mutt/cache 
directory to keep it a bit more efficient.  A kind of prune function 
would be neat, although perhaps it's too resource intensive and that's 
why it hasn't been implemented?  Rebuilding the cache after deleting the 
whole thing doesn't seem too bad to me, as it's done maildir by maildir 
when being accessed next, so I think it's fine.


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 11:17:42AM -0800, Kevin J. McCarthy wrote:
> On Mon, Feb 15, 2021 at 06:03:20PM +, Chris Green wrote:
> > Is that mutt's header caches?
> 
> Yes, that's what I meant to say. :)
> 
> > If so I don't tend to leave mutt running all the time, I assume it
> > refreshes things whenever it's started does it?
> 
> Unfortunately, for header caches, "refreshing" doesn't include removing no
> longer existing messages from the cache.  It just means the header cache
> will slowly grow, even though you are trimming the mailbox externally.  Not
> the end of the world, but at a certain point the cache will lose some
> efficiency by sheer size.
> 
Where does mutt keep these header caches then?  

Ah, just a minute, I don't have set header_cache set for the good
reason that mutt doesn't download mail from anywhere, it's all here on
my desktop.  When I read mail remotely I simply ssh to my desktop
machine and run mutt.

So I don't think this is an issue for me.

-- 
Chris Green


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Kevin J. McCarthy

On Mon, Feb 15, 2021 at 06:03:20PM +, Chris Green wrote:

Is that mutt's header caches?


Yes, that's what I meant to say. :)

If so I don't tend to leave mutt running all the time, I assume it 
refreshes things whenever it's started does it?


Unfortunately, for header caches, "refreshing" doesn't include removing 
no longer existing messages from the cache.  It just means the header 
cache will slowly grow, even though you are trimming the mailbox 
externally.  Not the end of the world, but at a certain point the cache 
will lose some efficiency by sheer size.


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


signature.asc
Description: PGP signature


Re: Quoting character when replying

2021-02-15 Thread Kurt Hackenberg

On 2021/02/14 23:40, Cameron Simpson wrote:


[format=flowed] is quite conservations, to minimise the implementation burden. 
And
that frugality is likely where the inflexibility about ">" comes from.



I think it's to avoid ambiguity. A line that starts with "> " could have 
been quoted that way, or the original line could have started with a 
space. This is true even without format=flowed.


Also, format=flowed does space-stuffing at the beginnings of lines, 
required for some lines, allowed on all lines, and those stuffed spaces 
are to the right of any quoting characters. A line that starts with "> " 
is interpreted as one level of quoting plus space-stuffing. See RFC 
3676, section 4.5.


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Sam Kuper
On Mon, Feb 15, 2021 at 06:00:47PM +, Chris Green wrote:
> It's odd that none of the "maildir works like this" descriptions I
> could find had anything about deleting mails.

I agree.  That's an unfortunate gap in the literature.

-- 
A: When it messes up the order in which people normally read text.
Q: When is top-posting a bad thing?

()  ASCII ribbon campaign. Please avoid HTML emails & proprietary
/\  file formats. (Why? See e.g. https://v.gd/jrmGbS ). Thank you.


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 06:12:39PM +, Chris Green wrote:


> mails in my junk catching directories, is it OK/safe to do it like this?



Other ones are error messages from a remote server which I
usually don't care about but occasionally I want to look at.


Oh, that's interesting.  I might be setting my own set of junk catching 
maildirs for things like those that I clean manually every now and then.



My mail is delivered by SMTP direct to my desktop machine which runs
postfix and is on all the time.  As a backup I have my domain hosting
service deliver all my mail to another system as well as to my home
server.


I synchronize (mbsyn) all email into my IMAP server to several different 
desktops, laptops and phones and, in my main desktop, I make an 
incremental backup through BTRFS snapshots that I keep for years.  So, 
at all times I have multiples copies of all email across different 
devices, a 'bak' remote IMAP maildir to keep every email for 180 days, 
and also an incremental back up.


Re-reading this last paragraph I think I might come across a little 
paranoid (and no, I don't work for a secret agency or anything, LOL), 
but I have developed the system over many years, and as I implemented 
new ideas and kept the previous, it's got those many 'layers'.  But I 
like it and it works very nicely by giving me the peace of mind that I 
can recover every single piece of g̶a̶r̶b̶a̶g̶e̶ email I might need (I will 
never, hehe, but still...)


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 09:54:06AM -0800, Kevin J. McCarthy wrote:
> On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:
> > I currently have the following two lines in my crontab to delete old
> > mails in my junk catching directories, is it OK/safe to do it like
> > this?
> > 
> >20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} 
> > \;
> >30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} 
> > \;
> 
> That should be fine.  The only caveat is header caching.  If you delete
> messages outside of mutt, those messages won't be removed from the header
> cache.  Probably not a big deal for "junk catching" folders, but once in a
> while you may want to regenerate your header caches.
> 
Is that mutt's header caches?  If so I don't tend to leave mutt
running all the time, I assume it refreshes things whenever it's
started does it?

-- 
Chris Green (ch...@halon.org.uk)


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 05:39:26PM +, Sam Kuper wrote:
> On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:
> > This isn't specifically mutt but it's definitely to do with managing
> > mail and there's lots of knowledgeable people here.
> > 
> > I currently have the following two lines in my crontab to delete old
> > mails in my junk catching directories, is it OK/safe to do it like
> > this? 
> > 
> > 20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm 
> > {} \;
> > 30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm 
> > {} \;
> 
> If you have software expecting to be able to read or write to the files
> affected by the above commands, then if that software is not able to
> handle the sudden disappearance of those files, it may throw errors or
> otherwise misbehave.  Software designed to work with Maildirs should
> not have problems, though.
> 
Almost certainly only me using mutt to read them, and that's pretty
unlikely since they're in my junk directory. I might occasionally look
in there to check something but it's very rare, if ever.


> Also, unless I am mistaken, `find ... -exec rm () \;` is not atomic, so
> a race condition exists: `find` could find a matching file, but then
> some other piece of software could delete or rename it before `rm` does.
> 
> (If I am mistaken, someone please correct me!)
> 
Yes, true, but all that will happen is that I'll get an error sent to
me so it's not really a problem.


> Finally, I suppose that to be technically correct, you perhaps ought to
> first move the files from "new" to "cur", and then delete them from
> "cur".  A true mail guru may be able to shed light on this.
> 
I suppose deleting a file sort of counts as reading it.


> IMO, the likelihood is low that any of these issues will bite you.
> 
Yes, thank you, I *thought* this was so but just wanted to make sure I
wasn't doing something very obviously wrong/risky.


It's odd that none of the "maildir works like this" descriptions I
could find had anything about deleting mails.

-- 
Chris Green (ch...@halon.org.uk)


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 05:07:54PM +, Chris Green wrote:


Does no one else ever delete mail messges? :-)


I do, and I try to be ruthless doing it. Since I copy every single piece 
of email into my IMAP 'bak' mailfolder, where it sits for 180 days 
before it is automatically deleted, I make sure that I can get back 
anything I might delete by mistake or modify the wrong way.  Even though 
I still have thousands and thousands of older email that I want to 
eventually tackle (meaning look through and delete), you know, when I 
get the time...  (LOL).


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 09:54:06AM -0800, Kevin J. McCarthy wrote:
> On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:
> > I currently have the following two lines in my crontab to delete old
> > mails in my junk catching directories, is it OK/safe to do it like
> > this?
> > 
> >20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} 
> > \;
> >30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} 
> > \;
> 
> That should be fine.  The only caveat is header caching.  If you delete
> messages outside of mutt, those messages won't be removed from the header
> cache.  Probably not a big deal for "junk catching" folders, but once in a
> while you may want to regenerate your header caches.
> 
Is that mutt's header caches?  If so I don't tend to leave mutt
running all the time, I assume it refreshes things whenever it's
started does it?

-- 
Chris Green


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Felix Finch

On 20210215, Kevin J. McCarthy wrote:
That should be fine.  The only caveat is header caching.  If you 
delete messages outside of mutt, those messages won't be removed from 
the header cache.  Probably not a big deal for "junk catching" 
folders, but once in a while you may want to regenerate your header 
caches.


Is there any way to do that from the command line?

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
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


Re: Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 09:43:39AM -0800, Kevin J. McCarthy wrote:

On Mon, Feb 15, 2021 at 10:35:25AM +0100, Angel M Alganza wrote:

# Need to upgrade to > 1.8.0 (setenv)
folder-hook . 'set my_folder=$folder;set folder="XXX";set visual=^'
folder-hook . 'setenv MYSYNCFOLDER $visual'
folder-hook . 'set folder=$my_folder'
macro index \! "!/usr/bin/mbsync \$MYSYNCFOLDER\n"


You've overridden , bound to '!' by default, with your 
macro.  But then you are trying to use '!' inside the macro.  That's a 
loop - instead of calling  you are calling your macro 
inside the macro.


Oh boy!  That's embarrassing (even though I didn't write the macro, but 
I got it somewhere or from someone).  LOL


Also, I don't want to override  at all!  I was just using 
! because it happens to be beside the " in my (Spanish) keyboard and now 
I'm using " in a macro to fetch my inbox like so:


  macro index  \" "!/usr/bin/mbsync inbox\n"
  macro pager  \" "!/usr/bin/mbsync inbox\n"

But, actually, I won't be needing that when I can fetch the current 
maildir I'm working in with the new macros I'm trying to get working, 
so, I'll be using " for that (in case I'm not missing something with 
overriding ", too).



Try (untested):
 macro index \! "/usr/bin/mbsync \$MYSYNCFOLDER\n"


That somehow works, as does:

  macro index \" "!/usr/bin/mbsync \$MYSYNCFOLDER\n"

But, when I use it, I get:

  No channel or group named '~/mail/mutt/' defined.

It seems that the folder hooks are fetching the current maildir name 
relative to my home, but mbsync would need its name relative to ~/mail/?
Maybe adding some grep rule into the hooks would make that ~/mail/ part 
go away?


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 06:55:54PM +0100, Angel M Alganza wrote:
> On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:
> 
> > mails in my junk catching directories, is it OK/safe to do it like this?
> > 
> >20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} 
> > \;
> >30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} 
> > \;
> 
> Are those junk catching directories where you place email to be deleted
> temporarily, so that you don't through them right away?  Lie a Trash maildir
> of sorts?  I use trash locally and Trash remotely (at the IMAP server) to
> serve that function.
> 
They get mail directed to them that I read by other means.  For
example I'm subscribed to a number of mailing lists that are also fed
to Usenet news by Gmane.  I need to be subscribed to the lists so that
I can post messages via Gmane.  Occasionally I may need to go via
E-Mail.  Other ones are error messages from a remote server which I
usually don't care about but occasionally I want to look at.

Thus keeping the messages for a week and then automatically deleting
them makes sense for me.

[snip details about IMAP handling]

My mail is delivered by SMTP direct to my desktop machine which runs
postfix and is on all the time.  As a backup I have my domain hosting
service deliver all my mail to another system as well as to my home
server.


-- 
Chris Green (ch...@halon.org.uk)


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Felix Finch

On 20210215, Chris Green wrote:

On Mon, Feb 15, 2021 at 12:32:28PM -0500, José María Mateos wrote:

On Mon, Feb 15, 2021 at 05:07:54PM +, Chris Green wrote:
> Does no one else ever delete mail messges? :-)

I do, but for Junk / Trash I just set expiration times on those folders on
my e-mail provider (Fastmail) so I don't even have to think about that.


My 'e-mail provider' is me so I have to expire the messages myself,
hence the question.


I have developed an archive / delete system over the years.  I want a complete 
archive of some maildirs, so a cronjob moves them to an archive structure.  
Others I keep just a couple of weeks and then delete.  Junk/Trash/Spam sticks 
around for three days in case something came in from an unexpected source.

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
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


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:

mails in my junk catching directories, is it OK/safe to do it like 
this?


   20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} \;
   30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} \;


Are those junk catching directories where you place email to be deleted 
temporarily, so that you don't through them right away?  Lie a Trash 
maildir of sorts?  I use trash locally and Trash remotely (at the IMAP 
server) to serve that function.


The first thing I do when processing email is making an automatic copy 
in the IMAP server of every email in the IMAP server through this rule:


  bak = ama["INBOX"]:is_new()
  bak : copy_messages(ama["bak"])

So, in case something goes wrong, I can always go back to the original 
mail.  My backup maildir (bak) gets deleted after 180 days, and my Trash 
maildir (IMAP) gets deleted after 30 days through this imapfilter rule:


  old = ama.bak:is_older(180)
  + ama.Trash:is_older(30)
  old : delete_messages()

Now, in some boxes I delete email but don't synchronize back the local 
trash maildir to the IMAP server (sometimes I do, but not always.  And 
then to prevent deleted email to accumulate in local maildirs I delete 
it though a couple of cron jobs very much like yours:


@daily   /usr/bin/nice find ~/mail/trash/cur/ -type f -ctime +7 -delete
@daily   /usr/bin/nice find ~/mail/trash/new/ -type f -ctime +7 -delete

I believe Mutt has no problems at all with mailfolders beeying 
manipulated externally by other programs (in fact,  I fetch my email 
with mbsync, sort email and modify subjects and such with imapfilter, 
etc., I think it's just fine deleting old junk using the find jobs as we 
both do. (Unless I'm missing something.)


Cheers,
Ángel


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Kevin J. McCarthy

On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:

I currently have the following two lines in my crontab to delete old
mails in my junk catching directories, is it OK/safe to do it like
this?

   20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} \;
   30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} \;


That should be fine.  The only caveat is header caching.  If you delete 
messages outside of mutt, those messages won't be removed from the 
header cache.  Probably not a big deal for "junk catching" folders, but 
once in a while you may want to regenerate your header caches.


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


signature.asc
Description: PGP signature


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Sam Kuper
On Mon, Feb 15, 2021 at 04:21:11PM +, Chris Green wrote:
> This isn't specifically mutt but it's definitely to do with managing
> mail and there's lots of knowledgeable people here.
> 
> I currently have the following two lines in my crontab to delete old
> mails in my junk catching directories, is it OK/safe to do it like
> this? 
> 
> 20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} 
> \;
> 30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} 
> \;

If you have software expecting to be able to read or write to the files
affected by the above commands, then if that software is not able to
handle the sudden disappearance of those files, it may throw errors or
otherwise misbehave.  Software designed to work with Maildirs should
not have problems, though.

Also, unless I am mistaken, `find ... -exec rm () \;` is not atomic, so
a race condition exists: `find` could find a matching file, but then
some other piece of software could delete or rename it before `rm` does.

(If I am mistaken, someone please correct me!)

Finally, I suppose that to be technically correct, you perhaps ought to
first move the files from "new" to "cur", and then delete them from
"cur".  A true mail guru may be able to shed light on this.

IMO, the likelihood is low that any of these issues will bite you.

Sam

-- 
A: When it messes up the order in which people normally read text.
Q: When is top-posting a bad thing?

()  ASCII ribbon campaign. Please avoid HTML emails & proprietary
/\  file formats. (Why? See e.g. https://v.gd/jrmGbS ). Thank you.


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 12:32:28PM -0500, José María Mateos wrote:
> On Mon, Feb 15, 2021 at 05:07:54PM +, Chris Green wrote:
> > Does no one else ever delete mail messges? :-)
> 
> I do, but for Junk / Trash I just set expiration times on those folders on
> my e-mail provider (Fastmail) so I don't even have to think about that.
> 
My 'e-mail provider' is me so I have to expire the messages myself,
hence the question.

-- 
Chris Green


Re: Macro to apply on current mailbox

2021-02-15 Thread Kevin J. McCarthy

On Mon, Feb 15, 2021 at 10:35:25AM +0100, Angel M Alganza wrote:

# Need to upgrade to > 1.8.0 (setenv)
folder-hook . 'set my_folder=$folder;set folder="XXX";set visual=^'
folder-hook . 'setenv MYSYNCFOLDER $visual'
folder-hook . 'set folder=$my_folder'
macro index \! "!/usr/bin/mbsync \$MYSYNCFOLDER\n"


You've overridden , bound to '!' by default, with your 
macro.  But then you are trying to use '!' inside the macro.  That's a 
loop - instead of calling  you are calling your macro 
inside the macro.


Try (untested):
  macro index \! "/usr/bin/mbsync \$MYSYNCFOLDER\n"

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


signature.asc
Description: PGP signature


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread José María Mateos

On Mon, Feb 15, 2021 at 03:32:54PM +, Chris Green wrote:

I think L[ist reply] depends on there being a List-Id header in the
list's messages to work if the list isn't in lists/subscribe.

Most of the lists I use do have List-Id headers but not (quite) all.


Yes, you're right. The worst offender right now, if I'm not mistaken, is 
Google. But in those cases I just get an error message from the reply to 
list key and reply normally.


Cheers,

--
José María (Chema) Mateos || https://rinzewind.org


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread José María Mateos

On Mon, Feb 15, 2021 at 05:07:54PM +, Chris Green wrote:

Does no one else ever delete mail messges? :-)


I do, but for Junk / Trash I just set expiration times on those folders 
on my e-mail provider (Fastmail) so I don't even have to think about 
that.


Cheers,

--
José María (Chema) Mateos || https://rinzewind.org


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 05:58:25PM +0100, Matthias Beyer wrote:
> On 15-02-2021 16:38:43, Chris Green wrote:
> > On Mon, Feb 15, 2021 at 05:26:09PM +0100, Matthias Beyer wrote:
> > > On 15-02-2021 16:21:11, Chris Green wrote:
> > > > I currently have the following two lines in my crontab to delete old
> > > > mails in my junk catching directories
> > > 
> > > I mean, how many tens of GB of mail do you get each year so that
> > > it is necessary to delete stuff?
> > > 
> > Zillions of small files can make searching and stuff slow too.
> 
> May I suggest something like notmuch [0] for your mail setup?
> 
> My maildir is about 75k messages right now and searching is in the range of
> less than a second.
> Maybe you just need the right tool? ;-)
> 
I use mairix and it works fast and well.


Does no one else ever delete mail messges? :-)

-- 
Chris Green


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Matthias Beyer
On 15-02-2021 16:38:43, Chris Green wrote:
> On Mon, Feb 15, 2021 at 05:26:09PM +0100, Matthias Beyer wrote:
> > On 15-02-2021 16:21:11, Chris Green wrote:
> > > I currently have the following two lines in my crontab to delete old
> > > mails in my junk catching directories
> > 
> > I mean, how many tens of GB of mail do you get each year so that
> > it is necessary to delete stuff?
> > 
> Zillions of small files can make searching and stuff slow too.

May I suggest something like notmuch [0] for your mail setup?

My maildir is about 75k messages right now and searching is in the range of
less than a second.
Maybe you just need the right tool? ;-)

[0] notmuchmail.org



signature.asc
Description: PGP signature


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 05:26:09PM +0100, Matthias Beyer wrote:
> On 15-02-2021 16:21:11, Chris Green wrote:
> > I currently have the following two lines in my crontab to delete old
> > mails in my junk catching directories
> 
> May I ask why? I mean, how many tens of GB of mail do you get each year so 
> that
> it is necessary to delete stuff?
> 
It's more for 'good housekeeping' than saving space.  However I do
currently have 1.7Gb of mail which I *do* want saved in my mail
directories so adding a lot of unwanted stuff might add quite a bit.

Zillions of small files can make searching and stuff slow too.

I've just thought that I could rename the Ju directory at intervals
(say once a week) and then remove old ones.  It's not possible to make
this atomic though, I don't think.

-- 
Chris Green


Re: Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Matthias Beyer
On 15-02-2021 16:21:11, Chris Green wrote:
> I currently have the following two lines in my crontab to delete old
> mails in my junk catching directories

May I ask why? I mean, how many tens of GB of mail do you get each year so that
it is necessary to delete stuff?

Matthias


signature.asc
Description: PGP signature


Deleting old maildir messages, is what I'm doing OK?

2021-02-15 Thread Chris Green
This isn't specifically mutt but it's definitely to do with managing
mail and there's lots of knowledgeable people here.

I currently have the following two lines in my crontab to delete old
mails in my junk catching directories, is it OK/safe to do it like
this? 

20 02 * * * find /home/chris/mail/Ju/*/cur -type f -mtime +7 -exec rm {} \;
30 02 * * * find /home/chris/mail/Ju/*/new -type f -mtime +7 -exec rm {} \;

This isn't managed by Dovecot or anything so I have to have a DIY
solution.

-- 
Chris Green


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 09:30:38AM -0500, José María Mateos wrote:
> On Mon, Feb 15, 2021 at 12:50:55PM +, Chris Green wrote:
> > Currently I automatically add all mailing lists I am subscribed to
> > into my muttrc file against both 'lists' and 'subscribe', is this
> > correct/OK?
> 
> I never added any mailing list I'm subscribed to, and everything works well;
> I don't particularly care about the follow-up header, most people's clients
> won't know what to do with it anyway. As long as the 'reply-to-list'
> function works for me (and it does, see this e-mail as an example), I'm more
> than happy.
> 
I think L[ist reply] depends on there being a List-Id header in the
list's messages to work if the list isn't in lists/subscribe.

Most of the lists I use do have List-Id headers but not (quite) all.

-- 
Chris Green


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread Sam Kuper
On Mon, Feb 15, 2021 at 01:04:15PM +, ಚಿರಾಗ್ ನಟರಾಜ್ wrote:
> 12021/01/05 03:27.03 ನಲ್ಲಿ, Chris Green ಬರೆದರು:
>> Currently I automatically add all mailing lists I am subscribed to
>> into my muttrc file against both 'lists' and 'subscribe', is this
>> correct/OK?
>> 
>> I've never been quite clear why there are two commands.
>
> [..] More precisely, Mutt maintains lists of patterns for the
> addresses of known and subscribed mailing lists. Every subscribed
> mailing list is known. To mark a mailing list as known, use the list
> command. To mark it as subscribed, use subscribe. (section 3.14)

This is really the key point.

I.e. Mutt, correctly, makes a distinction between known mailing lists
and subscribed ones.

So, if you *post* to a mailing list *to which you are not subscribed*:

- you should add it to "lists" first, to enable relevant list-related
  functionality in Mutt such as adding suitable headers.  (Which
  functionality kicks in, in each person's specific case, will depend,
  as you mentioned, on some of their other Mutt settings.)

Alternatively, if you *subscribe* to a mailing list:

- add it to "subscribe".  This will also enable relevant but slightly
  different list-related functionality in Mutt.

  If you previously had that list's address in "lists", you can delete
  it there, because if it is in "subscribe" then that is sufficient for
  Mutt to understand that it is a mailing list.

> Personally, I just do what you mentioned and haven't had any ill
> effects.

Once you have entered a subscribed list into "subscribe", entering it
into "lists" serves no purpose in the short-term.  In the long-term, it
has the advantage that if you ever unsubscribe from the list, then you
can just remove it from "subscribe" (but not from "lists") and Mutt will
still know it is a mailing list.

But sure, if you only post to mailing lists to which you subscribe, then
there would be no ill-effects (besides perhaps an imperceptible
processing delay) to mentioning all the lists both in "lists" and
"subscribe".


(I belive all the above is accurate.  If I am mistaken, somebody please
correct me!)

Sam

-- 
A: When it messes up the order in which people normally read text.
Q: When is top-posting a bad thing?

()  ASCII ribbon campaign. Please avoid HTML emails & proprietary
/\  file formats. (Why? See e.g. https://v.gd/jrmGbS ). Thank you.


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread José María Mateos

On Mon, Feb 15, 2021 at 12:50:55PM +, Chris Green wrote:

Currently I automatically add all mailing lists I am subscribed to
into my muttrc file against both 'lists' and 'subscribe', is this
correct/OK?


I never added any mailing list I'm subscribed to, and everything works 
well; I don't particularly care about the follow-up header, most 
people's clients won't know what to do with it anyway. As long as the 
'reply-to-list' function works for me (and it does, see this e-mail as 
an example), I'm more than happy.


Cheers,

--
José María (Chema) Mateos || https://rinzewind.org


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread Chris Green
On Mon, Feb 15, 2021 at 01:04:15PM +, ಚಿರಾಗ್ ನಟರಾಜ್ wrote:
> 12021/01/05 03:27.03 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> > 
> > Currently I automatically add all mailing lists I am subscribed to
> > into my muttrc file against both 'lists' and 'subscribe', is this
> > correct/OK?
> > 
> > I've never been quite clear why there are two commands.
> > 
> > I have in my muttrc :-
> > 
> > #
> > #
> > # Mailing lists
> > #
> > lists `~/.mutt/bin/getLists.py`
> > subscribe `~/.mutt/bin/getLists.py`
> > 
> > The getLists.py script just extracts all the mailing list addresses
> > from my filter file (that also drives my mail filter program) and
> > outputs them space separated on one line.
> > 
> > If having list addresses in both is redundant that's not an issue, I
> > was just wondering if it might be doing any harm.
> > 
> > --
> > Chris Green
> 
> From the documentation: Once you have done this, the  function 
> will work for all known lists. Additionally, when you send a message to 
> a known list and $followup_to is set, Mutt will add a Mail-Followup-To 
> header. For unsubscribed lists, this will include your personal address, 
> ensuring you receive a copy of replies. For subscribed mailing lists, the 
> header will not, telling other users' mail user agents not to send copies 
> of replies to your personal address. More precisely, Mutt maintains lists 
> of patterns for the addresses of known and subscribed mailing lists. Every 
> subscribed mailing list is known. To mark a mailing list as known, use 
> the list command. To mark it as subscribed, use subscribe. (section 3.14) 
> 
Yes, I've read that several times over the years and I'm really none
the wiser! :-)


> 
> Personally, I just do what you mentioned and haven't had any ill effects.
> 
I suspect that's what lots of people do!

A couple of examples of what will happen in various cases would be
really handy.

... and anyway are there *any* lists now that allow posts to
unsubscribed lists?



-- 
Chris Green


Re: Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread ಚಿರಾಗ್ ನಟರಾಜ್
12021/01/05 03:27.03 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> 
> Currently I automatically add all mailing lists I am subscribed to
> into my muttrc file against both 'lists' and 'subscribe', is this
> correct/OK?
> 
> I've never been quite clear why there are two commands.
> 
> I have in my muttrc :-
> 
> #
> #
> # Mailing lists
> #
> lists `~/.mutt/bin/getLists.py`
> subscribe `~/.mutt/bin/getLists.py`
> 
> The getLists.py script just extracts all the mailing list addresses
> from my filter file (that also drives my mail filter program) and
> outputs them space separated on one line.
> 
> If having list addresses in both is redundant that's not an issue, I
> was just wondering if it might be doing any harm.
> 
> --
> Chris Green

From the documentation: Once you have done this, the  function will 
work for all known lists. Additionally, when you send a message to a known list 
and $followup_to is set, Mutt will add a Mail-Followup-To header. For 
unsubscribed lists, this will include your personal address, ensuring you 
receive a copy of replies. For subscribed mailing lists, the header will not, 
telling other users' mail user agents not to send copies of replies to your 
personal address. More precisely, Mutt maintains lists of patterns for the 
addresses of known and subscribed mailing lists. Every subscribed mailing list 
is known. To mark a mailing list as known, use the list command. To mark it as 
subscribed, use subscribe. (section 3.14)

Personally, I just do what you mentioned and haven't had any ill effects.

Sincerely,

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


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


signature.asc
Description: OpenPGP digital signature


Should I have all my mailing lists in both 'lists' and 'subscribe'?

2021-02-15 Thread Chris Green
Currently I automatically add all mailing lists I am subscribed to
into my muttrc file against both 'lists' and 'subscribe', is this
correct/OK?

I've never been quite clear why there are two commands.

I have in my muttrc :-

#
#
# Mailing lists
#
lists `~/.mutt/bin/getLists.py`
subscribe `~/.mutt/bin/getLists.py`

The getLists.py script just extracts all the mailing list addresses
from my filter file (that also drives my mail filter program) and
outputs them space separated on one line.

If having list addresses in both is redundant that's not an issue, I
was just wondering if it might be doing any harm.

-- 
Chris Green


Macro to apply on current mailbox

2021-02-15 Thread Angel M Alganza

Hello:

I am trying to build a macro to apply a function to the current maildir, 
but I can't find the way to capture the current maildir into a variable.


The idea is as follows: I synch my mail with mbsync, which I run from a 
crontab entry at different time intervals for different mail folders.


Some times I want to manually force the synchronization, if for example 
I'm expecting an email in a maildir which has a low cycle, or I'm doing 
some testing and I need to check my inbox faster than my cron does.


At the moment I have a few macros to do that on my inbox, my 'new', 
'day', and 'old' groups of maildirs:


macro index  \" "!/usr/bin/mbsync inbox\n"
macro pager  \" "!/usr/bin/mbsync inbox\n"
macro index  ?? "!/usr/bin/mbsync new\n"
macro pager  ?? "!/usr/bin/mbsync new\n"
macro index  ( "!/usr/bin/mbsync day\n"
macro pager  ( "!/usr/bin/mbsync day\n"
macro index  ) "!/usr/bin/mbsync old\n"
macro pager  ) "!/usr/bin/mbsync old\n"

That does the job, but what I would really want is to force the synchronization
of the current maildir I'm working in. A while ago somebody (I don't think it
was here in the mailing list, or I'd have kept the thread) suggested me to use
the following folder-hooks and macro:

# Need to upgrade to > 1.8.0 (setenv)
folder-hook . 'set my_folder=$folder;set folder="XXX";set visual=^'
folder-hook . 'setenv MYSYNCFOLDER $visual'
folder-hook . 'set folder=$my_folder'
macro index \! "!/usr/bin/mbsync \$MYSYNCFOLDER\n"
#macro index \" "!echo \$MYSYNCFOLDER\n"

Now that I have finally upgraded, I'm trying it out again and, when I press ! I 
get an error message:

Macro loop detected

The only info I can find which contains that string is written in cyrillic
alphabet, so I don't understand a single word.  :-)

Any pointer to what the problem might be, please?  I understand how macros
work, but I'm very new to hooks and I'm not grasping them well enough yet.

Thanks in advance.

Cheers,
??ngel 


Re: Quoting character when replying

2021-02-15 Thread Angel M Alganza

On Mon, Feb 15, 2021 at 07:10:08PM +1100, Cameron Simpson wrote:


Hmm. Beginning to think this is presentation. What are your mutt flow
settings? I've got this:

   set reflow_text=yes
   set reflow_wrap=-4
   set text_flowed=yes


set text_flowed=yes  # Added by ama @ 2019/02/03   
set reflow_text=yes  # Added by ama @ 2021/02/15   
#set reflow_wrap=70   # Added by ama @ 2021/02/15  
set reflow_space_quotes= yes # Added by ama @ 2021/02/15   


I've clearly mangled my composition setup.
Lemme dig into my composition setup...


Hehe.
Ángel


Re: Quoting character when replying

2021-02-15 Thread Cameron Simpson
On 15Feb2021 05:56, Angel M Alganza  wrote:
>On Mon, Feb 15, 2021 at 03:40:16PM +1100, Cameron Simpson wrote:
>>Aye. I use format=flowed all the time; there's stuff in the wiki about
>>settings to go with it, for example to make composition easy.
>
>I see.  :-)  Oddly enough, your quotations appear with the leading >
>without the space, while mine appear with the space, despite me thinking
>for two years (!!!) that it wouldn't if I didn't add them by hand!  LOL

Hmm. Beginning to think this is presentation. What are your mutt flow 
settings? I've got this:

set reflow_text=yes
set reflow_wrap=-4
set text_flowed=yes

In mutt, my "Aye..." message above looks like this:

Content-Type: text/plain; charset=us-ascii

On 15Feb2021 05:20, Angel M Alganza  wrote:
>On Sun, Feb 14, 2021 at 07:36:34PM -0800, Kevin J. McCarthy wrote:
>>You can read a bit more about it at
>>, but you'll want to do more
>>research if you intend to compose format=flowed emails.
>
>Thank you, I'm going to have a look at this.  I'd like to keep 
>doing it,
>since it might help others to read my email better regardless of 
>their
>email client and display.

Aye. [...]

No spaces. The message source looks exactly the same. [... huh? ...] And 
it isn't in format-flowed. Grrr.

Yours _is_ flowed:

Content-Type: text/plain; charset=iso-8859-1; format=flowed

On Mon, Feb 15, 2021 at 03:40:16PM +1100, Cameron Simpson wrote:

>Aye. I use format=flowed all the time; there's stuff in the wiki 
>about settings to go with it, for example to make composition easy.

I see.  :-)  Oddly enough, your quotations appear with the leading >
without the space, while mine appear with the space, despite me 
thinking for two years (!!!) that it wouldn't if I didn't add them by hand! 
 
LOL

I've clearly mangled my composition setup.

Lemme dig into my composition setup...

Cheers,
Cameron Simpson