diff --git a/includes/rules.core.inc b/includes/rules.core.inc
index bed6a0e..ef71cc4 100644
--- a/includes/rules.core.inc
+++ b/includes/rules.core.inc
@@ -24,6 +24,11 @@ class RulesEntityController extends EntityAPIControllerExportable {
         $entity->$field = $record->$field;
       }
       unset($entity->data, $entity->plugin);
+      $entity->dependencies = db_select('rules_dependencies')
+        ->fields('rules_dependencies', array('module'))
+        ->condition('id', $entity->id)
+        ->execute()
+        ->fetchCol('module');
       $entities[$entity->id] = $entity;
     }
     $queried_entities = $entities;
@@ -91,6 +96,26 @@ class RulesEntityController extends EntityAPIControllerExportable {
     $config->import($export);
     return $config;
   }
+
+  public function save($rules_config, DatabaseTransaction $transaction = NULL) {
+    $return = parent::save($rules_config, $transaction);
+    $this->storeDependencies($rules_config);
+    return $return;
+  }
+
+  protected function storeDependencies($rules_config) {
+    db_delete('rules_dependencies')
+      ->condition('id', $rules_config->id)
+      ->execute();
+    foreach ($rules_config->dependencies() as $dependency) {
+      db_insert('rules_dependencies')
+        ->fields(array(
+        'id' => $rules_config->id,
+        'module' => $dependency,
+      ))
+      ->execute();
+    }
+  }
 }
 
 /**
@@ -509,7 +534,10 @@ abstract class RulesPlugin extends RulesExtendable {
   }
 
   /**
-   * Returns an array of required modules.
+   * Calculates an array of required modules.
+   *
+   * You can use $this->dependencies to access dependencies for saved
+   * configurations.
    */
   public function dependencies() {
     $this->processSettings();
@@ -583,9 +611,10 @@ abstract class RulesPlugin extends RulesExtendable {
     // First process the settings if not done yet.
     $this->processSettings();
     // Check dependencies.
-    foreach ($this->dependencies() as $module) {
+    $dependencies = isset($this->dependencies) ? $this->dependencies : $this->dependencies();
+    foreach ($dependencies as $module) {
       if (!module_exists($module)) {
-        throw new RulesException('Missing required module %name.', array('%name' => $module), $this);
+        throw new RulesDependencyException('Missing required module %name.', array('%name' => $module), $this);
       }
     }
     // Check the parameter settings.
@@ -2167,6 +2196,11 @@ class RulesException extends Exception {
 }
 
 /**
+ * An exception for missing dependencies.
+ */
+class RulesDependencyException extends RulesException {}
+
+/**
  * Determines the plugin to be used for importing a child element.
  *
  * @param $key
diff --git a/rules.install b/rules.install
index 9ab261e..98b7054 100644
--- a/rules.install
+++ b/rules.install
@@ -117,6 +117,27 @@ function rules_schema() {
       'id' => array('rules_config' => 'id'),
     ),
   );
+  $schema['rules_dependencies'] = array(
+    'fields' => array(
+      'id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => 'The primary identifier of the configuration.',
+      ),
+      'module' => array(
+        'type' => 'varchar',
+        'length' => '255',
+        'not null' => TRUE,
+        'default' => '',
+        'description' => 'The name of the module that is required for the configuration.',
+      ),
+    ),
+    'primary key' => array('id', 'module'),
+    'foreign keys' => array(
+      'id' => array('rules_config' => 'id'),
+    ),
+  );
   $schema['cache_rules'] = drupal_get_schema_unprocessed('system', 'cache');
   $schema['cache_rules']['description'] = 'Cache table for the rules engine to store configured items.';
   return $schema;
@@ -175,6 +196,13 @@ function rules_update_7200() {
         'size' => 'tiny',
         'description' => 'The exportable status of the entity.',
       ),
+      'dirty' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0x00,
+        'size' => 'tiny',
+        'description' => 'Indicates broken configurations. 0 = OK, 1 = missing dependency, 2 = failed integrity check.',
+      ),
       'module' => array(
         'description' => 'The name of the providing module if the entity has been defined in code.',
         'type' => 'varchar',
@@ -255,3 +283,58 @@ function rules_update_7201() {
 function rules_update_7202() {
   db_add_index('rules_config', 'plugin', array('plugin'));
 }
+
+/**
+ * Add the rules_dependencies DB table and the "dirty" DB field.
+ */
+function rules_update_7204() {
+  if (!db_table_exists('rules_dependencies')) {
+    $schema['rules_dependencies'] = array(
+      'fields' => array(
+        'id' => array(
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+          'description' => 'The primary identifier of the configuration.',
+        ),
+        'module' => array(
+          'type' => 'varchar',
+          'length' => '255',
+          'not null' => TRUE,
+          'default' => '',
+          'description' => 'The name of the module that is required for the configuration.',
+        ),
+      ),
+      'primary key' => array('id', 'module'),
+      'foreign keys' => array(
+        'id' => array('rules_config' => 'id'),
+      ),
+    );
+    db_create_table('rules_dependencies', $schema['rules_dependencies']);
+  }
+  if (!db_field_exists('rules_config', 'dirty')) {
+    db_add_field('rules_config', 'dirty', array(
+      'type' => 'int',
+      'not null' => TRUE,
+      'default' => 0x00,
+      'size' => 'tiny',
+      'description' => 'Indicates broken configurations. 0 = OK, 1 = missing dependency, 2 = failed integrity check.',
+    ));
+  }
+  // Store dependencies for existing rules.
+  $configs = rules_config_load_multiple(FALSE);
+  foreach ($configs as $rules_config) {
+    // Delete first to avoid insert errors if the update is run more than once.
+    db_delete('rules_dependencies')
+      ->condition('id', $rules_config->id)
+      ->execute();
+    foreach ($rules_config->dependencies() as $dependency) {
+      db_insert('rules_dependencies')
+        ->fields(array(
+        'id' => $rules_config->id,
+        'module' => $dependency,
+      ))
+      ->execute();
+    }
+  }
+}
diff --git a/rules.module b/rules.module
index af72cf6..d9d2a24 100644
--- a/rules.module
+++ b/rules.module
@@ -1092,6 +1092,26 @@ function rules_element_info() {
  */
 function rules_modules_enabled($modules) {
   rules_clear_cache();
+  // Re-enable Rules configurations that depend on the modules.
+  foreach ($modules as $module) {
+    $query = db_select('rules_dependencies', 'rd');
+    $query->join('rules_config', 'rc', 'rd.id = rc.id');
+    $ids = $query->fields('rd', array('id'))
+      ->condition('rd.module', $module)
+      ->condition('rc.dirty', 0x01)
+      ->execute()
+      ->fetchCol();
+    $rules_configs = entity_load('rules_config', $ids);
+    foreach ($rules_configs as $rules_config) {
+      try {
+        $rules_config->integrityCheck();
+        // If no exceptions were thrown we can set the configuration back to OK.
+        $rules_config->dirty = 0x00;
+        $rules_config->save();
+      }
+      catch (RulesException $e) {}
+    }
+  }
 }
 
 /**
@@ -1099,7 +1119,23 @@ function rules_modules_enabled($modules) {
  */
 function rules_modules_disabled($modules) {
   rules_clear_cache();
-  //TODO: Disable configs with now broken dependencies?
+  // Disable Rules configurations that depend on the modules.
+  foreach ($modules as $module) {
+    $ids = db_select('rules_dependencies')
+      ->fields('rules_dependencies', array('id'))
+      ->condition('module', $module)
+      ->execute()
+      ->fetchCol();
+    foreach ($ids as $id) {
+      db_update('rules_config')
+        ->fields(array('dirty' => 0x01))
+        ->condition('id', $id)
+        ->execute();
+    }
+    if (!empty($ids)) {
+      drupal_set_message(t('Some Rules configurations have been marked as dirty and will not be executed anymore.'), 'warning');
+    }
+  }
 }
 
 /**
