From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 231DA6DE1099 for ; Tue, 19 Mar 2019 03:40:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 1.897 X-Spam-Level: * X-Spam-Status: No, score=1.897 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_RP_RNBL=1.284, URI_HEX=1.313] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aj61GPjcWGBH for ; Tue, 19 Mar 2019 03:40:19 -0700 (PDT) X-Greylist: delayed 1169 seconds by postgrey-1.36 at arlo; Tue, 19 Mar 2019 03:40:19 PDT Received: from mslow2.mail.gandi.net (mslow2.mail.gandi.net [217.70.178.242]) by arlo.cworth.org (Postfix) with ESMTPS id 916956DE0F32 for ; Tue, 19 Mar 2019 03:40:19 -0700 (PDT) Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow2.mail.gandi.net (Postfix) with ESMTP id A43483A4818 for ; Tue, 19 Mar 2019 10:20:50 +0000 (UTC) Received: from bababa (lfbn-1-12225-33.w90-92.abo.wanadoo.fr [90.92.41.33]) (Authenticated sender: pierre@atlas.engineer) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 50331200010 for ; Tue, 19 Mar 2019 10:20:47 +0000 (UTC) From: Pierre Neidhardt To: notmuch@notmuchmail.org Subject: Synchronize tags across machines without a mail server Date: Tue, 19 Mar 2019 11:20:46 +0100 Message-ID: <87ef73b1xd.fsf@bababa.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 10:40:21 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, I know this has been asked a couple of times, and it seems that the current solutions are: =2D nmbug (http://notmuch.198994.n3.nabble.com/multiple-machine-tagging-td831812.ht= ml#a4031973 http://notmuch.198994.n3.nabble.com/PATCH-v4-nmbug-Add-an-init-command-td= 4032972.html) It seems that "nmbug init" has not been merged yet. Using the patch above I wasn't able to add an "upstream". Am I missing the obvious? =2D muchsync (http://www.muchsync.org/): Requires our own mail server if I understand correctly. What I want is sync the `notmuch dump' of non-automatic tags across my systems, considering I don't run my own webserver. So far, I came up with the following: =2D-8<---------------cut here---------------start------------->8--- (require 'seq) (unless (boundp 'notmuch-command) ;; So that this file can be use in external scripts without require ;; notmuch.el. (setq notmuch-command "notmuch")) (defun notmuch-all-tags () (split-string (with-output-to-string (with-current-buffer standard-output (call-process notmuch-command nil t nil "search" "--output=3Dtags" "--exclude=3Dfalse" "*"= ))))) (defvar notmuch-unimportant-tags '("attachment" "deleted" "draft" "encrypte= d" "flagged" "inbox" "passed" "replied" "se= nt" "signed" "unread")) (defvar notmuch-dump-file (expand-file-name "~/personal/mail/notmuch.dump")) (defun notmuch-dump-important-tags (&optional file) "Dump notmuch tag database to `notmuch-dump-file'. Messages with only `notmuch-unimportant-tags' are ignored." (interactive) (setq file (or file notmuch-dump-file)) (let* ((important-tags (seq-difference (notmuch-all-tags) notmuch-unimpor= tant-tags)) (tags-arg (cons (concat "tag:" (car important-tags)) (cl-loop for tag in (cdr important-tags) append (list "or" (concat "tag:" tag)))))) (apply 'call-process notmuch-command nil `(:file ,file) nil "dump" tags-arg))) =2D-8<---------------cut here---------------end--------------->8--- This will save all non-trivial / non-automated tags. I can call `notmuch-dump-important-tags' manually from Emacs or automatically (e.g. mcron job or similar sync script) with emacs --quick --batch --load=3D$HOME/.emacs.d/lisp/init-notmuch-sync.el \ -f notmuch-dump-important-tags Thoughts? =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlyQwn4ACgkQm9z0l6S7 zH+HYggAjYPrJwy7EG1STmzJjaorJo4KInOy4LX8BRIN+dlmddF+w5nBU7cXLUHH AvhQATbYlYpkmJxxIgPl19mn2g3VDWMQQ5xzObfKYqPNLFBlro1sgX8Kh/LyV8ly zMarVCqQ8b9Xy4BUgRdKltORYRpXHG5bMNFNDTZaG0rW7+Qk710Y91164Hsh9zgk dROc4K8ZcwoByl4l1BdAHSRWj5W+HtsYdGr9eqJ+lqVYWp2px0l2DRjbonKOw+Ru zrkUHCzNcz/qNIoRKshycd6jZUquhGSOpcW2XQMr1Q+ELtPDMDdf3/7Rbk/8AhrK 96+O8Px2Q5CnsF4quJz0IEI8gAwPKQ== =zSPt -----END PGP SIGNATURE----- --=-=-=--