The domain of the email must be included in the poisonous source file.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 20 Oct 2008 22:03:16 +0000 (00:03 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 20 Oct 2008 22:03:16 +0000 (00:03 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/poison.php
modules/poison/poison.inc.php

index 02d973e..b012756 100644 (file)
@@ -28,7 +28,7 @@ class PoisonModule extends PLModule
         return array(
             'pe'          => $this->make_hook('poison', AUTH_PUBLIC, 'user', NO_HTTPS),
             'pem'         => $this->make_hook('mailto', AUTH_PUBLIC, 'user', NO_HTTPS),
-        //    'per'         => $this->make_hook('rand', AUTH_PUBLIC, 'user', NO_HTTPS),
+            // 'per'         => $this->make_hook('rand', AUTH_PUBLIC, 'user', NO_HTTPS),
         );
     }
 
index fdfea00..3e9b471 100644 (file)
@@ -38,11 +38,6 @@ function get_poison_emails($seed, $count)
     while (!feof($fd) && $i < $count) {
         $line = trim(fgets($fd));
         if (strlen($line) > 0) {
-            if ($seed % 27 > 13) {
-                $line .= '@' . $globals->mail->domain;
-            } else {
-                $line .= '@' . $globals->mail->domain2;
-            }
             $emails[] = $line;
             ++$seed;
         }
@@ -61,7 +56,10 @@ function randomize_poison_file()
     while (!feof($fd)) {
         $line = trim(fgets($fd));
         if (strlen($line) > 0) {
-            $entries[$line] = md5($line);
+            $m1 = $line . '@' . $globals->mail->domain;
+            $entries[$m1] = md5($m1);
+            $m2 = $line . '@' . $globals->mail->domain2;
+            $entries[$m2] = md5($m2);
         }
     }
     fclose($fd);