joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.37k stars 75 forks source link

Upgrade from v8.0.1 to v14.3.0 seems to have breaking changes: `backup` detects no remote folder; `stats` stays empty #184

Closed bentolor closed 10 months ago

bentolor commented 10 months ago

Hi there and again thank you very much for this awesome tool. Today i checked for potential updates and was astonished to realize the version jump from v8.0.1 to v14.3.0 available now. Awesome.

Nevertheless the upgrade breaks a few things and I'm not sure what breaking change I do miss from CHANGELOG.md. Sorry to bother but I'm running out of ideas:

v8.0.1

 ~  imap-backup stats my@email.com
folder              |remote  |both    |local   
--------------------|--------|--------|--------
Archiv              |       0|       0|       6
Entwürfe            |       0|       0|       1
Gesendet            |       0|      40|     533
INBOX               |       0|     375|    2227
OUTBOX              |       0|       0|       0

 ~  imap-backup                                                                                                                                                                                                     Mo 13 Nov 2023 14:58:01 CET
I, [2023-11-13T14:58:15.537594 #1165171]  INFO -- : Running backup of account: my@email.com

v14.3.0

~  imap-backup                                                                                                                                                                                             627ms  Mo 13 Nov 2023 14:59:17 CET
I, [2023-11-13T14:59:29.375235 #1167069]  INFO -- : Running backup of account: my@email.com
W, [2023-11-13T14:59:29.674139 #1167069]  WARN -- : Account my@email.com: No folders found to backup

 ~  imap-backup stats my@email.com
folder              |remote  |both    |local   
--------------------|--------|--------|--------

What do I miss? Configuration is unchanged in ~/.imap-backup/config.json?

bentolor commented 10 months ago

For reference: This is my .imap-backup/config.json

{
  "accounts": [
    {
      "username": "my@email.com",
      "password": "#####REDACTED#############",
      "local_path": "/a/path",
      "folders": [
        {
          "name": "Archiv"
        },
        {
          "name": "Entwürfe"
        },
        {
          "name": "Gesendet"
        },
        {
          "name": "INBOX"
        },
        {
          "name": "OUTBOX"
        }
      ],
      "server": "imap.email.com"
    }
  ],
  "debug": false
}
joeyates commented 10 months ago

Hi @bentolor

Thanks for opening this issue. It's a bug with a recent change to the config file format, where the

[
{"name": "Archiv"}
...
]

part gets modified to be just

["ARCHIV", ...]

The quick fix for you would be to modify your config file, adding an indicator that it's in version 2.1 format:

  {
+ "version": "2.1",
    "accounts": [
      {
        "username": "my@email.com",

When the config file gets loaded, the change is made and a new version is set (2.2), but you'll only see that change written to disk if you make other modifications and save the file.

joeyates commented 10 months ago

I've released version 14.4.0 to handle these cases.

bentolor commented 10 months ago

Awesome @joeyates and many, many thanks! I was just about to adopt the suggested workaround when I got the Github notification. Just installed 14.4.0 and it works flawlessly.

Thank you very, very much!