aboutsummaryrefslogtreecommitdiff
path: root/Maildir.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Maildir.hs')
-rw-r--r--Maildir.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Maildir.hs b/Maildir.hs
index f76695a..ede0f44 100644
--- a/Maildir.hs
+++ b/Maildir.hs
@@ -29,8 +29,12 @@ getMaildirEmails md = do
n <- (getNewEmails md)
return $ r ++ n
-getReadEmails md = getDirectoryContents $ md </> "cur"
-getNewEmails md = getDirectoryContents $ md </> "new"
+getReadEmails md = getEmails $ md </> "cur"
+getNewEmails md = getEmails $ md </> "new"
+
+getEmails fp = do
+ contents <- getDirectoryContents fp
+ return $ map (fp </>) $ filter (`notElem` [".", ".."]) contents
{- | Returns information about specific messages. -}
getMessages :: Maildir -> [FilePath] -> IO [(FilePath, Flags, String)]
nihil fit ex nihilo