From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UL7qKeOB8mZ+DAAAqHPOHw:P1 (envelope-from ) for ; Tue, 24 Sep 2024 09:09:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UL7qKeOB8mZ+DAAAqHPOHw (envelope-from ) for ; Tue, 24 Sep 2024 11:09:55 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=fhOYOUVp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727168992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=GQqEQWHwrh6EbgRdtyrAwievHixdFIOKAUFXLC86Fro=; b=Ki/tf4YAmX9TYbhOVI/GhdpB3MXLhU4QDZ0PbO2FLcnoDwyCOFe7nm6797Kros1wBwJ6wG uewn0c9ur5ZoTdVPmmaJiGEbjj0h+hzWTUi1EsnJhCxaV1g1MLvj/poaYAE0DNkhHNE7Xe 8Sb07wwkKQA7vsTIVfnVe9Jt1sygyvXi8cVs1s6TMxUVJpcQ3RqGrNVk1juZG9ka6crVrN 6FN3amtNK4d/i/3kK3Zn7OW8kb6RCmOn4AjuZMRZgl45zvtRxMP5KeAnUgqeKKR1ray8Ud zbThTgxHlpluSN+Eovj5UduRr5dA/32fcH70otd4jn4bimWvdhj/tXzYi/l5Cw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727168992; a=rsa-sha256; cv=none; b=sq85cQr0VMLsIJ0C6bOwk8gcouhRyRRDTzoeLei8Cu9q3JLO2ZZkq5Jk/AouhN/E2jQkEm anpEutzMlTuYRDMx85P6NLdFxGNW0cWVfIoGAScxi7o3xOe0vgmvF8OhDXvTZ9rs0f6DpE oYcFz+4PKQvtABxufJgwEKyqHmsL5Sbky/zbllKHAs9lDD1Cag9w1PkkmZlgkCmELupL10 UtAinjiAbJplQ+55LTKXNY1mAYkV+LnuTrHK3XbZFTdREL/qdjKJhC2gnbtLAvh7UpciHN sb/oSTTFrviXkfh+Mg885yxDAx+a5BUmAsy3PmNjwOp7vnCpjDbTje/ZTEYBvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=fhOYOUVp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 793055B55C for ; Tue, 24 Sep 2024 11:09:50 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 2F9075E526; Tue, 24 Sep 2024 09:09:42 +0000 (UTC) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by mail.notmuchmail.org (Postfix) with ESMTPS id 512C95E28E for ; Tue, 24 Sep 2024 09:09:39 +0000 (UTC) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d56155f51so636782466b.2 for ; Tue, 24 Sep 2024 02:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727168978; x=1727773778; darn=notmuchmail.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TjYRVo614xV1HKp891qHow8NVFj4axtFw8P2U07WkBk=; b=fhOYOUVpSO+c73KkbvRZMZ+Ni2TXxK0feQ2+4yRgZSqp77HVU0Re1/Wl7NxsinOcAf olBG6yff/6/RSfoj8LBvulgfHuo9F6hzi2zG+APfsGzbpDPhFP/ynisQnDsHxhByvIdE deqc3g8+yA4jKzKI+8sQEhejYTDUPM2ZOC84p1AwGVi0HTrrAlNYPTzfxc5UzirLMDGj FU4tNou+g5EQqXfldvMYgb4eZhXXDNXY6Mz+afJZPBIUtkFhy/DpHnFCS1GvXNXGM1+B aQnRbp3LFcZQX9tI0+UhPhSCi4LAEc3yKs2RTuo5lWbK2At1HUb/cD2IBsSfauXaRZ93 Rltg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727168978; x=1727773778; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TjYRVo614xV1HKp891qHow8NVFj4axtFw8P2U07WkBk=; b=WNCBODbDYDQLRgvW5oI2MfRD7SRDchjNFuG6IJFYN67170NtNSxm10rQ3bEFHaN356 2QDU49TV8s9zUZ6STd5VBEVPRLi5rIVp6oL1DK5tc0GoGKqXgahwLGCOBJVGI6yTA+sG rRtJBMNHSsUl/GNAozcHfNpJ78AklQC1LdrXKZVwkSEdPzCJi6HZk05csKKe9YWuopMB l2y+QxvxDcHT3Ss20kFocbWsp+xLJlYj36BoPiAAmO+OG4SayDNmgFSJzCBGCc5OgMmy geL6u+tWkOg2hflM2prwHRZK/+nszJTsWBzqcyjSsjRFPk3+HnP3xNn2a4JiZ58QpTMW GMYg== X-Forwarded-Encrypted: i=1; AJvYcCWmYDpOWkFxNO6ZlbVEcv+TtZSGvG/nK4NlAaW6EkOzE3mRhuy+tL394YEL5p6ay1U/VK4XnYr0@notmuchmail.org X-Gm-Message-State: AOJu0YwNN5kTW5KkvAge/aq1B5sWu81pcKCJU4G3vXq/yEjIGU/N08yA J1TXEXl6se4YNrPVRaCRsE8lLWULKTTnck99Qrwc5XLddOa3XYFX8yeHcFzRXGPv8HHDqE7HErE TX67letF6V7u2dLKFHgqTPQX80KE= X-Google-Smtp-Source: AGHT+IGdLxMZbZyZ6+LAFLV3ESjG54OxkDO3nCRbKCI7N4jncOR+knsR1lZyQZcDy3LuNsnr+wZYTXSYEkMzDnP9mU0= X-Received: by 2002:a17:907:e662:b0:a8b:6ee7:ba22 with SMTP id a640c23a62f3a-a90d5057597mr1255820866b.39.1727168978349; Tue, 24 Sep 2024 02:09:38 -0700 (PDT) MIME-Version: 1.0 References: <20240920175232.zryeqyl76nbydiab@localhost> <87zfo1dfa1.fsf@pengjiz.com> <20240921032340.opozeclfbyqzw2yt@localhost> <87wmj52cwh.fsf@ASCALON.mail-host-address-is-not-set> In-Reply-To: <87wmj52cwh.fsf@ASCALON.mail-host-address-is-not-set> From: Michael J Gruber Date: Tue, 24 Sep 2024 11:09:26 +0200 Message-ID: Subject: Re: searching for a message by path To: Panayotis Manganaris Message-ID-Hash: JIPE7EYBBOV2JVU5VLZ7J7VEPRNOUFFQ X-Message-ID-Hash: JIPE7EYBBOV2JVU5VLZ7J7VEPRNOUFFQ X-MailFrom: michaeljgruber@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: frederik@ofb.net, notmuch@notmuchmail.org X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.11 X-Spam-Score: -3.11 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 793055B55C X-TUID: 8S/GGvfKRIIe Am Sa., 21. Sept. 2024 um 18:24 Uhr schrieb Panayotis Manganaris : ... > notmuch search --output=messages 'tag:new' > /tmp/msgs > notmuch search --output=files 'tag:new' |\ > bogofilter -o0.7,0.7 -bt |\ > paste - /tmp/msgs |\ > awk '$1 ~ /S/ { print "-new +spam", "-", $3 }' |\ > notmuch tag --batch > ... > This script operates on the assumption that the order of results from notmuch queries are > always the same, which is fortunately true. It also operates under the assumption that you receive no duplicate messages with the same message-id (such as list copies, sent/reveived), or else `paste` will have a hard time matching lines. Note that you can loop over the msgs, treat them individually, and still collect input for `notmuch tag --batch`, which solves both the problem with duplicate messages and potential ordering instability while keeping batch efficiency. > Your instinct to use batch tagging and id: queries is correct. I collect my new message ids in > /tmp/msgs. These ids are unique, they are definitely unique enough to be used to tag individual > messages on a daily basis. I'm sorry, but either they're unique or not. What's unique enough? I'm pestering on this because part of the OP's problem is being clear about the notion of message, which is uniquely identified by a message id in the notmuch db. I tried to clear that up in my previous answer in this thread. > > It might be useful for the reasons I stated, namely in case the Message-ID does not exist or > > is not unique. > > I think mail that is successfully transmitted through a mail host necessarily obtains a message > id, but I might be wrong. I believe notmuch indexes on both it's own unique thread ids and the > message ids. Thereby further decreasing the already minuscule chance of message id collisions. No. Messages can arrive without mid. In that case, notmuch creates one (without altering the message file) and uses it for indexing. "Thread-id" is something completely different from message-ids. They do not identify a message uniquely (but a thread of messages "joint" by references), albeit indirectly (such as "root message of the thread", assuming one root). Cheers Michael