Mail files seem to be duplicated

classic Classic list List threaded Threaded
2 messages Options
Edgar Hipp-2 Edgar Hipp-2
Reply | Threaded
Open this post in threaded view

Mail files seem to be duplicated


I am using neomutt + offlineimap + notmuch to handle my email, but it
seems that I have a recurring issue since over a year.

The issue is that when I archive or move email, sometimes (50%
approximately), the file is still in the directory it was in at the
beginning, for example, if I want to move a file to the Archives folder,
it is still in the INBOX directory and seems to be duplicated.

I have bound `S` to archive my email with the following binding :

macro index S "<enter-command>unset resolve<enter><clear-flag>N<enter-command>set resolve<enter><save-message>~/mail/bqk/Archives.2017<enter>"

I then hit `$` to sync my mailbox :

macro index $ \

After quitting neomutt, `notmuch new` is automatically called.

However, quite often, when I enter neomutt again on the virtual mail box
bqk : I still see the message in my inbox that I have previously "Archived".

virtual-mailboxes "bqk" "notmuch://?query=path:bqk/** and folder:bqk/INBOX"

If I search for an email that had this issue :

notmuch show --body=false --format=json 'subject:My custom subject'  | jq .

I see following result :

        "id": "[hidden email]",
        "match": true,
        "excluded": false,
        "filename": [
        "timestamp": 1518213812,
        "date_relative": "February 09",
        "tags": [
        "headers": {
          "Subject": "My custom subject",
          "From": "John doe <[hidden email]>",
          "To": "[hidden email]",
          "Date": "Fri, 09 Feb 2018 22:03:32 +0000"

In that case, I had to archive the email 6 times until it was really

As you can see, the email has multiple "filenames". However, they all
are exactly the same (They have the exact same content, I checked with

I also have a running offlineimap that checks email every minute and
calls notmuch afterwards.

My idea is that in some cases, neomutt and notmuch are in a situation
where the file is copied by neomutt to its new location (in the archive
folder), but still present in the inbox directory.

Does notmuch ever write to files ?

Thanks in advance,

notmuch mailing list
[hidden email]
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view

Re: Mail files seem to be duplicated

Edgar Hipp <[hidden email]> writes:

>         "filename": [
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518766879_1.2307.acme,U=4151,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S",
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518766962_1.2307.acme,U=4177,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S",
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518766964_1.2307.acme,U=4181,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S",
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518766965_1.2307.acme,U=4183,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S",
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518766966_0.2307.acme,U=4184,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S",
>           "/home/edgar/mail/bqk/INBOX.archive/cur/1518767387_0.2307.acme,U=4232,FMD5=6ec33b7708e41596e6d4f5707101ac47:2,S"
>         ],

Notmuch only renames files to change their mailder flags (after the last
':') so it's hard to see how notmuch would have done this. Other than
that (and notmuch insert, which you'd know if you were using), notmuch
doesn't write or rename files. You can test by running

% notmuch config set maildir.synchronize_flags false

Then notmuch won't rename files at all.

notmuch mailing list
[hidden email]