diff --git a/includes/maillog.mail.inc b/includes/maillog.mail.inc
index ad30769..bb1b351 100644
--- a/includes/maillog.mail.inc
+++ b/includes/maillog.mail.inc
@@ -90,7 +90,17 @@ class MaillogMailSystem implements MailSystemInterface {
       dpm($devel_msg, 'maillog');
     }
 
-    if (variable_get('maillog_send', TRUE)) {
+    // Get the whitelist and convert it to an array.
+    $whitelist = variable_get('maillog_whitelist', '');
+    $whitelist = explode("\n", $whitelist);
+    $whitelist = array_map('trim', $whitelist);
+
+    // Allow mail sending if maillog_send is enabled OR when
+    // maillog whitelist is enabled and the receiver is on the whitelist.
+    if (
+      variable_get('maillog_send', TRUE) ||
+      (variable_get('maillog_whitelist_enabled', FALSE) && in_array($message['to'], $whitelist))
+    ) {
       $mailclass = variable_get('maillog_engine', 'DefaultMailSystem');
       $default = new $mailclass();
       $result = $default->mail($message);
diff --git a/maillog.module b/maillog.module
index e4107fe..45ea82d 100644
--- a/maillog.module
+++ b/maillog.module
@@ -127,6 +127,29 @@ function maillog_admin_settings() {
     '#default_value' => variable_get('maillog_send', TRUE),
   );
 
+  $form['maillog_whitelist_enabled'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Allow the e-mails to be sent to the e-mail addresses in the whitelist.'),
+    '#default_value' => variable_get('maillog_whitelist_enabled', FALSE),
+    '#states' => array(
+      'visible' => array(
+        ':input[name="maillog_send"]' => array('checked' => FALSE),
+      ),
+    ),
+  );
+
+  $form['maillog_whitelist'] = array(
+    '#type' => 'textarea',
+    '#title' => t('E-mail address whitelist'),
+    '#default_value' => variable_get('maillog_whitelist', ''),
+    '#description' => t('Enter one e-mail address per line.'),
+    '#states' => array(
+      'visible' => array(
+        ':input[name="maillog_send"]' => array('checked' => FALSE),
+      ),
+    ),
+  );
+
   $form['maillog_log'] = array(
     '#type' => 'checkbox',
     '#title' => t("Create table entries in maillog table for each e-mail."),
