Discussion:
hide identical mails within the same thread
Yubin Ruan
2018-01-21 19:33:03 UTC
Permalink
Is there any configuration for mutt that can hide identical mails within the
same thread? I indexed all the mails and sometime I re-construct the whole
thread from one specific mail. However because some identical mails (with the
same Message-ID, I guess) scatter in several mailbox, within the same thread I
see lots of =>, which indicate identical mails.

Thanks,
Yubin
Ionel Mugurel Ciobîcă
2018-01-21 11:18:48 UTC
Permalink
On 22-01-2018, at 03h 33'03", Yubin Ruan wrote about "hide identical mails within the same thread"
Post by Yubin Ruan
Is there any configuration for mutt that can hide identical mails within the
same thread? I indexed all the mails and sometime I re-construct the whole
thread from one specific mail. However because some identical mails (with the
same Message-ID, I guess) scatter in several mailbox, within the same thread I
see lots of =>, which indicate identical mails.
Thanks,
Yubin
You can tag duplicates (defaults are T~=) and do something with it,
for example delete them (defaults ;d). You can't hide e-mails in mutt.


Ionel
Tim Chase
2018-01-21 13:01:34 UTC
Permalink
Post by Ionel Mugurel Ciobîcă
You can tag duplicates (defaults are T~=) and do something with it,
for example delete them (defaults ;d). You can't hide e-mails in mutt.
Should be able to use the ~= "duplicate message" and invert it, then
use that to <limit> (by default "l") the display.

l!~=

Should be able to wrap that in a folder-hook if you want it to always
take place.

-tkc
Tim Chase
2018-01-21 23:27:59 UTC
Permalink
Post by Tim Chase
Post by Ionel Mugurel Ciobîcă
You can tag duplicates (defaults are T~=) and do something with
it, for example delete them (defaults ;d). You can't hide e-mails
in mutt.
Should be able to use the ~= "duplicate message" and invert it, then
use that to <limit> (by default "l") the display.
l!~=
Should be able to wrap that in a folder-hook if you want it to
always take place.
Went ahead and tested:

folder-hook . 'push <limit>~!=<enter>'

which hides duplicates.

-tkc
Tim Chase
2018-01-21 23:44:54 UTC
Permalink
Post by Tim Chase
folder-hook . 'push <limit>~!=<enter>'
Sorry, mistyped

folder-hook . 'push <limit>!~=<enter>'

(the adjacency of "~" and "!" on the keyboard didn't help. The "!"
negates the "~=" duplicate functionality).

And as the message says, if later on you do want to see those dupes,
use the "l"imit function and specify "all".

This does assume that

1) you have `duplicate_threads` set to "yes" as should be the
default, and

2) your display is sorted to group by thread

-tkc
Grant Edwards
2018-01-22 15:32:50 UTC
Permalink
Post by Tim Chase
Post by Ionel Mugurel Ciobîcă
You can tag duplicates (defaults are T~=) and do something with it,
for example delete them (defaults ;d). You can't hide e-mails in mutt.
Should be able to use the ~= "duplicate message" and invert it, then
use that to <limit> (by default "l") the display.
l!~=
Should be able to wrap that in a folder-hook if you want it to always
take place.
Why not just delete the duplicate e-mails?

That would seem to be a more efficient way of "always hiding them".
--
Grant Edwards grant.b.edwards Yow! HUMAN REPLICAS are
at inserted into VATS of
gmail.com NUTRITIONAL YEAST ...
Ben Boeckel
2018-01-22 16:33:16 UTC
Permalink
Post by Grant Edwards
Why not just delete the duplicate e-mails?
That would seem to be a more efficient way of "always hiding them".
The problem arises when using notmuch to find emails across all
mailboxes and create a new mailbox with the results. This mailbox is
read-only.

--Ben
Grant Edwards
2018-01-22 16:37:04 UTC
Permalink
Post by Ben Boeckel
Post by Grant Edwards
Why not just delete the duplicate e-mails?
That would seem to be a more efficient way of "always hiding them".
The problem arises when using notmuch to find emails across all
mailboxes and create a new mailbox with the results. This mailbox is
read-only.
Good to know -- I've been wondering about the reason for such a
request for days (off-and-on). Really.
--
Grant Edwards grant.b.edwards Yow! I love ROCK 'N ROLL!
at I memorized the all WORDS
gmail.com to "WIPE-OUT" in 1965!!
Ionel Mugurel Ciobîcă
2018-01-22 19:49:13 UTC
Permalink
On 22-01-2018, at 16h 37'04", Grant Edwards wrote about "Re: hide identical mails within the same thread"
Post by Grant Edwards
Post by Ben Boeckel
Post by Grant Edwards
Why not just delete the duplicate e-mails?
That would seem to be a more efficient way of "always hiding them".
The problem arises when using notmuch to find emails across all
mailboxes and create a new mailbox with the results. This mailbox is
read-only.
Good to know -- I've been wondering about the reason for such a
request for days (off-and-on). Really.
That would still require to have identical e-mails in more than one
mailbox...


Ionel
Ben Boeckel
2018-01-22 20:48:35 UTC
Permalink
Post by Ionel Mugurel Ciobîcă
That would still require to have identical e-mails in more than one
mailbox...
It happens with gmail when an email has more than one label.

