PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/code/classes/Daemon/PMaild/MTA/MailFilter/MailFilter.class.php

https://github.com/blekkzor/pinetd2
PHP | 30 lines | 24 code | 6 blank | 0 comment | 1 complexity | a4d1fed591f3bfbdfbc95f8d780e274b MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. namespace Daemon\PMaild\MTA\MailFilter;
  3. class MailFilter {
  4. protected $list;
  5. protected $domain;
  6. protected $localConfig;
  7. protected function domainFlags() {
  8. $flags = $this->domain->flags;
  9. return array_flip(explode(',', $flags));
  10. }
  11. function __construct($list, $domain, $localConfig) { // comma-separated list
  12. $this->list = explode(',', $list);
  13. $this->domain = $domain;
  14. $this->localConfig = $localConfig;
  15. }
  16. function process(&$txn) {
  17. foreach($this->list as $item) {
  18. $func = 'run_'.$item;
  19. $res = $this->$func($txn);
  20. if (!is_null($res)) return $res;
  21. }
  22. return null;
  23. }
  24. }