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 638866DE1452 for ; Fri, 5 Jul 2019 15:03:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.06 X-Spam-Level: X-Spam-Status: No, score=-2.06 tagged_above=-999 required=5 tests=[AWL=0.441, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] 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 dSJEDwKEkusX for ; Fri, 5 Jul 2019 15:03:15 -0700 (PDT) X-Greylist: delayed 308 seconds by postgrey-1.36 at arlo; Fri, 05 Jul 2019 15:03:14 PDT Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by arlo.cworth.org (Postfix) with ESMTPS id CCE1B6DE0F80 for ; Fri, 5 Jul 2019 15:03:14 -0700 (PDT) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id BCC6916005D for ; Fri, 5 Jul 2019 23:58:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1562363883; bh=Cw/S2XNAWgCY/C9xQ+vBqf2hT1IizXrWCam3I9wj2Hw=; h=From:To:Subject:Date:From; b=X1Hm2MWqvs6u9v8HmRBviOBuZWuArlgCbcvJ1VWXsnwFvXxbBvMJ+z+JXzlyMzM26 a1EaVzawx2k0pUQSsfof66V6AfeDCjMVABhWgKUTVmL0xGq4N+U5xNXTLeMYwBbg5s QoDYEEySJtoAB/F4pT4iYzHcMXATcogKZGv2V7Elb5qFQyh7N8ozj7XxsMe/WLs7By GK7BAcqi2XMv7XUpub5TaRhy2JdCADi+w8dqUF/tI6yvgN9Ejk4ZxLq/VgsrkRcBnV WexhaMSo9P8AKPSQFoQcoceQPlqZ8b9eEyKramZJeG0Do4T/vJL0LoXeipQjD7Bvuy 2WC5Adz1OeoAg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 45gTHC4RdTz6tm8; Fri, 5 Jul 2019 23:57:59 +0200 (CEST) From: Tomas Nordin To: Sam Halliday , notmuch@notmuchmail.org Subject: Re: IMAP with server deletion In-Reply-To: <87pnmolip6.fsf@gmail.com> References: <87pnmolip6.fsf@gmail.com> Date: Fri, 05 Jul 2019 23:57:58 +0200 Message-ID: <87bly8gn4p.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain 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: Fri, 05 Jul 2019 22:03:16 -0000 Sam Halliday writes: > Hello all, Hello Sam > I'm using emacs + notmuch + offlineimap + msmtp to manage my Gmail. I have that setup apart from Gmail, (I use Posteo). > > My gmail account is starting to get so big that an offline sync is >time > consuming. > > I'd like to delete messages on the server, but keep them locally. Is > that possible with IMAP? Yes. I keep a lot of mailing list mails locally but delete them from the server. I have this to tag list mails (define-key notmuch-show-mode-map "a" (lambda () "Tag all messages in current buffer with `rfile'." (interactive) (notmuch-show-tag-all (list "+rfile" "-inbox")) (message "rfiled the thread"))) so they all get tagged "rfile", just a tag I made up at some point. Then I have this to move those messages to a directory not synced by offlineimap: (defun tn-refile-rfiles () "Move all messages thus tagged to archive folder. See variable `tn-refile-tags' for message tags that mean to move the message to archived folder. Discard all messages already in the archive folder." (interactive) (let (file-to-move count) (setq count 0) (message "Moving messages...") (dolist (file-to-move (apply 'process-lines (append '("notmuch" "search" "--output=files") tn-refile-tags '("AND NOT folder:archive")))) (rename-file file-to-move (concat tn-archive-folder (file-name-nondirectory file-to-move))) (setq count (1+ count))) (if (> count 0) (call-process "notmuch" nil "*tn-notmuch-new-out*" nil "new")) (message "Moved %d messages" count))) The variable `tn-refile-tags' look like this (defvar tn-refile-tags (list "tag:rfile" "tag:lst") "list of refile tag strings for use in a notmuch search") Don't remember why I made this, really just using the rfile tag, but anyway. Finally I have this binding: (define-key notmuch-hello-mode-map (kbd "A") 'tn-refile-rfiles) The effect is that offlineimap see those messages as deleted and sync the deletion to the server. But for Notmuch the archive folder is a valid folder and in my case it is "/home/tomas/Mail/archive/cur/". Best regards -- Tomas