TODO
====

* Use optparse for syncers

  Add built-in help and clearer option and argument handling for the
  syncers using optparse.

* Use delay in watchers/checkers

  Currently, the checkers run every time the watcher emits a folder
  name.  Most maildir changes emit the same folder multiple times
  resulting in the checker running reduntantly.  With mswatch, the
  logic for coalescing events using a delay is in the mswatch process.
  To address this problem, that logic would have to be extended to the
  watchers.  This is another reason among many for reimplementing
  mswatch.

* Invoke OfflineIMAP in the same process

  Currently, mailsync invokes OfflineIMAP as a subprocess which is a
  little wasteful given how heavy launching a python app can be.  I
  briefly looked at the OfflineIMAP code to see if it could be easily
  done but was disappointed.
  
  It would be great if any OfflineIMAP people want to show me how I
  can do this.

* Long running syncers

  Currently, mswatch invokes the sync process anew every time.  Pretty
  much any sync process establishes one or more network connections.
  There's no need to do this every time.  Better to have a long
  running sync process that mswatch can feed the folders to sync as
  they require syncing.  Implementing this would require modifying or
  reimplementing mswatch itself.  It would also require support in the
  sync process.  Perhaps OfflineIMAP could be used as a library to
  accomplish this.

* Ignore duplicate maildir notifications

  As described_ on the mswatch page, every sync is redundantly issued
  twice.  To address this would require modifying or reimplementing
  mswatch itself.
  
  .. _described: http://mswatch.sourceforge.net/#limitations

* maildrop and gnus splitting?

  Maybe have maildrop directly invoke Gnus splitting and feed
  incomming messages to be split at time of delivery.  This would
  eliminate redundant syncs on the INBOX where gnus would otherwise
  just immediately move the message into another folder.  This
  approach is, however, probably way to heavy for a maildrop pipeline.
  
  An alternative approach would be to use a maildir (~/Incomming)
  separate from the real INBOX maildir (~/Maildir) where mails would
  first be delivered.  This incomming maildir could be monitored using
  a checker/watcher whose only real purpose is to get gnus to check
  the incomming maildir and split messages.  The split would then move
  the message to the destination or fallback to the real INBOX maildir
  which would in turn trigger any real watchers/checkers used by
  mswatch.
  
  This approach requires no additional mailsync support.  It also
  keeps maildrop job small and light, decoupling the gnus splitting
  work from delivery.
  
  An advantage of either approach is that mail would be split on the
  server even when the local mswatch wasn't connected.  As it is now,
  mail is only split when mswatch is running or if the Gnus running on
  the server checks all mail periodically.

* Use Gamin

  Use Gamin to provide compatibility across the file modification
  services available.
