code: def do_storecheck(self, subcmd, opts):
          
          from os.path import basename
          from os.path import dirname
          from os.path import exists as existspath
          from os.path import islink
          from os.path import join as joinpath
          maildir = self.maildir
          cur = joinpath(maildir, "cur")
          new = joinpath(maildir, "new")
          store = joinpath(maildir, "store")
          
          found_list = []
          # Loop through the folders checking that everything maps back to the store
          for scandir in [cur, new]:
              for f in os.listdir(scandir):
                  filename = joinpath(scandir, f)
                  try:
                      assert islink(filename)
                      store_location = os.readlink(filename)
                      assert existspath(store_location) and dirname(store_location) == store
                  except AssertionError:
                      print("%s was not a link into the store" % (
                              "/".join([
                                      filename.split("/")[-2],
                                      filename.split("/")[-1]
                                      ])
                              ), 
                            file=self.stdout)
                  else:
                      found_list.append(basename(store_location))
  
          for storefile in os.listdir(store):
              if storefile not in found_list:
                  print(
                      "%s found in store but not folders" % joinpath("store", storefile), 
                      file=self.stdout
                      )
docs: ${cmd_name}: checks the store for files that may not be in the maildirs.