Esempio n. 1
0
 static function getMailContent($mailbox)
 {
     list($user, $dom) = explode("@", $mailbox);
     $path = mmail__qmail::getDir($dom);
     $ret = null;
     $maildir = "{$path}/{$user}/Maildir/new";
     self::parseDir($ret, $maildir);
     $maildir = "{$path}/{$user}/Maildir/cur";
     self::parseDir($ret, $maildir);
     $maildir = "{$path}/{$user}/Maildir/.Spam/new";
     self::parseDir($ret, $maildir);
     $maildir = "{$path}/{$user}/Maildir/.Spam/cur";
     self::parseDir($ret, $maildir);
     return $ret;
 }
 static function readSubscribeList($listname)
 {
     $var = explode('@', $listname);
     $mailpath = mmail__qmail::getDir($var[1]);
     $list = lxshell_output("/usr/bin/ezmlm-list", "{$mailpath}/{$var[0]}");
     $list = explode("\n", $list);
     $res = null;
     foreach ($list as $r) {
         if (!$r) {
             continue;
         }
         $r = trim($r);
         //$re['nname'] = "{$r}___$listname";
         $re['nname'] = $r;
         $re['address'] = $r;
         $res[] = $re;
     }
     return $res;
 }
Esempio n. 3
0
 function syncSpamUserPref()
 {
     global $gbl, $sgbl, $ghtml;
     // The parent can be either a domain or a user. CHeck for the @ sign.
     if (csa($this->main->nname, "@")) {
         list($user, $domain) = explode("@", $this->main->nname);
     } else {
         $domain = $this->main->nname;
         $user = null;
     }
     $sysuser = mmail__qmail::getUserGroup($domain);
     // --- issue #578/#721 - missing in version 6.1.6
     //	$mailpath = "/home/lxadmin/mail";
     $mailpath = mmail__qmail::getDir($domain);
     if ($user) {
         //	$prefpath = "$mailpath/domains/{$domain}/{$user}/.bogopref.cf";
         $prefpath = "{$mailpath}/{$user}/.bogopref.cf";
     } else {
         return;
     }
     $prefdir = dirname($prefpath);
     if (!lxfile_exists(dirname($prefpath))) {
         lxuser_mkdir($sysuser, dirname($prefpath));
     }
     $wname = fix_nname_to_be_variable($this->main->nname);
     $fdata = null;
     $cutoff = $this->main->spam_hit / 10 + 0.2;
     $fdata .= "spam_cutoff  {$cutoff}\n";
     $fdata .= "spam_subject_tag={$this->main->subject_tag}\n";
     $fdata .= "wordlist R,user,{$wname}.wordlist.db,1\n";
     $fdata .= "wordlist R,system,wordlist.db,2\n";
     $fdata .= "wordlist R,system,kloxo.wordlist.db,3\n";
     lxuser_put_contents($sysuser, $prefpath, $fdata);
     if (!lxfile_real("/var/bogofilter/{$wname}.wordlist.db")) {
         new_process_cmd($sysuser, null, "bogofilter -d /var/bogofilter/ --wordlist=R,user,{$wname}.wordlist.db,1  -n < /etc/my.cnf");
     }
     lxfile_touch("/var/bogofilter/wordlist.db");
     // Using generic because spamassasin is used on windows too. Or at least can be used.
     //lxfile_generic_chown("/var/bogofilter", mmail__qmail::getUserGroup($domain));
 }
Esempio n. 4
0
 function syncSpamUserPref()
 {
     global $gbl, $sgbl, $ghtml;
     // The parent can be either a domain or a user. CHeck for the @ sign.
     if (csa($this->main->nname, "@")) {
         list($user, $domain) = explode("@", $this->main->nname);
     } else {
         $domain = $this->main->nname;
         $user = null;
     }
     // --- issue #578/#721 - missing in version 6.1.6
     //	$mailpath = "/home/lxadmin/mail";
     $mailpath = mmail__qmail::getDir($domain);
     if ($user) {
         //	$prefpath = "$mailpath/domains/{$domain}/{$user}/user_prefs";
         $prefpath = "{$mailpath}/{$user}/user_prefs";
     } else {
         return;
     }
     if (!lxfile_exists(dirname($prefpath))) {
         lxfile_mkdir(dirname($prefpath));
         lxfile_generic_chown(dirname($prefpath), "lxpopuser:lxpopgroup");
     }
     $fdata = null;
     $fdata .= "required_score  " . $this->main->spam_hit . "\n";
     $fdata .= "ok_locales   all\n";
     $fdata .= "rewrite_header Subject  {$this->main->subject_tag}\n";
     foreach ((array) $this->main->wlist_a as $wlist) {
         $fdata .= "whitelist_from   " . $wlist->nname . "\n";
     }
     $fdata .= "#***********************************\n";
     foreach ((array) $this->main->blist_a as $blist) {
         $fdata .= "blocklist_from   " . $blist->nname . "\n";
     }
     lxfile_rm($prefpath);
     lfile_write_content($prefpath, $fdata, "lxpopuser:lxpopgroup");
 }
Esempio n. 5
0
 function getFfileFromVirtualList($name)
 {
     list($mailacc, $domain) = explode("@", $this->nname);
     $mailpath = mmail__qmail::getDir($domain);
     $name = coreFfile::getRealpath($name);
     $name = '/' . $name;
     $ffile = new Ffile($this->__masterserver, $this->__readserver, "{$mailpath}/{$mailacc}", $name, mmail__qmail::getUserGroup($domain));
     $ffile->__parent_o = $this;
     $ffile->get();
     return $ffile;
 }