title: Javamail: Authenticate as admin user, authorize as other user
body: <p>Imapsync has an admin auth option i.e. <code>--authuser1/--authuser2</code> that allows you to mimic a login to a user's imap account without knowing the user password.</p>
  
  <p>This works specifically for Zimbra and helps to sync imap stores between backup locations. </p>
  
  <p>However imapsync opens a new connection for each mailbox, and takes a lot of time to sync folders.</p>
  
  <p>How do you achieve an imap login with javamail as an administrator user, and authorize as another user, and possibly reuse the connection for selecting multiple users?</p>
  
  <p>Ultimately, I want to:</p>
  
  <ol>
  <li>avoid initiating a network connection for each user</li>
  <li>sync mailboxes without knowing user passwords</li>
  </ol>