sync-config modeling

A sync object holds (and provides an API to use) a set of configs.
Here I create the Sync model to handle this and hook it up to
a Config and provide ways to configure a sync.
renamed from inbox-syncro to inbox-sync

yeah, the old name just didn't hold up as I was developing it.  Its
important to get this one right.
Merge pull request #2 from kellyredding/rename

Rename
better SMTP config defaults

I changed the port to the default 25 and tls encryption to false.
added login and logout abilities to the `Sync` object

Calling `login` will create the necessary IMAP/SMTP
objects and set them up accordingly.  Calling `logout`
will logout and reset any IMAP/SMTP objects if they
were previously logged in.

Calling `login` also validates the configs to catch
any configuration problems before they blow up somewhere
else in the code as they are being used.
adding a configurable logger

Specify a logger to use.  Will log the details of each sync.  Defaults
to `Logger.new(STDOUT)`.
mail item handler

A MailItem is a Mail::Message along with its raw IMAP meta that
is cared about.
find source mail items and iterate

This provides some utilities for retreiving a list of source mail
items and iterating over them.  This also adds a uid reader to the
`MailItem` model for tracking and use.
improved logging of sync handling

This adds more detailed log messages and also logs all sync info
at the more appropriate DEBUG level.  All runner logging should
be done at the higher INFO level.
append mail items to dest inbox

A sync can now append a given `MailItem` to the destination inbox.
Appending returns the destination UID of the appended mail item.
archive sync'd mail items

This provides a way to take a given source mail item and archive
it on the source.  If an `archive_folder` in configured, that folder
will be created on the source (if needed) and the mail item copied
to it, marked as seen, and deleted from the inbox.  If no
`archive_folder` is specified, messages will be deleted from the
inbox with no archive.
the `archive_folder` config is not required

Omitting turns off source archiving.
basic runner

A Runner runs syncs.  Loops indefinitely, running syncs every
`:timeout` seconds, trapping `SIGINT` and `SIGQUIT` for safe
shutdown.
rescue individual message errors

Don't fail the whole sync just because one message fails to sync.
Try the whole set and sync the ones you can.
reorganizing sync logic

I needed to reorganize the sync handling some to

1) better capture and handle errors
2) provide a cleaner sync API

Specifically this runs each append to the destination in its own
IMAP session.  The destination IMAP is logged in/out before/after
the append.  This helps if the server rejects the append and
corrupts the connection.
send notifications when errors occur

The idea is that the syncs will be running in some bg daemon or
something.  When an error occurs, the sync needs to send a notification
that an error has occured the user knows they aren't receiving some
email.

The errors are still logged but a message will be sent using the
`notify` config settings.  If an error occurs sending the notice
(ie Timeout::Error), it is simply logged and the sync continues
running.
update the sync to configure the notify smtp first on setup

The notify smtp needs to be setup before we can send any
notifications.  We need to set that up first on sync setup
so that any errors that follow can have their notification
sent.
send a notification when running a sync fails

Mail item sync errors will be caught and notified separately. This
covers when something not mail item specific errors (ie, loggin in,
fetching source mails, etc).
updated and tested runner

Reorganized the runner to ensure any running sync threads join
before quitting the runner.  No longer need any `run_lock` concept
b/c every loop run it waits for the thread to join.  The interval
and the main thread sleeping for that interval exist to ensure
at most only one pass of syncs happens per interval.

Added some basic tests to ensure the runner API and initialize
behavior.
ensure source mail items are archived

Since we are notifying about each mail item that fails to sync,
we can go ahead and archive them instead of leaveing them in the
inbox.  If we left them in the inbox, each interval they would
be notified again and again creating unecessary spam.