Retain Archiving for Gmail authenticates to the Google Apps server through an IMAP connection. Once Retain is configured, it runs an initial dredge, which pulls all messages for a specified time frame (or all messages) for each mailbox and then archives those messages. The last archive is flagged so that each subsequent archive only pulls new messages from the last time an archive “job” was completed.