def getfiles(self, dir):
        """ Walk throught the dir where mails are stored
        """
        for (dirpath, dirnames, filenames) in os.walk(dir):
            subdir=self.getSubdir(dir, dirpath)
            if  (prm.includeDirs==[] or subdir in prm.includeDirs) and subdir not in prm.excludeDirs:
                for file in [filenames[i] for i in range(len(filenames)) if not fnmatch.fnmatch(filenames[i], '*.msf')]:
                    if (prm.includeFiles==[] or file in prm.includeFiles) and file not in prm.excludeFiles:
                        self.writelog("-"*78)
                        self.writelog(os.path.join(subdir, file))
                        yield (dirpath, file)
            else:
                for e in dirnames[:]:
                    dirnames.pop()
 Walk throught the dir where mails are stored
        
recipes/Python/576749_Detach_Thunderbird_emails_keep/recipe-576749.py