--Ben
Cameron Simpson
2018-01-23 02:01:28 UTC
Permalink
Post by Ben Boeckel
Post by Ionel Mugurel Ciobîcă
That would still require to have identical e-mails in more than one
mailbox...
It happens with gmail when an email has more than one label.
And to me locally when I crossfile email and/or when I get a personal CC of a
list email (lands in my personal inbox and the list folder).

Cheers,
Cameron Simpson <***@cskk.id.au> (formerly ***@zip.com.au)
Ionel Mugurel Ciobîcă
2018-01-23 02:28:11 UTC
Permalink
On 23-01-2018, at 13h 01'28", Cameron Simpson wrote about "Re: hide identical mails within the same thread"
Post by Cameron Simpson
Post by Ben Boeckel
Post by Ionel Mugurel Ciobîcă
That would still require to have identical e-mails in more than one
mailbox...
It happens with gmail when an email has more than one label.
And to me locally when I crossfile email and/or when I get a personal CC of
a list email (lands in my personal inbox and the list folder).
procmail can help you here. I never get duplicate mails... Add this up
on your .procmailrc file:


| # avoid cross-post (duplicate mails)
| :0 Wh: msgid.lock
| | formail -D 32768 msgid.cache


Ionel
Cameron Simpson
2018-01-23 06:08:42 UTC
Permalink
Post by Ionel Mugurel Ciobîcă
On 23-01-2018, at 13h 01'28", Cameron Simpson wrote about "Re: hide identical mails within the same thread"
Post by Cameron Simpson
Post by Ben Boeckel
Post by Ionel Mugurel Ciobîcă
That would still require to have identical e-mails in more than one
mailbox...
It happens with gmail when an email has more than one label.
And to me locally when I crossfile email and/or when I get a personal CC of
a list email (lands in my personal inbox and the list folder).
procmail can help you here. I never get duplicate mails... Add this up
| # avoid cross-post (duplicate mails)
| :0 Wh: msgid.lock
| | formail -D 32768 msgid.cache
You misunderstand. I _expect_ these duplicates. I could strip them, but I
don't. I'm just describing normal circumstances in which this can and does
occur.

Regarding procmail, I experimented with the recipe you describe but decided it
wasn't for me. And I dropped procmail some years ago and wrote my own filer.

Cheers,
Cameron Simpson <***@cskk.id.au> (formerly ***@zip.com.au)
Cameron Simpson
2018-01-23 01:59:59 UTC
Permalink
Post by Ben Boeckel
Post by Grant Edwards
Why not just delete the duplicate e-mails?
That would seem to be a more efficient way of "always hiding them".
The problem arises when using notmuch to find emails across all
mailboxes and create a new mailbox with the results. This mailbox is
read-only.
When I search for email I look for it using my notmuch wrapper notmuch-search:

https://bitbucket.org/cameron_simpson/css/src/tip/bin/notmuch-search

Once the result mailbox has been made it pulls up mutt on it like this:

mutt -e 'unset header_cache' -e 'push ",D$"' -f "$mdir"

i.e. it disables the header cache (pointless for a transient folder) and runs
my ,D macro, which deletes all duplicates.

Of course such a script name is painful to type, so since I have "+" aliased to
opening mutt, I have ++ aliased to "notmuch-search -S". So less pain. I've got
a "++" macro inside mutt too for the same thing.

Hoping this is helpful,
Cameron Simpson <***@cskk.id.au> (formerly ***@zip.com.au)
Yubin Ruan
2018-01-23 17:58:04 UTC
Permalink
Post by Ben Boeckel
Post by Grant Edwards
Why not just delete the duplicate e-mails?
That would seem to be a more efficient way of "always hiding them".
The problem arises when using notmuch to find emails across all
mailboxes and create a new mailbox with the results. This mailbox is
read-only.
No, the resulting mailbox can be made to be writable: if you use the
mutt-notmuch script, just change the <change-folder-readonly> below to
<change-folder>:

macro index <F8> \
"<enter-command>unset wait_key<enter><shell-escape>mutt-notmuch --prompt search<enter><change-folder-readonly>~/.cache/mutt_results<enter>" \
"search mail (using notmuch)"
macro index <F9> \
"<enter-command>unset wait_key<enter><pipe-message>mutt-notmuch thread<enter><change-folder-readonly>~/.cache/mutt_results<enter><enter-command>set wait_key<enter>" \
"search and reconstruct owning thread (using notmuch)"

--
Yubin
Ben Boeckel
2018-01-23 23:51:44 UTC
Permalink
Post by Yubin Ruan
No, the resulting mailbox can be made to be writable: if you use the
mutt-notmuch script, just change the <change-folder-readonly> below to
Ah, indeed. I'll keep it readonly for me since it actually doesn't do
much to be read/write anyways.

Thanks,

--Ben

Ionel Mugurel Ciobîcă
2018-01-22 12:50:46 UTC
Permalink
On 21-01-2018, at 12h 18'48", Ionel Mugurel Ciobîcă wrote about "Re: hide identical mails within the same thread"
[...] You can't hide e-mails in mutt.
I stand corrected! Everyday you learn something new... :-)

Ionel
Loading...