Discussion:
Gmail undelete configuration
Keith Smiley
2018-02-19 20:54:19 UTC
Permalink
Hey everyone,

I was wondering if anyone had a working gmail configuration with
offlineimap that correctly supports undeleting messages. In my
configuration[0] I delete/archive by moving messages to the appropriate
mailboxes. Just using standard `u` command with these results in the
message being marked correctly in the index, but then on the next
offlineimap refresh, it's removed since it still exists in the trash.

I expected to be able to solve this with something like this:

```
macro index u "<save-message>+.../INBOX<enter>"
```

But this results in duplicates of the message in the index, and the
message still gets wiped on the next sync.

Any advice / examples would be appreciated!


0: https://github.com/keith/dotfiles/blob/master/mutt/accounts/gmail.account#L9-L11

--
Keith Smiley
Yubin Ruan
2018-02-20 02:49:42 UTC
Permalink
Post by Keith Smiley
Hey everyone,
I was wondering if anyone had a working gmail configuration with offlineimap
that correctly supports undeleting messages. In my configuration[0] I
delete/archive by moving messages to the appropriate mailboxes.
You don't have to move messages to another mailboxes when deleting message.
Just mark then as deleted (by pressing 'd') will be fine. If that 'delete'
gets populated to the center Gmail server by offlineimap, the deleted message
will be moved to /Trash automatically. That said, you don't have to do this
binding

macro index,pager d "<save-message>+keithbsmiley-gmail.com/trash<enter>" "Delete message"

Using the default delete operation will allow you to undelete messages
normally.
Post by Keith Smiley
Just using
standard `u` command with these results in the message being marked
correctly in the index, but then on the next offlineimap refresh, it's
removed since it still exists in the trash.
```
macro index u "<save-message>+.../INBOX<enter>"
```
But this results in duplicates of the message in the index, and the message
still gets wiped on the next sync.
Any advice / examples would be appreciated!
0: https://github.com/keith/dotfiles/blob/master/mutt/accounts/gmail.account#L9-L11
--
Keith Smiley
--
Yubin Ruan <http://fastdrivers.org>
Keith Smiley
2018-02-20 23:51:16 UTC
Permalink
It looks like that does fix undelete, but offlineimap doesn't move the
message to the trash, only the archive, when I use the default d
command. Do I need some other configuration to make that part work as
expected?

--
Keith Smiley
Post by Yubin Ruan
Post by Keith Smiley
Hey everyone,
I was wondering if anyone had a working gmail configuration with offlineimap
that correctly supports undeleting messages. In my configuration[0] I
delete/archive by moving messages to the appropriate mailboxes.
You don't have to move messages to another mailboxes when deleting message.
Just mark then as deleted (by pressing 'd') will be fine. If that 'delete'
gets populated to the center Gmail server by offlineimap, the deleted message
will be moved to /Trash automatically. That said, you don't have to do this
binding
macro index,pager d "<save-message>+keithbsmiley-gmail.com/trash<enter>" "Delete message"
Using the default delete operation will allow you to undelete messages
normally.
Post by Keith Smiley
Just using
standard `u` command with these results in the message being marked
correctly in the index, but then on the next offlineimap refresh, it's
removed since it still exists in the trash.
```
macro index u "<save-message>+.../INBOX<enter>"
```
But this results in duplicates of the message in the index, and the message
still gets wiped on the next sync.
Any advice / examples would be appreciated!
0: https://github.com/keith/dotfiles/blob/master/mutt/accounts/gmail.account#L9-L11
--
Keith Smiley
--
Yubin Ruan <http://fastdrivers.org>
Keith Smiley
2018-02-20 23:58:28 UTC
Permalink
I realized this might actually be a side-effect of my nametrans settings
which at some point were required in my configuration, but I'm not sure
if they still are:

https://github.com/keith/dotfiles/blob/95ba28fb8e7be24ed3bbcfebcfd8aafc2b146b3f/mutt/offlineimaphelpers.py#L37-L53
https://github.com/keith/dotfiles/blob/95ba28fb8e7be24ed3bbcfebcfd8aafc2b146b3f/offlineimaprc#L23

