src/Model/ProcmailRule.php line 154

Open in your IDE?
  1. <?php
  2. namespace App\Model;
  3. class ProcmailRule implements \JsonSerializable
  4. {   
  5.     private $id;
  6.     private $ruleNo;
  7.     private $ruleType;
  8.     private $ruleHeaderType;
  9.     private $ruleValue;
  10.     private $ruleDest;
  11.     private $ruleFinal;
  12.     private $ruleOwner;
  13.     private $destExist;
  14.     
  15.     public function __construct()
  16.     {
  17.         $this->ruleHeaderType '';
  18.         $this->destExist null;
  19.     }
  20.     
  21.     public function getId() : int
  22.     {
  23.         return $this->id;
  24.     }
  25.     
  26.     public function setId(int $id): self
  27.     {
  28.         $this->id $id;
  29.         return $this;
  30.     }
  31.     
  32.     public function getNo(): int
  33.     {
  34.         return $this->ruleNo;
  35.     }
  36.     
  37.     public function setNo(int $ruleNo): self
  38.     {
  39.         $this->ruleNo $ruleNo;
  40.         
  41.         return $this;
  42.     }
  43.     
  44.     public function getType(): ?string
  45.     {
  46.         if(substr($this->ruleType02) == "__") {
  47.             return substr($this->ruleType2);
  48.         }
  49.             
  50.         return $this->ruleType;
  51.     }
  52.     
  53.     public function setType(string $ruleType): self
  54.     {
  55.         $this->ruleType $ruleType;
  56.         
  57.         return $this;
  58.     }
  59.     public function getHeaderType(): ?string
  60.     {
  61.         return $this->ruleHeaderType;
  62.     }
  63.     
  64.     public function setHeaderType(string $ruleType): self
  65.     {
  66.         $this->ruleHeaderType $ruleType;
  67.         
  68.         return $this;
  69.     }
  70.     
  71.     public function getValue(): ?string
  72.     {
  73.         return $this->ruleValue;
  74.     }
  75.     
  76.     public function setValue(string $ruleValue): self
  77.     {
  78.         $this->ruleValue $ruleValue;
  79.         
  80.         return $this;
  81.     }
  82.     
  83.     public function getDest(): ?string
  84.     {
  85.         return $this->ruleDest;
  86.     }
  87.     
  88.     public function setDest(string $ruleDest): self
  89.     {
  90.         $this->ruleDest $ruleDest;
  91.         
  92.         return $this;
  93.     }
  94.     
  95.     public function getFinal(): int
  96.     {
  97.         return $this->ruleFinal;
  98.     }
  99.     
  100.     public function setFinal(int $ruleFinal): self
  101.     {
  102.         $this->ruleFinal $ruleFinal;
  103.         
  104.         return $this;
  105.     }
  106.     
  107.     public function getOwner(): ?string
  108.     {
  109.         return $this->ruleOwner;
  110.     }
  111.     
  112.     public function setOwner(string $ruleOwner): self
  113.     {
  114.         $this->ruleOwner $ruleOwner;
  115.         
  116.         return $this;
  117.     }
  118.     
  119.     public function isEnabled() : bool
  120.     {
  121.         if(substr($this->ruleType02) == "__") {
  122.             return false;
  123.         }
  124.         
  125.         return true;
  126.     }
  127.     
  128.     public function isDestEmail() : bool
  129.     {
  130.         if(substr($this->ruleDest03) == "...") {
  131.             return true;
  132.         }
  133.         
  134.         return false;
  135.     }
  136.     
  137.     public function isDestExist() : bool
  138.     {
  139.         if($this->destExist == true) {
  140.             return true;
  141.         }
  142.         
  143.         return false;
  144.     }
  145.     
  146.     public function setDestExist($exist)
  147.     {
  148.         $this->destExist $exist;
  149.     }
  150.     
  151.     public function jsonSerialize()
  152.     {
  153.         $vars get_object_vars($this);
  154.         return $vars;
  155.     }
  156.     
  157.     
  158.     
  159.     public static function mailHeaders()
  160.     {
  161.         $arr = [];
  162.         $arr['Auto-Submitted'] = 'Auto-Submitted';
  163.         $arr['Content-Transfer-Encoding'] = 'Content-Transfer-Encoding';
  164.         $arr['Content-Type'] = 'Content-Type';
  165.         $arr['Date'] = 'Date';
  166.         $arr['Importance'] = 'Importance';
  167.         $arr['List-Id'] = 'List-Id';
  168.         $arr['Mailing-List'] = 'Mailing-List';
  169.         $arr['MailingList'] = 'MailingList';
  170.         $arr['Message-ID'] = 'Message-ID';
  171.         $arr['MIME-Version'] = 'MIME-Version';
  172.         $arr['Organization'] = 'Organization';
  173.         $arr['Precedence'] = 'Precedence';
  174.         $arr['Received'] = 'Received';
  175.         $arr['Received-SPF'] = 'Received-SPF';
  176.         $arr['Reply-To'] = 'Reply-To';
  177.         $arr['Resent-From'] = 'Resent-From';
  178.         $arr['Resent-To'] = 'Resent-To';
  179.         $arr['Return-Path'] = 'Return-Path';
  180.         $arr['Sender'] = 'Sender';
  181.         $arr['User-Agent'] = 'User-Agent';
  182.         $arr['X-List'] = 'X-List';
  183.         $arr['X-List-Name'] = 'X-List-Name';
  184.         $arr['X-Mailer'] = 'X-Mailer';
  185.         $arr['X-Mailing-List'] = 'X-Mailing-List';
  186.         $arr['X-MailingList'] = 'X-MailingList';
  187.         $arr['X-ML-Name'] = 'X-ML-Name';
  188.         $arr['X-MSMail-Priority'] = 'X-MSMail-Priority';
  189.         $arr['X-Priority'] = 'X-Priority';
  190.         $arr['X-Qmailux-Mail-From'] = 'X-Qmailux-Mail-From';
  191.         $arr['X-Spam-Flag'] = 'X-Spam-Flag';
  192.         $arr['X-Spam-Status'] = 'X-Spam-Status';
  193.         return $arr;
  194.     }
  195. }