--- Postfix.pm.old	2003-09-30 09:34:18.000000000 +0100
+++ Postfix.pm	2003-10-04 00:43:46.000000000 +0100
@@ -1028,6 +1028,7 @@
     my(%ModDate, $mta, $file, $file1, $file2, $tmpdate);
     my(@SortedFiles, $id, $newmessage, @queuedirnames);
     my($batchempty, $h1, $h2, $delay, $CriticalQueueSize);
+    my($nlinks);
 
     $queuedir  = new DirHandle;
     $queue1dir = new DirHandle;
@@ -1101,10 +1102,11 @@
               push @SortedFiles, "$queuedirname/$file/$file1";
               if ($UnsortedBatchesLeft<=0) {
                 # Running normally
-                $tmpdate = (stat("$file/$file1"))[9]; # 9 = mtime
+                ($nlinks, $tmpdate) = (stat("$file/$file1"))[3,9]; # 9 = mtime
                 next if -z _;
                 next unless -f _;
                 next unless -R _;
+                next if $nlinks>1; # Catch files being moved into "deferred"
                 $ModDate{"$queuedirname/$file/$file1"} = $tmpdate;
               }
               $MsgsInQueue++;
@@ -1120,10 +1122,11 @@
                 push @SortedFiles, "$queuedirname/$file/$file1/$file2";
                 if ($UnsortedBatchesLeft<=0) {
                   # Running normally
-                  $tmpdate = (stat("$file/$file1/$file2"))[9]; # 9 = mtime
+                  ($nlinks, $tmpdate) = (stat("$file/$file1/$file2"))[3,9];
                   next if -z _; # Skip 0-length queue files
                   next unless -f _;
                   next unless -R _;
+                  next if $nlinks>1; # Files being moved into "deferred"
                   $ModDate{"$queuedirname/$file/$file1/$file2"} = $tmpdate;
                 }
                 $MsgsInQueue++;