diff --git a/includes/simplenews.mail.inc b/includes/simplenews.mail.inc
index 663c55b..797df69 100644
--- a/includes/simplenews.mail.inc
+++ b/includes/simplenews.mail.inc
@@ -472,7 +472,28 @@ function simplenews_count_spool(array $conditions = array()) {
   $query = db_select('simplenews_mail_spool');
   // Add conditions.
   foreach ($conditions as $field => $value) {
-    $query->condition($field, $value);
+    if ($field == 'status') {
+      if (!is_array($value)) {
+        $value = array($value);
+      }
+      $status_or = db_or();
+      foreach ($value as $status) {
+        // Do not count pending entries unless they are expired.
+        if ($status == SIMPLENEWS_SPOOL_IN_PROGRESS) {
+          $status_or->condition(db_and()
+            ->condition('status', $status)
+            ->condition('timestamp', simplenews_get_expiration_time(), '<')
+          );
+        }
+        else {
+          $status_or->condition('status', $status);
+        }
+      }
+      $query->condition($status_or);
+    }
+    else {
+      $query->condition($field, $value);
+    }
   }
 
   $query->addExpression('COUNT(*)', 'count');
diff --git a/tests/simplenews.test b/tests/simplenews.test
index c12f43a..c68e1ae 100644
--- a/tests/simplenews.test
+++ b/tests/simplenews.test
@@ -1877,6 +1877,9 @@ class SimplenewsSendTestCase extends SimplenewsTestCase {
 
     // Send mails.
     simplenews_mail_spool();
+    simplenews_clear_spool();
+    // Update sent status for newsletter admin panel.
+    simplenews_send_status_update();
 
     // Verify mails.
     $mails = $this->drupalGetMails();
@@ -1887,6 +1890,34 @@ class SimplenewsSendTestCase extends SimplenewsTestCase {
       unset($this->subscribers[$mail['to']]);
     }
     $this->assertEqual(0, count($this->subscribers), t('all subscribers have been received a mail'));
+
+    // Create another node.
+    $node = new stdClass();
+    $node->type = 'simplenews';
+    $node->title = $this->randomName();
+    $node->uid = 0;
+    $node->status = 1;
+    $node->language = LANGUAGE_NONE;
+    $node->field_simplenews_term[LANGUAGE_NONE][0]['tid'] = $this->getRandomNewsletter();
+    node_save($node);
+
+    // Send the node.
+    simplenews_add_node_to_spool($node);
+
+    // Make sure that they have been added.
+    $this->assertEqual(simplenews_count_spool(), 5);
+
+    // Mark them as pending, fake a currently running send process.
+    $this->assertEqual(count(simplenews_get_spool(2)), 2);
+
+    // Those two should be excluded from the count now.
+    $this->assertEqual(simplenews_count_spool(), 3);
+
+    // Get two additional spool entries.
+    $this->assertEqual(count(simplenews_get_spool(2)), 2);
+
+    // Now only one should be returned by the count.
+    $this->assertEqual(simplenews_count_spool(), 1);
   }
 
   /**
