GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.56k stars 203 forks source link

Message restore skips a lot of messages due to "Invalid label" #452

Open wout-peeters-gs opened 5 months ago

wout-peeters-gs commented 5 months ago

Full steps to reproduce the issue:

  1. Backup a bunch of emails from a Gmail account
  2. Restore said messages to other Gmail account

Expected outcome (what are you trying to do?): Messages restored

Actual outcome (what errors or bad behavior do you see instead?): A large amount of errors like so:

ERROR: 400: Invalid label: IMPORTANT. Skipping message restore.
ERROR: 400: Invalid label: IMPORTANT. Skipping message restore.
ERROR: 400: Invalid label: SENT. Skipping message restore.
ERROR: 400: Invalid label: SENT. Skipping message restore.
ERROR: 400: Invalid label: IMPORTANT. Skipping message restore.

only a small number of messages is actually restored.

wout-peeters-gs commented 5 months ago

Seems that adding a prefix label with --label-prefix RESTORE worked around these errors.

mtiraferri commented 3 months ago

Same message, restoring mbox but stops the process.

Restoring from 22.69gb file c:\tmp\tb\recupero.mbox...
Creating label Da leggere
400: Invalid label name - invalidArgume