--
Keith Smiley
Post by Keith Smiley
It looks like that does fix undelete, but offlineimap doesn't move the
message to the trash, only the archive, when I use the default d
command. Do I need some other configuration to make that part work as
expected?
--
Keith Smiley
Post by Yubin Ruan
Post by Keith Smiley
Hey everyone,
I was wondering if anyone had a working gmail configuration with offlineimap
that correctly supports undeleting messages. In my configuration[0] I
delete/archive by moving messages to the appropriate mailboxes.
You don't have to move messages to another mailboxes when deleting message.
Just mark then as deleted (by pressing 'd') will be fine. If that 'delete'
gets populated to the center Gmail server by offlineimap, the deleted message
will be moved to /Trash automatically. That said, you don't have to do this
binding
macro index,pager d "<save-message>+keithbsmiley-gmail.com/trash<enter>" "Delete message"
Using the default delete operation will allow you to undelete messages
normally.
Post by Keith Smiley
Just using
standard `u` command with these results in the message being marked
correctly in the index, but then on the next offlineimap refresh, it's
removed since it still exists in the trash.
```
macro index u "<save-message>+.../INBOX<enter>"
```
But this results in duplicates of the message in the index, and the message
still gets wiped on the next sync.
Any advice / examples would be appreciated!
0: https://github.com/keith/dotfiles/blob/master/mutt/accounts/gmail.account#L9-L11
--
Keith Smiley
--
Yubin Ruan <http://fastdrivers.org>
Yubin Ruan
2018-02-21 02:59:15 UTC
Permalink
Post by Keith Smiley
I realized this might actually be a side-effect of my nametrans settings
which at some point were required in my configuration, but I'm not sure if
https://github.com/keith/dotfiles/blob/95ba28fb8e7be24ed3bbcfebcfd8aafc2b146b3f/mutt/offlineimaphelpers.py#L37-L53
https://github.com/keith/dotfiles/blob/95ba28fb8e7be24ed3bbcfebcfd8aafc2b146b3f/offlineimaprc#L23
--
Keith Smiley
Post by Keith Smiley
It looks like that does fix undelete, but offlineimap doesn't move the
message to the trash, only the archive, when I use the default d
command. Do I need some other configuration to make that part work as
expected?
Deleted messages are not moved by offlineimap, but instead by the Gmail imap
server, that said, when you mark a message as deleted (using MUA such as
mutt), offlineimap will see what happen and send a "DELETE 30403" command to
the Gmail imap server, in which 30403 is the message id. After receiving that
command, the Gmail imap server will move that message to [Gmail]/Trash. That
is the same for archiving.

So, you can look into those folders in the Gmail web interface. If those
messages exist, then there might be some problem in your local mailbox
configuration. It could be that offlineimap doesn't/haven't pulled those
messages. I would suggest using "offlineimap -f $foldername" to pull that
particular folder and see what happen.

Yubin
--
Yubin Ruan <http://fastdrivers.org>
Keith Smiley
2018-03-12 20:17:32 UTC
Permalink
Sorry I meant what's the difference from the mutt / offlineimap perspective on these?
--
Keith Smiley
That is the same for archiving.
What is the differentiation for archiving vs deleting?
For archiving, messages get moved into [Gmail]/Archive, whereas for deleting
messages get moved into [Gmail]/Trash, which get cleared every 30 days by
Gmail by default.
Yubin
Keith Smiley
2018-03-19 05:26:36 UTC
Permalink
Sorry I meant how does this get differentiated from the mutt /
offlineimap side of things?
--
Keith Smiley
Post by Keith Smiley
Sorry I meant what's the difference from the mutt / offlineimap perspective on these?
--
Keith Smiley
That is the same for archiving.
What is the differentiation for archiving vs deleting?
For archiving, messages get moved into [Gmail]/Archive, whereas for deleting
messages get moved into [Gmail]/Trash, which get cleared every 30 days by
Gmail by default.
Yubin
Loading...