 .../mailhandler_default.feeds_importer_default.inc |    4 --
 plugins/feeds/plugins/MailhandlerParser.class.php  |   29 +++++-----------
 .../MailhandlerCommandsExtendedHeaders.class.php   |   34 --------------------
 .../MailhandlerCommandsExtendedHeaders.inc         |   16 ---------
 tests/mailhandler.test                             |    1 -
 5 files changed, 9 insertions(+), 75 deletions(-)

diff --git a/modules/mailhandler_default/mailhandler_default.feeds_importer_default.inc b/modules/mailhandler_default/mailhandler_default.feeds_importer_default.inc
index 7bf5943..5125e6a 100644
--- a/modules/mailhandler_default/mailhandler_default.feeds_importer_default.inc
+++ b/modules/mailhandler_default/mailhandler_default.feeds_importer_default.inc
@@ -28,10 +28,6 @@ function mailhandler_default_feeds_importer_default() {
       'config' => array(
         'default_commands' => 'status: 1',
         'commands_failed_auth' => 'status: 0',
-        'command_plugin' => array(
-          'MailhandlerCommandsDefault' => 'MailhandlerCommandsDefault',
-          'MailhandlerCommandsHeaders' => 'MailhandlerCommandsHeaders',
-        ),
         'authenticate_plugin' => 'MailhandlerAuthenticateDefault',
         'available_commands' => 'status',
       ),
diff --git a/plugins/feeds/plugins/MailhandlerParser.class.php b/plugins/feeds/plugins/MailhandlerParser.class.php
index c5c8d57..816ef02 100644
--- a/plugins/feeds/plugins/MailhandlerParser.class.php
+++ b/plugins/feeds/plugins/MailhandlerParser.class.php
@@ -17,7 +17,6 @@ class MailhandlerParser extends FeedsParser {
       'default_commands' => 'status: 1',
       'commands_failed_auth' => 'status: 0',
       'available_commands' => 'status',
-      'command_plugin' => array('MailhandlerCommandsDefault', 'MailhandlerCommandsFiles', 'MailhandlerCommandsHeaders'),
       'authenticate_plugin' => 'MailhandlerAuthenticateDefault',
     );
   }
@@ -38,14 +37,6 @@ class MailhandlerParser extends FeedsParser {
   public function configForm(&$form_state) {
     $form = array();
     ctools_include('plugins');
-    $form['command_plugin'] = array(
-      '#type' => 'select',
-      '#title' => t('Command plugins'),
-      '#description' => t('Choose the command plugins to use'),
-      '#options' => _mailhandler_build_options(mailhandler_get_plugins('mailhandler', 'commands')),
-      '#multiple' => TRUE,
-      '#default_value' => $this->config['command_plugin'],
-    );
     $form['authenticate_plugin'] = array(
       '#type' => 'select',
       '#title' => t('Authentication plugin'),
@@ -54,11 +45,10 @@ class MailhandlerParser extends FeedsParser {
       '#default_value' => $this->config['authenticate_plugin'],
       '#required' => FALSE,
     );
-    if (($plugins = $this->config['command_plugin']) && is_array($plugins) && !empty($plugins)) {
-      foreach ($plugins as $plugin) {
-        if ($class = mailhandler_plugin_load_class('mailhandler', $plugin, 'commands', 'handler')) {
-          $class->configForm($form, $form_state, $this->config);
-        }
+    $plugins = mailhandler_get_plugins('mailhandler', 'commands');
+    foreach ($plugins as $plugin_name => $plugin) {
+      if ($class = mailhandler_plugin_load_class('mailhandler', $plugin_name, 'commands', 'handler')) {
+        $class->configForm($form, $form_state, $this->config);
       }
     }
     return $form;
@@ -113,12 +103,11 @@ class MailhandlerParser extends FeedsParser {
    * Parse and apply commands.
    */
   public function commands(&$message, $source) {
-    if (($plugins = $this->config['command_plugin']) && is_array($plugins) && !empty($plugins)) {
-      foreach ($plugins as $plugin) {
-        if ($class = mailhandler_plugin_load_class('mailhandler', $plugin, 'commands', 'handler')) {
-          $class->parse($message, $source);
-          $class->process($message, $source);
-        }
+    $plugins = mailhandler_get_plugins('mailhandler', 'commands');
+    foreach ($plugins as $plugin_name => $plugin) {
+      if ($class = mailhandler_plugin_load_class('mailhandler', $plugin_name, 'commands', 'handler')) {
+        $class->parse($message, $source);
+        $class->process($message, $source);
       }
     }
   }
diff --git a/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.class.php b/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.class.php
deleted file mode 100644
index 26aeb01..0000000
--- a/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.class.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * @file
- * MailhandlerCommandsExtendedHeaders class.
- */
-
-class MailhandlerCommandsExtendedHeaders extends MailhandlerCommandsHeaders {
-
-  /**
-   * Build configuration form.
-   */
-  public function configForm(&$form, &$form_state, $config) {
-    $form['extended_headers'] = array(
-      '#type' => 'textarea',
-      '#title' => t('Extended headers'),
-      '#description' => t('Additional headers that can be mapped to Feeds processor targets.'),
-      '#default_value' => $config['extended_headers'],
-    );
-  }
-
-  function getMappingSources($config) {
-    $sources = array();
-    $extended_headers = explode("\n", $config['extended_headers']);
-    foreach ($extended_headers as $header) {
-      $header = trim($header);
-      $sources[$header] = array(
-        'name' => $header,
-        'description' => $header . ' (extended header)',
-      );
-    }
-    return $sources;
-  }
-
-}
diff --git a/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.inc b/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.inc
deleted file mode 100644
index 65cf723..0000000
--- a/plugins/mailhandler/commands/MailhandlerCommandsExtendedHeaders.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/**
- * @file
- * MailhandlerCommandsExtendedHeaders class.
- */
-
-$plugin = array(
-  'name' => 'Extended headers processor',
-  'description' => 'Provides arbitrary IMAP headers as mapping sources.',
-  'handler' => array(
-    'class' => 'MailhandlerCommandsExtendedHeaders',
-    'parent' => 'MailhandlerCommandsHeaders',
-  ),
-  'file' => 'MailhandlerCommandsExtendedHeaders.class.php',
-  'weight' => 0,
-);
diff --git a/tests/mailhandler.test b/tests/mailhandler.test
index c95bbaf..3bebfa0 100644
--- a/tests/mailhandler.test
+++ b/tests/mailhandler.test
@@ -93,7 +93,6 @@ class MailhandlerTestCase extends DrupalWebTestCase {
     // Override Mailhandler Default importer, map taxonomy and files.
     $this->drupalGet('admin/structure/feeds/edit/mailhandler_nodes/settings/MailhandlerParser');
     $edit = array();
-    $edit['command_plugin[]'] = array('MailhandlerCommandsHeaders', 'MailhandlerCommandsDefault', 'MailhandlerCommandsFiles');
     $edit['available_commands'] = 'status' . "\n" . 'taxonomy';
     $this->drupalPost(NULL, $edit, t('Save'));
     $this->drupalGet('admin/structure/feeds/edit/mailhandler_nodes/mapping');
