This is a very simple program which connects to an [IMAP] server and waits for email to arrive, using the `IDLE` command. Every time a new email arrives it runs a command. This can be useful to trigger a refresh in email clients that don't support `IDLE` themselves.
Although this is quite minimal and only implements a tiny subset of the IMAP protocol, it is supposed to be robust with respect to connection errors. The idea is that this gets started once at system startup and then survives bad wifi, suspending the machine, etc.
-i, --interval <INTERVAL> interval (in seconds) at which to run even if no email arrives
-c, --command <COMMAND> command to run when new mail arrives
-v, --verbose... show all server responses
-h, --help Print help information
Note that it only supports TLS encrypted IMAP and plain password authentication. Also, it currently reads the password from the command line, which isn't a great thing to do. I might change that eventually.