A simple tool that copies/moves messages from one IMAP mailbox (folder) to another

  • By delthas
  • Last update: Aug 31, 2022
  • Comments: 2

imap-forward

A simple tool that copies/moves messages from one IMAP mailbox (folder) to another.

It supports copying the messages as a one-time operation, or as a daemon (using IDLE for low-latency syncing).

Usage

To copy messages from inbox [email protected] to [email protected] once:

imap-forward -upstream-url example.com:993 -upstream-username [email protected] -upstream-password himom -downstream-url other.example.com:993 -downstream-username [email protected] -downstream-password hidad

To continuously move/forward messages from inbox [email protected] to [email protected]:

imap-forward -upstream-url example.com:993 -upstream-username [email protected] -upstream-password himom -downstream-url other.example.com:993 -downstream-username [email protected] -downstream-password hidad -move -sync

Acknowledgements

This is just 200 LoC over go-imap ;)

License

MIT

Download

imap-forward.zip

Comments(2)

  • 1

    speedup sync

    I'm need to keep in sync two imap folders and i see that imap-forward after start try one by one message sync, and its very slow. imap-sync can gave much more speed, does it possible to speedup sync process?

  • 2

    Default to "copy" instead of "move" behaviour

    I'm concerned about the default behaviour of this software: if the users aren't familiar with the CLI options, they might forget to put the "-copy" argument and accidentally delete all their messages from the source account.