unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* IMAP with server deletion
@ 2019-07-05 13:22 Sam Halliday
  2019-07-05 13:26 ` Dan Čermák
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sam Halliday @ 2019-07-05 13:22 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

Hello all,

I'm using emacs + notmuch + offlineimap + msmtp to manage my Gmail.

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?

There is one complicating factor that stops me from being able to use
fetch-only POP3: I'd like to keep files on the server if they have the
+flagged tag, which is equivalent to "starred" in the Gmail interface.

Has anybody got a setup similar to this?


[-- Attachment #2.1: Type: text/plain, Size: 27 bytes --]


-- 
Best regards,
Sam

[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IMAP with server deletion
  2019-07-05 13:22 IMAP with server deletion Sam Halliday
@ 2019-07-05 13:26 ` Dan Čermák
  2019-07-05 13:30 ` Chris Coutinho
  2019-07-05 21:57 ` Tomas Nordin
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Čermák @ 2019-07-05 13:26 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

Hi Sam,

I don't have exactly the same setup, but what might work for you is the
following:
move all messages without +flagged into a local Maildir (that is not
synchronized by offlineimap, i.e. "just a folder").

Notmuch will still be able to find your messages and your
synchronization time will go down significantly.


Hope that helps,

Dan

Sam Halliday <sam.halliday@gmail.com> writes:

> Hello all,
>
> I'm using emacs + notmuch + offlineimap + msmtp to manage my Gmail.
>
> 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?
>
> There is one complicating factor that stops me from being able to use
> fetch-only POP3: I'd like to keep files on the server if they have the
> +flagged tag, which is equivalent to "starred" in the Gmail interface.
>
> Has anybody got a setup similar to this?
>
>
> -- 
> Best regards,
> Sam
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IMAP with server deletion
  2019-07-05 13:22 IMAP with server deletion Sam Halliday
  2019-07-05 13:26 ` Dan Čermák
@ 2019-07-05 13:30 ` Chris Coutinho
  2019-07-05 21:57 ` Tomas Nordin
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Coutinho @ 2019-07-05 13:30 UTC (permalink / raw)
  To: Sam Halliday; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Offlineimap has a 'sync_deletes' flag that defaults to 'yes' in both your
local and remote repositories. You can elect to delete locally and keep
remote, or delete remotely and keep locally.

See the short comment in the offlineimap configuration file on github:

https://github.com/OfflineIMAP/offlineimap/blob/06ed00a2112f27dc7fc81a2444eb7f5afde062e1/offlineimap.conf

One point that is not clear is how to flag a message locally to be deleted
on the remote, without deleting the message locally. What you probably want
to do is delete your messages using the GMail UI using a browser.

Remember to make a backup!

C

On Fri, 5 Jul 2019 at 15:22, Sam Halliday <sam.halliday@gmail.com> wrote:

> Hello all,
>
> I'm using emacs + notmuch + offlineimap + msmtp to manage my Gmail.
>
> 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?
>
> There is one complicating factor that stops me from being able to use
> fetch-only POP3: I'd like to keep files on the server if they have the
> +flagged tag, which is equivalent to "starred" in the Gmail interface.
>
> Has anybody got a setup similar to this?
>
>
> --
> Best regards,
> Sam
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 2227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IMAP with server deletion
  2019-07-05 13:22 IMAP with server deletion Sam Halliday
  2019-07-05 13:26 ` Dan Čermák
  2019-07-05 13:30 ` Chris Coutinho
@ 2019-07-05 21:57 ` Tomas Nordin
  2 siblings, 0 replies; 4+ messages in thread
From: Tomas Nordin @ 2019-07-05 21:57 UTC (permalink / raw)
  To: Sam Halliday, notmuch

Sam Halliday <sam.halliday@gmail.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-05 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 13:22 IMAP with server deletion Sam Halliday
2019-07-05 13:26 ` Dan Čermák
2019-07-05 13:30 ` Chris Coutinho
2019-07-05 21:57 ` Tomas Nordin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).