Description: Allow the spool to be on a filesystem that does not set d_type.
 Some filesystems (notably XFS) do not set the d_type field in the dirent
 structure.  This prevents dma from delivering any of the queued messages.
Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/
Bug-Debian: http://bugs.debian.org/544357
Forwarded: yes
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2010-06-18

--- a/spool.c
+++ b/spool.c
@@ -291,7 +291,8 @@
 		mailfn = NULL;
 
 		/* ignore temp files */
-		if (strncmp(de->d_name, "tmp_", 4) == 0 || de->d_type != DT_REG)
+		if (strncmp(de->d_name, "tmp_", 4) == 0 ||
+		    (de->d_type != DT_REG && de->d_type != DT_UNKNOWN))
 			continue;
 		if (de->d_name[0] != 'Q')
 			continue;
@@ -300,6 +301,9 @@
 		if (asprintf(&mailfn, "%s/M%s", config.spooldir, de->d_name + 1) < 0)
 			goto fail;
 
+		if (de->d_type == DT_UNKNOWN)
+			if (stat(queuefn, &sb) == -1 || !S_ISREG(sb.st_mode))
+				goto skip_item;
 		if (stat(mailfn, &sb) != 0)
 			goto skip_item;
 
