From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KG0hMKH3i2LGDAAAbAwnHQ (envelope-from ) for ; Mon, 23 May 2022 23:07:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YJ1VL6H3i2KQfAAAG6o9tA (envelope-from ) for ; Mon, 23 May 2022 23:07:45 +0200 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 08F6C2E220 for ; Mon, 23 May 2022 23:07:45 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id AA5935F6C2; Mon, 23 May 2022 21:07:41 +0000 (UTC) X-Greylist: delayed 316 seconds by postgrey-1.36 at yantan; Mon, 23 May 2022 21:07:39 UTC Received: from code.pm (ks39550.kimsufi.com [91.121.23.116]) by mail.notmuchmail.org (Postfix) with ESMTP id 2799B5F5F0 for ; Mon, 23 May 2022 21:07:39 +0000 (UTC) Received: from localhost (94-225-237-133.access.telenet.be [94.225.237.133]) by code.pm (Postfix) with ESMTPSA id 0174CBF7BD; Mon, 23 May 2022 23:02:55 +0200 (CEST) From: erik colson To: notmuch@notmuchmail.org Subject: moving mail to another maildir based on tags and renaming files Date: Mon, 23 May 2022 23:02:22 +0200 Message-ID: <87ilpwc68x.fsf@beavernet.be> MIME-Version: 1.0 Message-ID-Hash: PQZOE66GFHMPAUU2BLOXPJSTRJTRU7JY X-Message-ID-Hash: PQZOE66GFHMPAUU2BLOXPJSTRJTRU7JY X-MailFrom: erik.colson@beavernet.be 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 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-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653340065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=XbCzPavTjQoKArjKQW/0NJUaFVW/gcZrPcwgabjukgU=; b=N361dVoZF3LhWsf6qEApa/w5qU3S/UUcjk6OE8MCUmvm0cv1U38ORE7RbFAY+zmB4FrNgQ 3HIV6kcGxlcHLT8PJwLbsHxntgZcqH5oix/GTCNVz7kYU1uWQfhN1Ebeh+otC407ls8RW1 93MsKbl98BR1O49gwyv7nDiASvgCPhChsGUS8RC5/D4l5AXvso2PJd0G38KvqaAHtCU4It SOXWklK3oWDq8YbDvbHnX7GcOX+sVqEg9dJ9Yfc/4+fmHMTjPmonmDyoeDBBLJScIfPjJ/ Y1upI/sRG3E4fWJ21RmdqrAPs+ZQ/FulpL7EgRk2jw4cYQznYgNnuMr4kraoow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653340065; a=rsa-sha256; cv=none; b=VqI3UwwV0Wpouji5UN954slTzrRqFfF5QHgg+AF6ogXB4fRRdP4jeEu/bdbVDfEOKQm25s IZSVl3hO1PfLMtbav4rGeIFp3WzR5eVFMYYS59K+7yIoiYozWeUdD7LMXSC3NrggfOdDjy wZx7L+UV3GHveyIS+CHza+gdmOXhNuvKnhKi/WLLLbJadTrQHFDCQmOj8LOa+0ltPftYaw naDP0EED8WsTBP6K7zvC36iZtk+GuI6XV2LeyCAdM82VvMjJYwvasXxPb8AOJZntABLpdH 9KxBDnsvoe4VEvgSa0wekFoLVryPWMYOXo2Cc+tipSsrMwTR5JPLXbwdSYg9qQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Spam-Score: -2.00 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Queue-Id: 08F6C2E220 X-Spam-Score: -2.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: DcVtAX/uPDCP Hi, I would like to move mails selected by a notmuch query (i.e. "tag:movethismailtobox-ThisBox") to *ThisBox* I need this to somewhat still have usable access through my phone IMAP client. I am actually using afew already, but as I have 1000+ mailboxes it is unmaintainable to create the rules manually. So I am thinking to either modify the afew-configuration file with another script (=not nice) or either write a script myself. It wouldn't be very difficult to generate the necessary notmuch search --output=files ... | xargs mv ... but, there is a catch: I use isync to synchronize my mails with my IMAP server and therefor I must rename every message file when moving it. As I am not enough aware of maildir and IMAP servers, I am pretty ignorant to what the new filename should be. So I wanted to check if somebody else already wrote some bash/perl/whatever script which handles this ? thx -- erik colson