title: How do I find every non-empty Junk folder on an IMAP server?
body: <p>If my users are all under, say:</p>
  
  <pre><code>/imap/user1
  /imap/user2
  /imap/user3
  </code></pre>
  
  <p>How do I find all of the non-empty <strong>.Junk/cur/</strong> folders under <strong>/imap</strong> ?</p>
  
  <p>There is this <a href="https://stackoverflow.com/questions/815668/how-to-list-non-empty-subdirectories-on-linux">How to list non-empty subdirectories on linux?</a> but I only want the non-empty subdirectories named <strong>cur</strong> that are themselves under a directory <strong>.Junk</strong></p>
  
  <p>I'm basically trying to find all the email that a given set of users on a server are marking as Junk/Spam.</p>