joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.33k stars 74 forks source link

"--mirror" ignored when using "single backup" #194

Closed stefangries closed 3 months ago

stefangries commented 5 months ago

Hello everyone,

When using the following command, the mirror flag is ignored:

docker run --rm -v /hostpath/data:/data ghcr.io/joeyates/imap-backup:latest \
  imap-backup single backup \
  --mirror --email XX@XX.XX --password XXXX --server mail.XX.XX \
  --path /data/XX

That results in mails, that are removed from the server, are not removed from the local mbox files. Is this a bug or am I doing something wrong?

joeyates commented 5 months ago

Hi @stefangries

You're right - single backup is missing this feature of the normal backup!

I'll add it to the TODO list

stefangries commented 5 months ago

Thank you @joeyates very much for your super-fast reply and clarifying this! As the cli takes this argument, I thought this is already useable. https://github.com/joeyates/imap-backup/blob/9f1d1d96ccdc75e5afb1941e63b44228c27f840d/lib/imap/backup/cli/single/backup.rb#L31

Is there a way to do IMAP to local MBOX backups with the current feature set where mirror is supported?

joeyates commented 5 months ago

@stefangries You can create a config file and use that with Docker/Podman.

Something like this:

docker \
  run \
  --rm \
  -v /hostpath/data:/data \
  -v /hostpath/config:/config \
  ghcr.io/joeyates/imap-backup:latest \
  imap-backup backup \
  --config /config/my-config.json

First, you need to create /hostpath/config/my-config.json.

You can do that with Docker/Podman too:

docker \
  run \
  --rm \
  -ti \
  -v /hostpath/data:/data \
  -v /hostpath/config:/config \
  ghcr.io/joeyates/imap-backup:latest \
  imap-backup setup \
  --config /config/my-config.json

(Remember the -ti!)

stefangries commented 5 months ago

Thank you! Is -ti really necessary? I'm using Synology Task Scheduler which has no tty and gives me the input device is not a TTYerror when using -ti.

I now understood that this is only necessary for setup, but not for backup.

joeyates commented 3 months ago

Fixed in v14.6.1