unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Break thread relationship
@ 2021-02-12  8:03 Ico Doornekamp
  2021-02-12 11:47 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Ico Doornekamp @ 2021-02-12  8:03 UTC (permalink / raw)
  To: notmuch

Hi,

I'm looking for a way to break thread relationship between emails; this
allows me to break up "false threads" that are caused by people replying
to unrelated mails from the past.

I tried to remove the "References" and "In-Reply-To" headers of the
offending mail, and reindex the thread. This seems not enough to
convince notmuch that these mails are no longer related, because the
original and separated thread still end up with the same thread ID.

Can this be done?

Thanks,

Ico


--
:wq
^X^Cy^K^X^C^C^C^C

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Break thread relationship
  2021-02-12  8:03 Break thread relationship Ico Doornekamp
@ 2021-02-12 11:47 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2021-02-12 11:47 UTC (permalink / raw)
  To: Ico Doornekamp, notmuch

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Ico Doornekamp <notmuch@zevv.nl> writes:

>
> I tried to remove the "References" and "In-Reply-To" headers of the
> offending mail, and reindex the thread. This seems not enough to
> convince notmuch that these mails are no longer related, because the
> original and separated thread still end up with the same thread ID.
>

I would expect that to work in general.

One possibility is there are duplicate files for the message.

I'm reminded that I meant to distribute the attached script somewhere
(either in notmuch or in mailscripts). Perhaps you can run it before and
after your edits.


[-- Attachment #2: draw-thread --]
[-- Type: application/octet-stream, Size: 912 bytes --]

#!/bin/bash

# This script can be used like
# NOTMUCH_CONFIG=test/tmp.T580-thread-search/notmuch-config \
#    devel/draw-thread thread:0000000000000002 | dot -Tpdf > thread2.pdf

# In addition to notmuch, you will need the following tools installed
# - graphviz
# - formail (part of procmail)

threadid=$1

declare -a edges

declare -a dest
echo "digraph \"$threadid\" {"
for messageid in $(notmuch search --output=messages $threadid); do
    echo "subgraph \"cluster_$messageid\" {"
    printf "\"%s\" [shape=folder];\n" ${messageid#id:}
    for file in $(notmuch search --output=files $messageid); do
        node=$(basename $file)
        printf "\"%s\" [shape=note];\n" $node

        mapfile -t dest < <(formail -x references < $file | tr '<>,' '"" ')
        edge="\"$node\" -> { ${dest[*]} }"
        edges+=($edge)
    done
    echo "}"
done

for edge in "${edges[*]}"; do
    echo $edge
done

echo "}"

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-12 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12  8:03 Break thread relationship Ico Doornekamp
2021-02-12 11:47 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).