unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jesse Rosenthal <jrosenthal@jhu.edu>
To: <notmuch@notmuchmail.org>
Subject: Change duplicate priority?
Date: Thu, 28 Sep 2023 10:10:26 -0400	[thread overview]
Message-ID: <87h6neie25.fsf@jhu.edu> (raw)

Dear All,

My work email comes through an Outlook server, which scans some
attachments. The process seems to be to first post an email with an
"Advanced Threat Protection" message and a link to a preview of the
attachment. Then, after the scan is complete, to delete that message and
post a second message, with the same Message ID, and the actual
attachment.

Depending on how long the scan takes, getmail might pull down both of
these emails. The second duplicate is available through the emacs change
index command, but the attachment is not available (since it tries to
pull the first attachment from the first version, which is just an html
part).

I can usually solve this by deleting the first one by hand, something
like:

    notmuch search --output=files id:<mid> | head -1 | xargs rm

This has a couple of problems, though. (1) It's relying on the Maildir file
name being a time stamp to get rid of the earlier file, and (2) it
doesn't actually reindex the file when I run notmuch new, just treating
it as a rename, so I still get the search results for the older deleted
file.

I guess I could do a bindings-based script that gives me a bit more
confidence, dump the tags, delete the messages, reindex, and reapply the
tags.

But I wonder if there is some way to change the priority of duplicates
so that later versions overwrite earlier versions. Alternately, could
there be a way to specify which file name notmuch commands pull
attachments from? This would allow me to get the attachment that is only
on the second dup from the emacs interface.

The other (classical) approach, I guess, would be to put an mda in there
which only lets the second one through. But I'm trying to avoid
/dev/null-ing emails non-interactively if I possible can.

Thanks,
Jesse

             reply	other threads:[~2023-09-28 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 14:10 Jesse Rosenthal [this message]
2023-09-30 12:20 ` Change duplicate priority? David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6neie25.fsf@jhu.edu \
    --to=jrosenthal@jhu.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).