Changeset 205

Show
Ignore:
Timestamp:
09/16/07 16:25:43 (16 months ago)
Author:
jonas
Message:
 
Location:
trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r203 r205  
     1CpVES 0.10 YYYY-MM-DD - Jonas Genannt - <jonas.genannt@brachium-system.net> 
     2        o Improved: sa_learn.pl no longer debug output 
     3        o Added: display mailbox size per domain 
    14CpVES 0.09 2007-09-15 - Jonas Genannt - <jonas.genannt@brachium-system.net> 
    25        o Improved: runScripts.sh create_fetchmail.pl should not run on trigger 
  • trunk/includes/check_access.php

    r169 r205  
    3030if (isset($_SESSION['p_fetchmail']))   $smarty->assign('p_fetchmail',$_SESSION['p_fetchmail']); 
    3131if (isset($_SESSION['p_autores_xheader']))   $smarty->assign('p_autores_xheader',$_SESSION['p_autores_xheader']); 
     32if (isset($_SESSION['p_spam_fwd']))   $smarty->assign('p_spam_fwd',$_SESSION['p_spam_fwd']); 
    3233 
    3334 
  • trunk/includes/config.inc.default.php

    r203 r205  
    4949 
    5050//IMAP Server: 
    51 $config['imap_server'] = "swetlana.brachium-system.net"; 
     51$config['imap_server'] = "mail.brachium-system.net"; 
    5252 
    5353//Company Name: 
     
    8484         "autoresponder_send", "email_options","fetchmail", 
    8585         "mailarchive","mailfilter","spamassassin","spamassassin_learn","autoresponder_xheader"); 
    86 $config['cpves_version']="0.09"; 
     86$config['cpves_version']="0.10-SVN"; 
    8787require_once(ROOT . '/includes/func.inc.php'); 
    8888?> 
  • trunk/includes/func.inc.php

    r203 r205  
    207207                        $do="p_mlists"; 
    208208                        break; 
     209                case 'spam_fwd': 
     210                        $do="p_spam_fwd"; 
     211                        break; 
    209212                default: 
    210213                        return false; 
  • trunk/includes/sites/domain_view.php

    r196 r205  
    200200        $result=&$db->query($sql); 
    201201        $data=$result->fetchrow(DB_FETCHMODE_ASSOC); 
    202          
    203202        $smarty->assign('dnsname', $data['dnsname']); 
    204         $smarty->assign('p_imap', $data['p_imap']); 
    205         $smarty->assign('p_pop3', $data['p_pop3']); 
    206         $smarty->assign('p_webmail', $data['p_webmail']); 
    207         $smarty->assign('p_spamassassin', $data['p_spamassassin']); 
    208         $smarty->assign('p_sa_learn', $data['p_sa_learn']); 
    209         $smarty->assign('p_spam_del', $data['p_spam_del']); 
    210         $smarty->assign('p_mailarchive', $data['p_mailarchive']); 
    211         $smarty->assign('p_bogofilter', $data['p_bogofilter']); 
    212         $smarty->assign('p_sa_wb_listing', $data['p_sa_wb_listing']); 
    213         $smarty->assign('p_fetchmail', $data['p_fetchmail']); 
    214         $smarty->assign('p_webinterface', $data['p_webinterface']); 
    215         $smarty->assign('p_autores_xheader', $data['p_autores_xheader']); 
    216         $smarty->assign('p_check_polw', $data['p_check_polw']); 
    217         $smarty->assign('p_check_grey', $data['p_check_grey']); 
    218         $smarty->assign('p_mlists', $data['p_mlists']); 
    219  
     203        $smarty->assign('domain', $data); 
    220204        $smarty->assign('max_emails', $data['max_email']); 
    221205        $smarty->assign('max_fwd', $data['max_forward']); 
    222         $smarty->assign('dnote', $data['dnote']); 
    223          
     206 
    224207$smarty->assign('emails', get_forem_domain($_GET['did'],'users', $db)); 
    225208$smarty->assign('forwardings', get_forem_domain($_GET['did'],'forwardings', $db)); 
  • trunk/includes/sites/email_view.php

    r193 r205  
    4949        $smarty->assign('if_check_polw', $data['p_check_polw']); 
    5050        $smarty->assign('if_check_grey', $data['p_check_grey']); 
     51        $smarty->assign('if_spam_fwd', $data['p_spam_fwd']); 
    5152        $sql=sprintf("SELECT passwd,cpasswd,email FROM users WHERE id='%s'", 
    5253                $db->escapeSimple($_GET['id'])); 
     
    467468                        { 
    468469                                $spam_del=0; 
     470                        } 
     471                        if (isset($_POST['spam_fwd']) && $_POST['spam_fwd'] =="enable" && check_domain_feature($_GET['did'],'p_spam_fwd')) { 
     472                                $spam_fwd=1; 
     473                        } 
     474                        else 
     475                        { 
     476                                $spam_fwd=0; 
    469477                        } 
    470478                        if (isset($_POST['sa_learn']) && $_POST['sa_learn'] =="enable" && check_domain_feature($_GET['did'],'p_sa_learn')) { 
     
    542550                        if (!$error) 
    543551                        { 
    544                                 $sql=sprintf("UPDATE users SET passwd='%s', full_name='%s',p_imap='%d', p_pop3='%d',p_webmail='%d',     cpasswd='%s', p_forwarding='%s',p_spamassassin='%s',p_mailarchive='%d',p_bogofilter='%d',p_spam_del='%d',p_sa_learn='%d',p_fetchmail='%d',p_webinterface='%d',p_autores_xheader='%d',p_check_polw='%d',p_check_grey='%d' WHERE id='%d' ", 
     552                                $sql=sprintf("UPDATE users SET passwd='%s', full_name='%s',p_imap='%d', p_pop3='%d',p_webmail='%d',     cpasswd='%s', p_forwarding='%s',p_spamassassin='%s',p_mailarchive='%d',p_bogofilter='%d',p_spam_del='%d',p_sa_learn='%d',p_fetchmail='%d',p_webinterface='%d',p_autores_xheader='%d',p_check_polw='%d',p_check_grey='%d',p_spam_fwd='%d' WHERE id='%d' ", 
    545553                                        $db->escapeSimple($cleartext), 
    546554                                        $db->escapeSimple($_POST['full_name']), 
     
    560568                                        $db->escapeSimple($check_polw), 
    561569                                        $db->escapeSimple($check_grey), 
     570                                        $db->escapeSimple($spam_fwd), 
    562571                                        $db->escapeSimple($_GET['id'])) ; 
    563572                                $result=&$db->query($sql); 
     
    591600        $smarty->assign('if_check_polw_value',$edata['p_check_polw']); 
    592601        $smarty->assign('if_check_grey_value',$edata['p_check_grey']); 
     602        $smarty->assign('if_spam_fwd_value',$edata['p_spam_fwd']); 
    593603        if ( !empty($edata['move_spam']) && $edata['move_spam']!=NULL) { 
    594604                $smarty->assign('sa_move_spam',$edata['move_spam'] ); 
  • trunk/includes/sites/login.php

    r175 r205  
    3131$_SESSION['p_fetchmail']='0'; 
    3232$_SESSION['p_autores_xheader']='0'; 
     33$_SESSION['p_spam_fwd']='0'; 
    3334 
    3435if (isset($_POST['email']) && isset($_POST['password']) && isset($_POST['login']) ) 
     
    7980                        $_SESSION['p_fetchmail']=check_du_fetaure($_SESSION['uid'],$daten['domainid'],'p_fetchmail'); 
    8081                        $_SESSION['p_autores_xheader']=check_du_fetaure($_SESSION['uid'],$daten['domainid'],'p_autores_xheader'); 
     82                        $_SESSION['p_spam_fwd']=check_du_fetaure($_SESSION['uid'],$daten['domainid'],'p_spam_fwd'); 
    8183                        $_SESSION['forwarding']=$daten['p_forwarding']; 
    8284                        $_SESSION['p_mailfilter']=$data_domain['p_mailfilter']; 
  • trunk/includes/sites/main.php

    r203 r205  
    7373                $vaction=0; 
    7474        } 
     75        //display size of all mailboxes 
     76        $sql=sprintf("SELECT SUM( mb_size ) AS sum FROM `users`WHERE domainid='%d'", 
     77                $db->escapeSimple($row['id'])); 
     78        $res_mb_size=&$db->query($sql); 
     79        $data_mb_size=$res_mb_size->fetchrow(DB_FETCHMODE_ASSOC); 
    7580        array_push($table_data, array( 
    7681         'dnsname' => $row['dnsname'], 
     
    8287         'dnote' => $row['dnote'], 
    8388         'vacation' => $vaction, 
    84          'vacation_infos' => $vaction_infos 
     89         'vacation_infos' => $vaction_infos, 
     90         'mb_size'        => $data_mb_size['sum'] 
    8591         ) 
    8692      ); 
  • trunk/includes/sites/user_spam.php

    r145 r205  
    125125                update_email_options($_SESSION['uid'],'del_known_spam','0',0); 
    126126        } 
     127        if (isset($_POST['spam_fwd_active']) && $_POST['spam_fwd_active']==1 ) { 
     128                if (Validate::email($_POST['spam_fwd_mail'])) { 
     129                        update_email_options($_SESSION['uid'],'spam_fwd_active','1',0); 
     130                        update_email_options($_SESSION['uid'],'spam_fwd_mail',$_POST['spam_fwd_mail'],0); 
     131                } 
     132                else { 
     133                        $smarty->assign('error_msg', 'y'); 
     134                        $smarty->assign('if_error_forwardaddr_valid', 'y'); 
     135                        update_email_options($_SESSION['uid'],'spam_fwd_active','0',0); 
     136                } 
     137        } 
     138        else { 
     139                update_email_options($_SESSION['uid'],'spam_fwd_active','0',0); 
     140        } 
    127141 
    128142 
     
    173187$del_known_spam=get_email_options($_SESSION['uid'],"del_known_spam",0); 
    174188$del_known_spam_value=get_email_options($_SESSION['uid'],"del_known_spam_value",'10.0'); 
     189$spam_fwd_active=get_email_options($_SESSION['uid'], "spam_fwd_active",0); 
     190$spam_fwd_mail=get_email_options($_SESSION['uid'], 'spam_fwd_mail', ''); 
     191$smarty->assign('spam_fwd_mail', $spam_fwd_mail); 
     192$smarty->assign('spam_fwd_active', $spam_fwd_active); 
    175193$smarty->assign('bogofilter_active', $bogofilter); 
    176194$smarty->assign('spamassassin_active', $spamassassin); 
  • trunk/sql_upgrades

    r196 r205  
    168168 
    169169ALTER TABLE `domains` ADD `p_mlists` TINYINT NOT NULL DEFAULT '0'; 
     170 
     171 
     172Version 0.09 to 0.10 
     173ALTER TABLE `domains` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0'; 
     174ALTER TABLE `users` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0'; 
  • trunk/system_scripts/sa_learn.pl

    r148 r205  
    107107                $bo_cmd = $find . " $path " . $find_opts . 
    108108                        " | " . $bogofilter . $bo_type; 
    109                 print $bo_cmd . "\n\n"; 
    110109                system($bo_cmd); 
    111110                system("chown -R ". $config{'vmail_user'} . " " . $config{'bogofilter_database'} ); 
  • trunk/templates/domain_view.tpl

    r196 r205  
    141141 <td></td> 
    142142 <td style="text-align:right;"> 
    143  {if $p_imap == 0  } 
     143 {if $domain.p_imap == 0  } 
    144144 <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=imap"> 
    145145 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate IMAP.{/t}" /></a> 
     
    153153 <td></td> 
    154154 <td style="text-align:right;"> 
    155  {if $p_pop3 == 0 } 
     155 {if $domain.p_pop3 == 0 } 
    156156  <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=pop3"> 
    157157 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate POP3.{/t}" /></a> 
     
    165165 <td></td> 
    166166 <td style="text-align:right;"> 
    167  {if $p_webmail ==  0 } 
     167 {if $domain.p_webmail ==  0 } 
    168168   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=webmail"> 
    169169 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate webmail.{/t}" /></a> 
     
    178178 <td></td> 
    179179 <td style="text-align:right;"> 
    180  {if $p_mlists ==  0 } 
     180 {if $domain.p_mlists ==  0 } 
    181181   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=mlists"> 
    182182 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate mailinglists.{/t}" /></a> 
     
    192192 <td></td> 
    193193 <td style="text-align:right;"> 
    194  {if $p_check_polw ==  0 } 
     194 {if $domain.p_check_polw ==  0 } 
    195195   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=check_polw"> 
    196196 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate policyd-weight.{/t}" /></a> 
     
    206206 <td></td> 
    207207 <td style="text-align:right;"> 
    208  {if $p_check_grey ==  0 } 
     208 {if $domain.p_check_grey ==  0 } 
    209209   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=check_grey"> 
    210210 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate greylisting.{/t}" /></a> 
     
    219219 <td></td> 
    220220 <td style="text-align:right;"> 
    221  {if $p_webinterface == 0  } 
     221 {if $domain.p_webinterface == 0  } 
    222222 <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=webinterface"> 
    223223 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate CpVES webinterface.{/t}" /></a> 
     
    231231 <td></td> 
    232232 <td style="text-align:right;"> 
    233  {if $p_autores_xheader == 0  } 
     233 {if $domain.p_autores_xheader == 0  } 
    234234 <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=autores_xheader"> 
    235235 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate vacation X-Header feature.{/t}" /></a> 
     
    243243 <td></td> 
    244244 <td style="text-align:right;"> 
    245  {if $p_fetchmail ==  0 } 
     245 {if $domain.p_fetchmail ==  0 } 
    246246   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=fetchmail"> 
    247247 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate fetchmail{/t}:" /></a> 
     
    255255 <td></td> 
    256256 <td style="text-align:right;"> 
    257  {if $p_spamassassin == 0 } 
     257 {if $domain.p_spamassassin == 0 } 
    258258   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=spamassassin"> 
    259259 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate spamassassin.{/t}" /></a> 
     
    267267 <td></td> 
    268268 <td style="text-align:right;"> 
    269  {if $p_sa_learn == 0 } 
     269 {if $domain.p_sa_learn == 0 } 
    270270   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=sa_learn"> 
    271271 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate ham/spam learning.{/t}" /></a> 
     
    280280 <td></td> 
    281281 <td style="text-align:right;"> 
    282  {if $p_spam_del == 0 } 
     282 {if $domain.p_spam_del == 0 } 
    283283   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=spam_del"> 
    284284 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate delete spam.{/t}" /></a> 
     
    290290 
    291291<tr> 
     292 <td>{t}foward spam to another address{/t}:</td> 
     293 <td></td> 
     294 <td style="text-align:right;"> 
     295 {if $domain.p_spam_fwd == 0 } 
     296   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=spam_fwd"> 
     297 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate forward spam.{/t}" /></a> 
     298 {else} 
     299   <a href="?module=domain_view&#038;did={$did}&#038;fstate=0&#038;f=spam_fwd"> 
     300 <img src="img/icons/button_ok.png" style="border:0px;" title="{t}deactivate forward spam.{/t}" /></a> 
     301 {/if}</td>  
     302</tr> 
     303 
     304<tr> 
    292305 <td>{t}bogofilter{/t}:</td> 
    293306 <td></td> 
    294307 <td style="text-align:right;"> 
    295  {if $p_bogofilter == 0 } 
     308 {if $domain.p_bogofilter == 0 } 
    296309   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=bogofilter"> 
    297310 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate bogofilter.{/t}" /></a> 
     
    306319 <td></td> 
    307320 <td style="text-align:right;"> 
    308  {if $p_mailarchive == 0 } 
     321 {if $domain.p_mailarchive == 0 } 
    309322   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=mailarchive"> 
    310323 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate archivemail.{/t}" /></a> 
     
    318331 <td></td> 
    319332 <td style="text-align:right;"> 
    320  {if $p_sa_wb_listing == 0 } 
     333 {if $domain.p_sa_wb_listing == 0 } 
    321334   <a href="?module=domain_view&#038;did={$did}&#038;fstate=1&#038;f=sa_wb_listing"> 
    322335 <img src="img/icons/button_cancel.png" style="border:0px;" title="{t}activate whitelisting.{/t}" /></a> 
     
    372385 <td colspan="4"> 
    373386 <form action="?module=domain_view&#038;did={$did}" method="post"> 
    374  <input name="dnote" maxlength="30" value="{$dnote}" type="text"/></form> 
     387 <input name="dnote" maxlength="30" value="{$domain.dnote}" type="text"/></form> 
    375388 </td> 
    376389</tr> 
    377390{/if} 
    378391 
    379 {if ($if_spamassassin == 1 || ( $if_superadmin == '1' && $p_spamassassin == 1)) && $p_sa_wb_listing == 1 } 
     392{if ($if_spamassassin == 1 || ( $if_superadmin == '1' && $domain.p_spamassassin == 1)) && $domain.p_sa_wb_listing == 1 } 
    380393<tr> 
    381394        <td colspan="4" class="domain_view"><h3>{t}spamfilter - whitelisting{/t}:</h3></td> 
  • trunk/templates/email_view.tpl

    r193 r205  
    156156{/if} 
    157157{if $if_spam_del == 1 } 
     158<tr> 
    158159        <td>{t}delete spam{/t}:</td> 
    159160        <td><select name="spam_del"> 
     
    165166        {/if} 
    166167        </select></td> 
     168</tr> 
     169{/if} 
     170{if $if_spam_fwd == 1 } 
     171<tr> 
     172        <td>{t}forward spam to another address{/t}:</td> 
     173        <td><select name="spam_fwd"> 
     174        <option value="enable">{t}yes{/t}</option> 
     175        {if $if_spam_fwd_value == 0} 
     176        <option value="disable" selected="selected">{t}no{/t}</option> 
     177        {else} 
     178        <option value="disable">{t}no{/t}</option> 
     179        {/if} 
     180        </select></td> 
     181</tr> 
    167182{/if} 
    168183{if $if_bogofilter == '1' } 
  • trunk/templates/index_admin.tpl

    r152 r205  
    11<table> 
    2   <tr> 
    3     <td>{t}domainname{/t}</td> 
    4     <td>{t}emailaddresses{/t}</td> 
    5     <td>{t}forwardings{/t}</td> 
    6  
    7   </tr> 
    8   {section name=row loop=$table_data} 
    9   <tr bgcolor="{cycle values="$color1,$color2"}"> 
    10    <td style="padding-left:3px;"> 
    11         <a href="?module=domain_view&#038;did={$table_data[row].id}">{$table_data[row].dnsname}</a></td> 
    12    <td style="text-align:right;">{$table_data[row].count_email}</td> 
    13    <td style="text-align:right;">{$table_data[row].count_forward}</td> 
    14   </tr> 
    15    
    16   {/section} 
     2<tr> 
     3        <td>{t}domainname{/t}</td> 
     4        <td>{t}emailaddresses{/t}</td> 
     5        <td>{t}forwardings{/t}</td> 
     6        {if $config.display_mb_size == 1 } 
     7        <td>{t}size{/t}</td> 
     8        {/if} 
     9</tr> 
     10{section name=row loop=$table_data} 
     11<tr bgcolor="{cycle values="$color1,$color2"}"> 
     12        <td style="padding-left:3px;"> 
     13        <a href="?module=domain_view&#038;did={$table_data[row].id}">{$table_data[row].dnsname}</a></td> 
     14        <td style="text-align:right;">{$table_data[row].count_email}</td> 
     15        <td style="text-align:right;">{$table_data[row].count_forward}</td> 
     16        {if $config.display_mb_size == 1 } 
     17        <td>{$row.mb_size} MB</td> 
     18        {/if} 
     19</tr> 
     20{/section} 
    1721</table> 
  • trunk/templates/index_sadmin.tpl

    r180 r205  
    44                <td>{t}emailaddresses{/t}</td> 
    55                <td>{t}fowardings{/t}</td> 
     6                {if $config.display_mb_size == 1 } 
     7                <td>{t}size{/t}</td> 
     8                {/if} 
    69                <td>{t}activate/deactivate{/t}</td> 
    710                <td>{t}delete{/t}</td> 
     
    2124                <td>{$row.count_email}</td> 
    2225                <td>{$row.count_forward}</td> 
     26                {if $config.display_mb_size == 1 } 
     27                <td>{$row.mb_size} MB</td> 
     28                {/if} 
    2329                <td> 
    2430                        {if $row.access == "1" } 
  • trunk/templates/user_spam.tpl

    r186 r205  
    7474                </td> 
    7575        <tr> 
     76        {if $p_spam_fwd == 1} 
     77        <tr> 
     78                <td valign="top">{t}forward known spam{/t}:</td> 
     79                <td>{if $spam_fwd_active == 0}<input type="radio" name="spam_fwd_active" value="0" checked="checked"/>{t}no{/t} <input type="radio" name="spam_fwd_active" value="1"/>{t}yes{/t}{else}<input type="radio" name="spam_fwd_active" value="0" />{t}no{/t} <input type="radio" name="spam_fwd_active" checked="checked" value="1"/>{t}yes{/t}{/if}<br/> 
     80                <input type="text" name="spam_fwd_mail" value="{$spam_fwd_mail}"/> 
     81                </td> 
     82        </tr> 
     83        {/if} 
    7684        {if $p_spam_del == 1} 
    7785        <tr>