Using Gmail with IMAP to Receive Email in Rails // RailsTips by John Nunemaker
rgrove's larch at master - GitHub
Larch is a tool to copy messages from one IMAP server to another quickly and safely. It’s smart enough not to copy messages that already exist on the destination and robust enough to deal with interruptions caused by flaky connections or misbehaving servers.