[ingo] added function reject (INGO_STORAGE_ACTION_REJECT) to procmail.php script

Tim Gorter email at teletechnics.com
Wed Aug 20 15:20:52 PDT 2003


Index: ingo/lib/Script/procmail.php
===================================================================
RCS file: /repository/ingo/lib/Script/procmail.php,v
retrieving revision 1.26
diff -u -r1.26 procmail.php
--- ingo/lib/Script/procmail.php        18 Aug 2003 20:49:50 -0000      1.26
+++ ingo/lib/Script/procmail.php        20 Aug 2003 22:16:36 -0000
@@ -29,6 +29,7 @@
         INGO_STORAGE_ACTION_DISCARD,
         INGO_STORAGE_ACTION_REDIRECT,
         INGO_STORAGE_ACTION_REDIRECTKEEP,
+        INGO_STORAGE_ACTION_REJECT
     );
 
     /**
@@ -171,6 +172,7 @@
             case INGO_STORAGE_ACTION_DISCARD:
             case INGO_STORAGE_ACTION_REDIRECT:
             case INGO_STORAGE_ACTION_REDIRECTKEEP:
+            case INGO_STORAGE_ACTION_REJECT:
                 $this->addComment($rule['name']);
 
                 if ($rule['combine'] == INGO_STORAGE_COMBINE_ALL) {
@@ -196,6 +198,10 @@
                     case INGO_STORAGE_ACTION_REDIRECTKEEP:
                         $action->redirectKeep($rule['action-value']);
                         break;
+
+                    case INGO_STORAGE_ACTION_REJECT:
+                        $action->reject($rule['action-value']);
+                        break;
                     }
 
                     foreach($rule['conditions'] as $test) {
@@ -228,6 +234,10 @@
                         case INGO_STORAGE_ACTION_REDIRECTKEEP:
                             $action->redirectKeep($rule['action-value']);
                             break;
+
+                        case INGO_STORAGE_ACTION_REJECT:
+                            $action->reject($rule['action-value']);
+                            break;
                         }
 
                         $condition->addTest($test['field'], $test['value']);
@@ -463,6 +473,21 @@
         $this->_action .= "  :0\n";
         /* NOTE: '$DEFAULT' here is a literal, not a PHP variable. */
         $this->_action .= '  $DEFAULT' . "\n";
+        $this->_action .= '}';
+        $this->_flags = '';
+        $this->_lock = '';
+    }
+
+    /**
+     * Set an action to reject the email.
+     *
+     * @access public
+     */
+    function reject($exitcode)
+    {
+        $this->_action = "{\n";
+        $this->_action .= "  EXITCODE=$exitcode\n";
+        $this->_action .= "  HOST=\"no.address.here\"\n";
         $this->_action .= '}';
         $this->_flags = '';
         $this->_lock = '';



More information about the ingo mailing list