diff -urN ../vmailadmin-2.0_RC5.orig/LocalSettings.php ./LocalSettings.php --- ../vmailadmin-2.0_RC5.orig/LocalSettings.php 2007-01-24 19:42:04.000000000 +0200 +++ ./LocalSettings.php 2011-06-06 20:18:03.000000000 +0300 @@ -144,8 +144,8 @@ * **/ $config['mailbox'] = array( - 'min' => 3, - 'max' => 25, + 'min' => 2, + 'max' => 48, ); /** diff -urN ../vmailadmin-2.0_RC5.orig/admin/alias/index.php ./admin/alias/index.php --- ../vmailadmin-2.0_RC5.orig/admin/alias/index.php 2007-01-03 11:15:22.000000000 +0200 +++ ./admin/alias/index.php 2007-06-05 19:15:12.000000000 +0300 @@ -97,8 +97,9 @@ $base = !$domain_start ? $base : sprintf("%s&domain_start=%d",$base,$domain_start); $base = !$user_start ? $base : sprintf("%s&user_start=%d",$base,$user_start); $idx = isset($_POST['idx']) ? $_POST['idx'] : NULL; - - if ( !$auth->verify(AUTH_ALIAS,$user->data,$this_domaininfo['domain_id']) ) + +// if ( !$auth->verify(AUTH_ALIAS,$user->data,$this_domaininfo['domain_id']) ) + if ( !$auth->verify(AUTH_ALIAS,$user->data,$this_domain_id) ) { report_error(GENERAL_ERROR,_('You do not have permissions to access this page')); } diff -urN ../vmailadmin-2.0_RC5.orig/admin/domains/domain_headless_alias_base.php ./admin/domains/domain_headless_alias_base.php --- ../vmailadmin-2.0_RC5.orig/admin/domains/domain_headless_alias_base.php 1970-01-01 03:00:00.000000000 +0300 +++ ./admin/domains/domain_headless_alias_base.php 2007-06-16 17:07:04.000000000 +0300 @@ -0,0 +1,233 @@ + tag +* +**/ +global $load_js; +$load_js = array(); +$load_js[] = $javascript->hiddenDivs(); +$load_js[] = $javascript->multiple_check_boxes('Domains','CheckAll'); +if ( isset($demo_mode) ) +{ + $load_js[] = $javascript->demo_mode(); +} + +page_header(); +$template->set_filenames(array( + 'domain_base' => 'admin/domain_base.html') +); + +/** +* +* Let make 2 checks. 1 for all domains and 1 for local domain +* Reason: if local domain exists, it is placed first and on all +* domain pages +* +**/ +$count = get_count(TRANSPORT_TABLE,"domain_id"); +$start = real_pagestart($count,$start); + +$template->assign_vars(array( + 'COLSPAN' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? 3 : 2, + 'FORM' => 'Domains', + 'START' => $start, + 'DEMO_MODE' => isset($demo_mode) ? ' onclick="javascript:demo_mode(); return false;"' : NULL, + + 'L_LEGEND' => _('Legend'), + 'L_DOMAINLIST' => _('Domain List'), + 'L_FUNCTIONS' => _('Functions'), + 'L_SUBMIT' => _('Submit'), + 'L_RESET' => _('Reset'), + + 'U_FORM' => append_sid($base)) +); + +if ( !($count == 0) ) +{ + $template->assign_block_vars('display_domains',array( + 'L_BUTTONICONLEGEND' => _('Show/Hide Legend'), + + 'COLSPAN' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? 2 : 3, + 'BUTTONROWHEIGHT' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? NULL : 'height="40"') + ); + + $sql = sprintf("SELECT * + FROM %s + WHERE destination = '%s'", + TRANSPORT_TABLE,LOCAL); + + if ( !($result = $db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 1323: '.sprintf(_('Unable to query: %s'),TRANSPORT_TABLE),$sql,__FILE__,__LINE__); + } + $LocalDomain = $db->sql_fetchrow($result); + + $page = floor( $start / $config['items_per_page'] ) + 1; + $pages = ceil( $count / $config['items_per_page'] ); + if ( $pages > 1 ) + { + if ( $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ) + { + $paginate_base = append_sid($base); + $template->assign_block_vars('display_domains.pagination',array( + 'PAGEOF' => sprintf(_('Page %s%d%s of %s%d%s'),'',$page,'','',$pages,''), + 'PAGES' => generate_pagination($paginate_base,$count,$config['items_per_page'],$start)) + ); + } + } + + $r = 0; + foreach ( admin_domain_list($start) as $domain_tmp ) + { + $template->assign_block_vars('display_domains.domain_loop',array( + 'ROWCOLOR' => !($r % 2) ? 'row1' : 'row2', + 'DOMAINID' => $domain_tmp['domain_id'], + 'DOMAIN' => $domain_tmp['domain'], + 'STATE_IMG' => $domain_tmp['active'] ? $user->style['domain_active'] : $user->style['domain_inactive'], + 'CLASS_IMG' => $domain_tmp['destination'] == LOCAL ? $user->style['local_domain'] : $user->style['virtual_domain'], + 'EDIT_IMG' => $user->style['modify'], + 'HALIAS_IMG' => $user->style['alias'], + 'SPAMASSASSIN_IMG' => (($domain_tmp['permit_user_sa_prefs'] == ENABLE) ? $user->style['user_sa_config'] : NULL), + + 'L_STATE_ALT' => $domain_tmp['active'] ? _('Domain active') : _('Domain inactive'), + 'L_CLASS_ALT' => $domain_tmp['destination'] == LOCAL ? _('Local Domain') : _('Virtual Domain'), + 'L_EDIT_ALT' => sprintf(_('Edit this domain: %s'),$domain_tmp['domain']), + 'L_HALIAS_ALT' => sprintf(_('Headless Aliases: %s'),$domain_tmp[TRANSPORT_DOMAIN]), + 'L_SPAMASSASSIN_ALT' => _('SpamAssassin Black/White Lists'), + + 'U_EDIT' => append_sid(sprintf('%s&mode=%d&this_domain_id=%d&start=%d',$base,MODIFY_DOMAIN,$domain_tmp['domain_id'],$start)), + 'U_HEADLESS' => append_sid(sprintf('%s&this_domain_id=%d&domain_start=%d',$nav_link['admin']['headless']['link'],$domain_tmp['domain_id'],$start)), + 'U_SPAMASSASSIN' => append_sid(sprintf('%s&global_domain=1&this_domain_id=%d&domain_start=%d',$nav_link['admin']['spam']['link'],$domain_tmp['domain_id'],$start))) + ); + //admin.php?p=admin/spamassassin&domain_id=%d + + if ( $domain_tmp['destination'] == MXBACKUP ) + { + $template->assign_block_vars('display_domains.domain_loop.mxinfo_img',array( + 'MXINFO_IMG' => $user->style['mx_backup'], + 'L_MXINFO_ALT' => _('MX Backup')) + ); + } + if ( fetch_domain_alias($domain_tmp['domain_id']) ) + { + $template->assign_block_vars('display_domains.domain_loop.alias_img',array( + 'ALIAS_IMG' => $user->style['domain_alias'], + 'L_ALIAS_ALT' => _('Domain Forwarded')) + ); + } + + if ( $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ) + { + if ( $domain_tmp['destination'] == VIRTUAL || ($user->data['user_level'] == ROOT && $domain_tmp['destination'] == LOCAL) ) + { + $template->assign_block_vars('display_domains.domain_loop.checkbox',array()); + } + else + { + $template->assign_block_vars('display_domains.domain_loop.locked',array( + 'IMG_LOCKED' => $user->style['locked'], + 'IMG_LOCKED_ALT' => _('Locked, WebAdmin Only')) + ); + } + } + + $r++; + } + + if ( $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ) + { + $HIDE_FORM = TRUE; + $template->assign_block_vars('display_domains.privleged',array( + 'L_BUTTONNEWDOMAIN' => _('New Domain'), + 'L_TOGGLEALL' => _('Toggle All'), + 'L_DELETEALLDOMAINS' => _('Delete All'), + 'L_DELETESELDOMAINS' => _('Delete Marked')) + ); + } + + $template->assign_block_vars('display_domains.icon_legend',array( + 'LEGENDTITLE' => _('Legend'), + 'LEGENDICON1' => $user->style['local_domain'], + 'LEGENDICON2' => $user->style['virtual_domain'], + 'LEGENDICON3' => $user->style['domain_alias'], + 'LEGENDICON4' => $user->style['mx_backup'], + 'LEGENDICON5' => $user->style['domain_active'], + 'LEGENDICON6' => $user->style['domain_inactive'], + 'LEGENDICON7' => $user->style['modify'], + 'LEGENDICON8' => $user->style['alias'], + 'LEGENDICON9' => $user->style['locked'], + 'LEGENDICON10' => $user->style['user_sa_config'], + + 'L_LEGENDICON1' => _('Local Domain'), + 'L_LEGENDICON2' => _('Virtual Domain'), + 'L_LEGENDICON3' => _('Domain Forwarded'), + 'L_LEGENDICON4' => _('MX Domain'), + 'L_LEGENDICON5' => _('Active Domain'), + 'L_LEGENDICON6' => _('Inactive Domain'), + 'L_LEGENDICON7' => _('Edit Domain'), + 'L_LEGENDICON8' => _('Headless Aliases'), + 'L_LEGENDICON9' => _('Locked, WebAdmin Only'), + 'L_LEGENDICON10' => _('SpamAssassin')) + ); +} + +if ( !($user->data['user_level'] == MANAGER) ) +{ + $template->assign_block_vars('new_domain',array( + 'DIVID' => isset($HIDE_FORM) ? 'hidden' : 'content', + 'ADDDOMAIN' => ADD_DOMAIN, + 'LOCAL' => LOCAL, + 'VIRTUAL' => VIRTUAL, + + 'L_DOMAINNAME' => _('New Domain Name'), + 'L_DOMAINFORM' => _('New Domain Form'), + 'L_LOCAL' => _('Local'), + 'L_VIRTUAL' => _('Virtual'), + + 'U_FORM' => append_sid($nav_link['admin']['domains']['link'])) + ); + + if ( !$LocalDomain ) + { + $template->assign_block_vars('new_domain.local',array()); + } + else + { + $template->assign_block_vars('new_domain.virtual',array()); + } +} + +$template->display('domain_base'); +$template->destroy(); +page_footer(); + +?> diff -urN ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/README.html ./admin/domains_headless_alias/README.html --- ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./admin/domains_headless_alias/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff -urN ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/domains_base.php ./admin/domains_headless_alias/domains_base.php --- ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/domains_base.php 1970-01-01 03:00:00.000000000 +0300 +++ ./admin/domains_headless_alias/domains_base.php 2007-06-16 17:06:17.000000000 +0300 @@ -0,0 +1,177 @@ + tag +* +**/ +global $load_js; +$load_js = array(); +$load_js[] = $javascript->hiddenDivs(); +$load_js[] = $javascript->multiple_check_boxes('Domains','CheckAll'); +if ( isset($demo_mode) ) +{ + $load_js[] = $javascript->demo_mode(); +} + +page_header(); +$template->set_filenames(array( + 'domain_base' => 'admin/domain_headless_alias_base.html') +); + +/** +* +* Let make 2 checks. 1 for all domains and 1 for local domain +* Reason: if local domain exists, it is placed first and on all +* domain pages +* +**/ +$count = get_count(TRANSPORT_TABLE,"domain_id"); +$start = real_pagestart($count,$start); + +$template->assign_vars(array( + 'COLSPAN' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? 3 : 2, + 'FORM' => 'Domains', + 'START' => $start, + 'DEMO_MODE' => isset($demo_mode) ? ' onclick="javascript:demo_mode(); return false;"' : NULL, + + 'L_LEGEND' => _('Legend'), + 'L_DOMAINLIST' => _('Domain List'), + 'L_FUNCTIONS' => _('Functions'), + 'L_SUBMIT' => _('Submit'), + 'L_RESET' => _('Reset'), + + 'U_FORM' => append_sid($base)) +); + +if ( !($count == 0) ) +{ + $template->assign_block_vars('display_domains',array( + 'L_BUTTONICONLEGEND' => _('Show/Hide Legend'), + + 'COLSPAN' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? 2 : 3, + 'BUTTONROWHEIGHT' => $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ? NULL : 'height="40"') + ); + + $sql = sprintf("SELECT * + FROM %s + WHERE destination = '%s'", + TRANSPORT_TABLE,LOCAL); + + if ( !($result = $db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 1323: '.sprintf(_('Unable to query: %s'),TRANSPORT_TABLE),$sql,__FILE__,__LINE__); + } + $LocalDomain = $db->sql_fetchrow($result); + + $page = floor( $start / $config['items_per_page'] ) + 1; + $pages = ceil( $count / $config['items_per_page'] ); + if ( $pages > 1 ) + { + if ( $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ) + { + $paginate_base = append_sid($base); + $template->assign_block_vars('display_domains.pagination',array( + 'PAGEOF' => sprintf(_('Page %s%d%s of %s%d%s'),'',$page,'','',$pages,''), + 'PAGES' => generate_pagination($paginate_base,$count,$config['items_per_page'],$start)) + ); + } + } + + $r = 0; + foreach ( admin_domain_list($start) as $domain_tmp ) + { + $template->assign_block_vars('display_domains.domain_loop',array( + 'ROWCOLOR' => !($r % 2) ? 'row1' : 'row2', + 'DOMAINID' => $domain_tmp['domain_id'], + 'DOMAIN' => $domain_tmp['domain'], + 'STATE_IMG' => $domain_tmp['active'] ? $user->style['domain_active'] : $user->style['domain_inactive'], + 'CLASS_IMG' => $domain_tmp['destination'] == LOCAL ? $user->style['local_domain'] : $user->style['virtual_domain'], + 'HALIAS_IMG' => $user->style['alias'], + + 'L_STATE_ALT' => $domain_tmp['active'] ? _('Domain active') : _('Domain inactive'), + 'L_CLASS_ALT' => $domain_tmp['destination'] == LOCAL ? _('Local Domain') : _('Virtual Domain'), + 'L_HALIAS_ALT' => sprintf(_('Headless Aliases: %s'),$domain_tmp[TRANSPORT_DOMAIN]), + + 'U_HEADLESS' => append_sid(sprintf('%s&this_domain_id=%d&domain_start=%d',$nav_link['admin']['headless']['link'],$domain_tmp['domain_id'],$start)) + ) + ); + //admin.php?p=admin/spamassassin&domain_id=%d + + if ( $domain_tmp['destination'] == MXBACKUP ) + { + $template->assign_block_vars('display_domains.domain_loop.mxinfo_img',array( + 'MXINFO_IMG' => $user->style['mx_backup'], + 'L_MXINFO_ALT' => _('MX Backup')) + ); + } + if ( fetch_domain_alias($domain_tmp['domain_id']) ) + { + $template->assign_block_vars('display_domains.domain_loop.alias_img',array( + 'ALIAS_IMG' => $user->style['domain_alias'], + 'L_ALIAS_ALT' => _('Domain Forwarded')) + ); + } + + + $r++; + } + + $template->assign_block_vars('display_domains.icon_legend',array( + 'LEGENDTITLE' => _('Legend'), + 'LEGENDICON1' => $user->style['local_domain'], + 'LEGENDICON2' => $user->style['virtual_domain'], + 'LEGENDICON3' => $user->style['domain_alias'], + 'LEGENDICON4' => $user->style['mx_backup'], + 'LEGENDICON5' => $user->style['domain_active'], + 'LEGENDICON6' => $user->style['domain_inactive'], + 'LEGENDICON7' => $user->style['modify'], + 'LEGENDICON8' => $user->style['alias'], + 'LEGENDICON9' => $user->style['locked'], + 'LEGENDICON10' => $user->style['user_sa_config'], + + 'L_LEGENDICON1' => _('Local Domain'), + 'L_LEGENDICON2' => _('Virtual Domain'), + 'L_LEGENDICON3' => _('Domain Forwarded'), + 'L_LEGENDICON4' => _('MX Domain'), + 'L_LEGENDICON5' => _('Active Domain'), + 'L_LEGENDICON6' => _('Inactive Domain'), + 'L_LEGENDICON7' => _('Edit Domain'), + 'L_LEGENDICON8' => _('Headless Aliases'), + 'L_LEGENDICON9' => _('Locked, WebAdmin Only'), + 'L_LEGENDICON10' => _('SpamAssassin')) + ); +} + +$template->display('domain_base'); +$template->destroy(); +page_footer(); + +?> diff -urN ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/index.php ./admin/domains_headless_alias/index.php --- ../vmailadmin-2.0_RC5.orig/admin/domains_headless_alias/index.php 1970-01-01 03:00:00.000000000 +0300 +++ ./admin/domains_headless_alias/index.php 2007-06-16 17:06:05.000000000 +0300 @@ -0,0 +1,174 @@ + 'mode', + 'this_domain_id' => 'this_domain_id', + 'deleteall' => 'deleteall', + 'deletesel' => 'deletesel', + 'deletesin' => 'deletesin', + 'delete_folders' => 'delete_folders', + 'confirm_delete' => 'confirm_delete', + 'cancel_request' => 'cancel', + 'this_domain_state' => 'this_domain_state', + 'this_mx_backup_state' => 'this_mx_backup_state', + 'this_domain_alias_state' => 'this_domain_alias_state', + 'this_limit_mailbox' => 'this_limit_mailbox', + 'this_limit_alias' => 'this_limit_alias', + 'this_permit_user_add_alias' => 'this_permit_user_add_alias', + 'this_permit_user_sa_prefs' => 'this_permit_user_sa_prefs', + 'this_permit_virus_filter' => 'this_permit_virus_filter', + 'this_permit_mail_forwarding' => 'this_permit_mail_forwarding', + 'this_permit_mail_filtering' => 'this_permit_mail_filtering', + 'this_permit_auto_response' => 'this_permit_auto_response', + 'this_require_alias_activation' => 'this_require_alias_activation', + 'start' => 'start', + 'new_domain' => 'new_domain', + 'this_destination' => 'destination', + 'this_comments' => 'this_comments', + 'this_mx_backup_destination' => 'this_mx_backup_destination', + 'prev_mx_backup_destination' => 'prev_mx_backup_destination', + 'this_domain_alias_destination' => 'this_domain_alias_destination', + 'prev_domain_alias_destination' => 'prev_domain_alias_destination', + 'this_limit_quota' => 'this_limit_quota' +); + +while( list($var,$param) = @each($_validate) ) +{ + if ( !empty($_POST[$param]) || !empty($_GET[$param]) ) + { + $$var = !empty($_POST[$param]) ? $_POST[$param] : $_GET[$param]; + $$var = is_integer($$var) ? (int)$$var : htmlspecialchars($$var); + } + else + { + unset($$var); + } +} + +require_once (sprintf('%s/includes/functions/domain_tools.%s',$root,$ext)); +require_once (sprintf('%s/includes/functions/admin_tools.%s',$root,$ext)); +require_once (sprintf('%s/includes/functions/page_tools.%s',$root,$ext)); + +/** +* +* Initialize class objects +* +**/ +$mailbox = new mailbox_backend(_MBOX_); +$backend = new system_backend(_SYS_); +$spam = new spam_backend(_SPAM_); +$javascript = new javascript(); +$auth = new auth(); + +if ( isset($_POST) || isset($_GET) ) +{ + + $base = $nav_link['admin']['domains_headless_alias']['link']; + $idx = isset($_POST['idx']) ? $_POST['idx'] : NULL; + $start = !empty($start) ? $start : 0; + + /** + * + * Let's pull up domaindata for this domain + * -> $this_domaininfo + * + **/ + $this_domaininfo = get_domain_data($this_domain_id); + + /** + * + * First we check to see if domain is aliased to another domain... + * If not, pull up other values... While values are not output to + * screen, data is not deleted if data is present prior to aliasing + * domain. It is put into hibernation... + * + **/ + if ( !empty($this_domaininfo) ) + { + /** + * + * Make sure user has proper rights for proper domain + * + **/ + if ( !$auth->verify(AUTH_DOMAINS,$user->data,$this_domaininfo['domain_id']) ) + { + report_error(GENERAL_ERROR,_('You do not have permissions to access this page')); + } + + /** + * + * Set up some domain constants + * + **/ + if ( $this_domaininfo['destination'] == LOCAL ) + { + $DomainIsLocal = TRUE; + } + if ( (($domain_alias = fetch_domain_alias($this_domaininfo['domain_id'])) && $mode == MODIFY_DOMAIN) || $this_domain_alias_state ) + { + $DomainIsAliased = TRUE; + } + if ( ($this_domaininfo['destination'] == MXBACKUP && $mode == MODIFY_DOMAIN) || $this_mx_backup_state ) + { + $DomainIsMX = TRUE; + } + if ( verify_postmaster($this_domaininfo) ) + { + $DomainPostmaster = TRUE; + } + } + + if ( isset($cancel_request) ) + { + unset($mode); + } + + include(sprintf('%s/admin/domains_headless_alias/domains_base.%s',$root,$ext)); +} +else +{ + redirect(append_sid(sprintf('admin.%s',$ext)),TRUE); +} + +?> diff -urN ../vmailadmin-2.0_RC5.orig/admin/headless_alias/index.php ./admin/headless_alias/index.php --- ../vmailadmin-2.0_RC5.orig/admin/headless_alias/index.php 2007-01-06 21:11:04.000000000 +0200 +++ ./admin/headless_alias/index.php 2011-06-06 17:57:30.000000000 +0300 @@ -34,6 +34,7 @@ * Check and set parameters * **/ + $_validate = array( 'mode' => 'mode', 'this_domain_id' => 'this_domain_id', @@ -110,9 +111,14 @@ { $delete_mode = DELETE_SEL; } - else if ( isset($deleteall) || ($umode == UPDATE_RECIP && empty($idx)) ) + elseif ( isset($deleteall) ) { $delete_mode = DELETE_ALL; + } + elseif ($umode == UPDATE_RECIP && empty($idx)) + { + $delete_mode = DELETE_SEL; + $idx = array($this_alias_id); } else { diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/index.php ./admin/users/index.php --- ../vmailadmin-2.0_RC5.orig/admin/users/index.php 2006-12-15 21:47:21.000000000 +0200 +++ ./admin/users/index.php 2007-06-05 19:15:39.000000000 +0300 @@ -62,8 +62,10 @@ 'name' => 'name', 'quota' => 'quota', 'forwarding' => 'forwarding', + 'forwarding_save' => 'forwarding_save', 'destination' => 'destination', 'prev_destination' => 'prev_destination', + 'hidden_destination' => 'hidden_destination', 'username' => 'username' ); diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/users_add.php ./admin/users/users_add.php --- ../vmailadmin-2.0_RC5.orig/admin/users/users_add.php 2006-11-18 22:21:35.000000000 +0200 +++ ./admin/users/users_add.php 2007-01-28 17:54:14.000000000 +0200 @@ -116,10 +116,14 @@ 'INPUTSTATE' => !$user->data['forwarding'] ? 'disabled="disabled"' : NULL, 'FORWARDYES' => $user->data['forwarding'] ? 'checked="checked"' : NULL, 'FORWARDNO' => !$user->data['forwarding'] ? 'checked="checked"' : NULL, + 'FORWARDSAVEYES' => $user->data['forward_save'] ? 'checked="checked"' : NULL, + 'FORWARDSAVENO' => !$user->data['forward_save'] ? 'checked="checked"' : NULL, 'ADDRESS' => $forwarding['destination'], 'L_FORWARD' => _('Enable Mail Forwarding'), 'L_FORWARDEXPLAIN' => _('To enable mail forwarding, you must also provide the address to forward to below.'), + 'L_FORWARDSAVE' => _('Save Forwarded Message'), + 'L_FORWARDSAVEEXPLAIN' => _('Retain a local copy of forwarded mail.'), 'L_ADDRESS' => _('Forwarding Address'), 'L_ADDRESSEXPLAIN' => _('Forwarding address must be in the format of user@domain.tld')) ); diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/users_add_db.php ./admin/users/users_add_db.php --- ../vmailadmin-2.0_RC5.orig/admin/users/users_add_db.php 2007-01-07 22:45:21.000000000 +0200 +++ ./admin/users/users_add_db.php 2007-08-24 16:31:04.000000000 +0300 @@ -134,16 +134,20 @@ $active = $this_domaindata['active'] ? ENABLE : DISABLE; +$forward_state = $forwarding ? ENABLE : DISABLE; +$forward_save_state = $forwarding_save ? ENABLE : DISABLE; +if (!$forward_destination ) $forward_destination = $hidden_destination; + /** * * Insert new user into database * **/ $sql = sprintf("INSERT INTO %1\$s - (precedence, domain_id, %2\$s, %3\$s, name, %4\$s, %5\$s, %6\$s, %7\$s, ftpdir, %8\$s, %9\$s, user_class, user_level, user_lang, active, created, modified, items_per_page, forwarding, style_id) + (precedence, domain_id, %2\$s, %3\$s, name, %4\$s, %5\$s, %6\$s, %7\$s, ftpdir, %8\$s, %9\$s, user_class, user_level, user_lang, active, created, modified, items_per_page, forwarding, forward_save, forward_dest, style_id) VALUES - ('%10\$d', '%11\$d', '%12\$s', '%13\$s', '%14\$s', '%15\$d', '%16\$d', '%17\$s', '%18\$s', '%19\$s', '%20\$s', 'y', '%21\$d', '%22\$d', '','%23\$d', '%24\$d', '%24\$d', '%25\$d', '%26\$d', '%27\$d')", - USERS_TABLE,USERS_USER,USERS_PASSWORD,USERS_UID,USERS_GID,USERS_HOMEDIR,USERS_MAILDIR,USERS_QUOTA,USERS_POSTFIX,($this_user_catch_all ? 1 : 0),$this_domain_id,$address,$crypt_password,$name,$uid,$gid,$homedir,$maildir,$ftpdir,$quota,$user_class,$user_level,$active,$config['current_time'],$config['items_per_page'],$forwarding,$config['style_id']); + ('%10\$d', '%11\$d', '%12\$s', '%13\$s', '%14\$s', '%15\$d', '%16\$d', '%17\$s', '%18\$s', '%19\$s', '%20\$s', 'y', '%21\$d', '%22\$d', '','%23\$d', '%24\$d', '%24\$d', '%25\$d', '%26\$d', '%27\$d', '%28\$s', '%29\$d')", + USERS_TABLE,USERS_USER,USERS_PASSWORD,USERS_UID,USERS_GID,USERS_HOMEDIR,USERS_MAILDIR,USERS_QUOTA,USERS_POSTFIX,($this_user_catch_all ? 1 : 0),$this_domain_id,$address,$crypt_password,$name,$uid,$gid,$homedir,$maildir,$ftpdir,$quota,$user_class,$user_level,$active,$config['current_time'],$config['items_per_page'],$forward_state,$forward_save_state,$forward_destination,$config['style_id']); if ( !($db->sql_query($sql)) ) { @@ -167,6 +171,19 @@ **/ if ( $create_mail_directory ) { +// $mbox = @imap_open("{localhost:143/notls}", $username, $password); + $mbox = @imap_open("{localhost:143/notls}", $address, $password); + if ($mbox) { + $folders = explode('|',$config['default_spam_virus_folder']); + if ($folders) for ($i = 0; $i < count($folders); $i++) imap_createmailbox($mbox, "{localhost:143/notls}".$folders[$i]); + $folders = explode(',',$config['default_folders']); + if ($folders) for ($i = 0; $i < count($folders); $i++) imap_createmailbox($mbox, "{localhost:143/notls}".$folders[$i]); + @imap_close($mbox); + } +} + +if ( 0 ) +{ if ( $mailbox->ratify_user(PL_MAKEHOMEDIR,$this_userdata,$this_domaindata) ) { $special_folders = explode('|',$config['default_spam_virus_folder']); @@ -250,14 +267,13 @@ **/ if ( $this_domaindata['permit_mail_forwarding'] || $user->data['user_level'] == ADMIN ) { - $forward_state = $forwarding ? ENABLE : DISABLE; if ( $forward_state == ENABLE && ($destination{0} == "." || !check_email($destination)) ) { list($falias,$fdomain) = split("@",$destination); $_FORWARD_ERR = sprintf("
The email address you want to forward to appears to be invalid. Check that it is in the format of user@domain.tld. It is also likely that no MX record exists for %s.",$fdomain); } - ratify_user_mail_forwarding($this_userdata,$forwarding,$destination,$forward_state); + ratify_user_mail_forwarding($this_userdata,$forward_state,$destination,$forward_save_state); } /** diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/users_details.php ./admin/users/users_details.php --- ../vmailadmin-2.0_RC5.orig/admin/users/users_details.php 2006-12-06 21:34:14.000000000 +0200 +++ ./admin/users/users_details.php 2007-06-10 23:13:16.000000000 +0300 @@ -153,13 +153,16 @@ if ( $this_domaindata['permit_mail_forwarding'] || $user->data['user_level'] == ROOT || $user->data['user_level'] == ADMIN ) { + $forwarding['destination'] = ''; +print("\n"); if ( $this_userdata['forwarding'] == ENABLE ) { $sql = sprintf("SELECT %s FROM %s WHERE user_id = '%d' - AND class_type = '%d'", - ALIAS_DESTINATION,ALIAS_TABLE,$this_user_id,FORWARD_EMAIL); + AND class_type = '%d' + AND %s != '%s'", + ALIAS_DESTINATION,ALIAS_TABLE,$this_user_id,FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); if ( !($result = $db->sql_query($sql)) ) { @@ -167,14 +170,19 @@ } $row = $db->sql_fetchrow($result); $destination = $row['destination']; + $forwarding['destination'] = $row['destination']; } - $forwarding['destination'] = $row['destination']; - if ( empty($row['destination']) ) + if ( empty($forwarding['destination']) ) { + $forwarding['destination'] = $this_userdata['forward_dest']; + } + if ( empty($forwarding['destination']) ) + { $forwarding['destination'] = "... email@domain.tld ..."; } - else + + if ( !empty($forwarding['destination']) ) { $forwarding['onclick'] = 'changeFieldType(this.value,this.name)'; } @@ -184,9 +192,13 @@ 'L_FORWARDEXPLAIN' => _('To enable mail forwarding, you must also provide the address to forward to below.'), 'L_ADDRESS' => _('Forwarding Address'), 'L_ADDRESSEXPLAIN' => _('Forwarding address must be in the format of user@domain.tld'), + 'L_FORWARDSAVE' => _('Save Forwarded Message'), + 'L_FORWARDSAVEEXPLAIN' => _('Retain a local copy of forwarded mail.'), 'INPUTSTATE' => $this_userdata['forwarding'] == DISABLE ? 'disabled="disabled"' : NULL, 'FORWARDYES' => $this_userdata['forwarding'] == ENABLE ? 'checked="checked"' : NULL, 'FORWARDNO' => $this_userdata['forwarding'] == DISABLE ? 'checked="checked"' : NULL, + 'FORWARDSAVEYES' => $this_userdata['forward_save'] ? 'checked="checked"' : NULL, + 'FORWARDSAVENO' => !$this_userdata['forward_save'] ? 'checked="checked"' : NULL, 'ADDRESS' => $forwarding['destination']) ); } diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/users_modifylist.php ./admin/users/users_modifylist.php --- ../vmailadmin-2.0_RC5.orig/admin/users/users_modifylist.php 2007-01-04 06:23:31.000000000 +0200 +++ ./admin/users/users_modifylist.php 2007-06-10 23:02:53.000000000 +0300 @@ -110,6 +110,7 @@ $user_ary[$i]['user_id'] = $row['user_id']; $user_ary[$i]['catch_all'] = $row['precedence']; $user_ary[$i][USERS_USER] = $row[USERS_USER]; + $user_ary[$i]['name'] = $row['name']; $user_ary[$i]['active'] = $row['active']; $user_ary[$i]['user_level'] = $row['user_level']; $user_ary[$i]['user_class'] = $row['user_class']; @@ -123,6 +124,7 @@ $template->assign_block_vars('display_users.user_loop',array( 'ROWCOLOR' => !($r % 2) ? 'row1' : 'row2', 'USERID' => $user_tmp['user_id'], + 'NAME' => $user_tmp['name'], 'MAILBOX' => prep_address_for_output($user_tmp[USERS_USER],$this_domaindata[TRANSPORT_DOMAIN]), 'MAILDIR_IMG' => $user->style['maildir_missing'], 'STATEFUL_IMG' => $user_tmp['active'] == ENABLE ? $user->style['user_active'] : $user->style['user_inactive'], diff -urN ../vmailadmin-2.0_RC5.orig/admin/users/users_update.php ./admin/users/users_update.php --- ../vmailadmin-2.0_RC5.orig/admin/users/users_update.php 2006-12-15 21:47:44.000000000 +0200 +++ ./admin/users/users_update.php 2007-06-10 21:41:35.000000000 +0300 @@ -84,7 +84,8 @@ * **/ $forward_state = $forwarding ? ENABLE : DISABLE; - +$forward_save_state = $forwarding_save ? ENABLE : DISABLE; + if ( $forward_state == ENABLE ) { if ( $destination{0} == "." || !check_email($destination) ) @@ -96,8 +97,9 @@ if ( !($forward_state == $this_userdata['forwarding']) || !($destination == $prev_destination) ) { - ratify_user_mail_forwarding($this_userdata,$forward_state,$destination,$forward_state); + ratify_user_mail_forwarding($this_userdata,$forward_state,$destination,$forward_save_state); } +if (!$forward_destination ) $forward_destination = ($forward_state == ENABLE ? $destination : $hidden_destination); /** * @@ -132,9 +134,10 @@ } $sql = sprintf("UPDATE %s - SET precedence = '%d', %s name = '%s', %s user_level = '%d', active = '%d', modified = '%d', forwarding = '%d' + SET precedence = '%d', %s name = '%s', %s user_level = '%d', active = '%d', modified = '%d', forwarding = '%d', forward_save = '%d', forward_dest = '%s' WHERE user_id = '%d'", - USERS_TABLE,$precedence,$update_password,$name,$sql_quota_id,$user_level,$user_active,$config['current_time'],$forward_state,$this_user_id); + USERS_TABLE,$precedence,$update_password,$name,$sql_quota_id,$user_level,$user_active,$config['current_time'],$forward_state,$forward_save_state,$forward_destination,$this_user_id); +print(""); if ( !($result = $db->sql_query($sql)) ) { diff -urN ../vmailadmin-2.0_RC5.orig/admin.php ./admin.php --- ../vmailadmin-2.0_RC5.orig/admin.php 2007-01-25 19:26:03.000000000 +0200 +++ ./admin.php 2007-01-26 11:12:48.000000000 +0200 @@ -66,6 +66,10 @@ include($nav_link['admin']['domains']['file']); break; + case $nav_link['admin']['domains_headless_alias']['name']: + include($nav_link['admin']['domains_headless_alias']['file']); + break; + case $nav_link['admin']['headless']['name']: include($nav_link['admin']['headless']['file']); break; diff -urN ../vmailadmin-2.0_RC5.orig/docs/sql/UPGRADE/2.0_RC5.corvax.a_to_2.0_RC5.corvax.b.sql ./docs/sql/UPGRADE/2.0_RC5.corvax.a_to_2.0_RC5.corvax.b.sql --- ../vmailadmin-2.0_RC5.orig/docs/sql/UPGRADE/2.0_RC5.corvax.a_to_2.0_RC5.corvax.b.sql 1970-01-01 03:00:00.000000000 +0300 +++ ./docs/sql/UPGRADE/2.0_RC5.corvax.a_to_2.0_RC5.corvax.b.sql 2007-01-28 15:17:03.000000000 +0200 @@ -0,0 +1,5 @@ +ALTER TABLE `mailbox` + DROP INDEX `mailbox_idx1`, + ADD `forward_dest` VARCHAR( 100 ) NOT NULL AFTER `forwarding`, + ADD `forward_save` INT( 1 ) NOT NULL AFTER `forward_dest` +; diff -urN ../vmailadmin-2.0_RC5.orig/i18n/es_ES/LC_MESSAGES/README.html ./i18n/es_ES/LC_MESSAGES/README.html --- ../vmailadmin-2.0_RC5.orig/i18n/es_ES/LC_MESSAGES/README.html 2017-05-28 22:37:51.000000000 +0300 +++ ./i18n/es_ES/LC_MESSAGES/README.html 1970-01-01 03:00:00.000000000 +0300 @@ -1,36 +0,0 @@ - - - - - - - - - - - - - Binary files ../vmailadmin-2.0_RC5.orig/i18n/es_ES/LC_MESSAGES/vmailadmin.mo and ./i18n/es_ES/LC_MESSAGES/vmailadmin.mo differ diff -urN ../vmailadmin-2.0_RC5.orig/i18n/es_ES/README.html ./i18n/es_ES/README.html --- ../vmailadmin-2.0_RC5.orig/i18n/es_ES/README.html 2017-05-28 22:37:51.000000000 +0300 +++ ./i18n/es_ES/README.html 1970-01-01 03:00:00.000000000 +0300 @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff -urN ../vmailadmin-2.0_RC5.orig/i18n-devel/README.html ./i18n-devel/README.html --- ../vmailadmin-2.0_RC5.orig/i18n-devel/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./i18n-devel/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff -urN ../vmailadmin-2.0_RC5.orig/i18n-devel/es_ES/LC_MESSAGES/README.html ./i18n-devel/es_ES/LC_MESSAGES/README.html --- ../vmailadmin-2.0_RC5.orig/i18n-devel/es_ES/LC_MESSAGES/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./i18n-devel/es_ES/LC_MESSAGES/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + Binary files ../vmailadmin-2.0_RC5.orig/i18n-devel/es_ES/LC_MESSAGES/vmailadmin.mo and ./i18n-devel/es_ES/LC_MESSAGES/vmailadmin.mo differ diff -urN ../vmailadmin-2.0_RC5.orig/i18n-devel/es_ES/README.html ./i18n-devel/es_ES/README.html --- ../vmailadmin-2.0_RC5.orig/i18n-devel/es_ES/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./i18n-devel/es_ES/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff -urN ../vmailadmin-2.0_RC5.orig/i18n-devel/ru_RU/LC_MESSAGES/README.html ./i18n-devel/ru_RU/LC_MESSAGES/README.html --- ../vmailadmin-2.0_RC5.orig/i18n-devel/ru_RU/LC_MESSAGES/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./i18n-devel/ru_RU/LC_MESSAGES/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + Binary files ../vmailadmin-2.0_RC5.orig/i18n-devel/ru_RU/LC_MESSAGES/vmailadmin.mo and ./i18n-devel/ru_RU/LC_MESSAGES/vmailadmin.mo differ diff -urN ../vmailadmin-2.0_RC5.orig/i18n-devel/ru_RU/README.html ./i18n-devel/ru_RU/README.html --- ../vmailadmin-2.0_RC5.orig/i18n-devel/ru_RU/README.html 1970-01-01 03:00:00.000000000 +0300 +++ ./i18n-devel/ru_RU/README.html 2017-05-28 22:37:51.000000000 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff -urN ../vmailadmin-2.0_RC5.orig/includes/class/javascript.php ./includes/class/javascript.php --- ../vmailadmin-2.0_RC5.orig/includes/class/javascript.php 2006-11-18 06:40:57.000000000 +0200 +++ ./includes/class/javascript.php 2007-06-10 20:00:13.000000000 +0300 @@ -81,7 +81,8 @@ case 'users_add': case 'user_submit': $toggle_field = array( - 'forwarding' => array('destination') +// 'forwarding' => array('destination') + 'forwarding' => array('destination', 'forwarding_save') ); break; diff -urN ../vmailadmin-2.0_RC5.orig/includes/class/versioning.php ./includes/class/versioning.php --- ../vmailadmin-2.0_RC5.orig/includes/class/versioning.php 2007-01-03 09:00:12.000000000 +0200 +++ ./includes/class/versioning.php 2007-08-01 15:22:34.000000000 +0300 @@ -62,6 +62,7 @@ global $_SERVER; $this->ENVPATH_array = ini_get('safe_mode') ? explode(":",ini_get('safe_mode_exec_dir')) : explode(":",$_SERVER['PATH']); +$this->ENVPATH_array[] = '/usr/local/bin'; $this->binary_array = array( CLAMSCAN => array('clamd'), CLAMASSASSIN => array('clamassassin'), diff -urN ../vmailadmin-2.0_RC5.orig/includes/common.php ./includes/common.php --- ../vmailadmin-2.0_RC5.orig/includes/common.php 2007-01-07 21:04:25.000000000 +0200 +++ ./includes/common.php 2021-08-25 21:25:14.975944000 +0300 @@ -76,6 +76,15 @@ } $db->sql_freeresult($result); +if (!empty($_SERVER['HTTP_HOST']) || !empty($_ENV['HTTP_HOST'])) +{ + $config['server_url'] = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; +} +else if (!empty($_SERVER['SERVER_NAME']) || !empty($_ENV['SERVER_NAME'])) +{ + $config['server_url'] = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $_ENV['SERVER_NAME']; +} + /** * * Include LocalSettings.php diff -urN ../vmailadmin-2.0_RC5.orig/includes/dbi/mysql.php ./includes/dbi/mysql.php --- ../vmailadmin-2.0_RC5.orig/includes/dbi/mysql.php 2006-11-18 06:42:49.000000000 +0200 +++ ./includes/dbi/mysql.php 2013-01-10 21:42:09.000000000 +0200 @@ -62,6 +62,8 @@ mysql_close($this->db_connect_id); $this->db_connect_id = $dbselect; } + + mysql_query("SET NAMES utf8;"); } } diff -urN ../vmailadmin-2.0_RC5.orig/includes/functions/domain_tools.php ./includes/functions/domain_tools.php --- ../vmailadmin-2.0_RC5.orig/includes/functions/domain_tools.php 2006-11-18 06:33:32.000000000 +0200 +++ ./includes/functions/domain_tools.php 2007-08-24 16:12:26.000000000 +0300 @@ -59,7 +59,7 @@ { return ( FALSE ); } - if ( !mx_check($this_domain,1) ) + if ( ( !mx_check($this_domain,1) ) and ( !mx_check($this_domain,-1) ) ) { return ( FALSE ); } diff -urN ../vmailadmin-2.0_RC5.orig/includes/functions/global_tools.php ./includes/functions/global_tools.php --- ../vmailadmin-2.0_RC5.orig/includes/functions/global_tools.php 2007-01-06 21:28:29.000000000 +0200 +++ ./includes/functions/global_tools.php 2007-01-26 11:12:36.000000000 +0200 @@ -239,6 +239,11 @@ 'link' => sprintf('admin.%s?p=admin/domains',$ext), 'file' => sprintf('%s/admin/domains/index.%s',$root,$ext)), + 'domains_headless_alias' => array( + 'name' => 'admin/domains_headless_alias', + 'link' => sprintf('admin.%s?p=admin/domains_headless_alias',$ext), + 'file' => sprintf('%s/admin/domains_headless_alias/index.%s',$root,$ext)), + 'headless' => array( 'name' => 'admin/domains/aliases/headless', 'link' => sprintf('admin.%s?p=admin/domains/aliases/headless',$ext), diff -urN ../vmailadmin-2.0_RC5.orig/includes/functions/mail_forwarding.php ./includes/functions/mail_forwarding.php --- ../vmailadmin-2.0_RC5.orig/includes/functions/mail_forwarding.php 2006-12-15 21:48:05.000000000 +0200 +++ ./includes/functions/mail_forwarding.php 2007-06-10 21:30:57.000000000 +0300 @@ -47,7 +47,7 @@ * @return Select list for folders * **/ -function ratify_user_mail_forwarding($this_userinfo,$this_forward_state,$this_destination=NULL) +function ratify_user_mail_forwarding($this_userinfo,$this_forward_state,$this_destination=NULL,$this_forward_save_state) { global $config,$db; global $mailbox; @@ -107,23 +107,25 @@ $sql = sprintf("SELECT %s FROM %s WHERE user_id = '%d' - AND class_type = '%d'", - ALIAS_DESTINATION,ALIAS_TABLE,$this_userinfo['user_id'],FORWARD_EMAIL); + AND class_type = '%d' + AND %s != '%s'", + ALIAS_DESTINATION,ALIAS_TABLE,$this_userinfo['user_id'],FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); if ( !($result = $db->sql_query($sql)) ) { - report_error(CRITICAL_MESSAGE,'Error 16002: '.sprintf(_('Unable to update: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); + report_error(CRITICAL_MESSAGE,'Error 16002: '.sprintf(_('Unable to select: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); } $row = $db->sql_fetchrow($result); $destination = $row['destination']; - if ( !($this_destination == $destination) && !empty($destination) ) + if ( !empty($destination) ) { $sql = sprintf("UPDATE %s SET %s = '%s', modified = '%d' WHERE user_id = '%d' - AND class_type = '%s'", - ALIAS_TABLE,ALIAS_DESTINATION,$this_destination,$config['current_time'],$this_userinfo['user_id'],FORWARD_EMAIL); + AND class_type = '%s' + AND %s != '%s'", + ALIAS_TABLE,ALIAS_DESTINATION,$this_destination,$config['current_time'],$this_userinfo['user_id'],FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); if ( !($db->sql_query($sql)) ) { @@ -146,6 +148,68 @@ } watchdog($sql); } + + if ($this_forward_save_state) { + + $sql = sprintf("SELECT %s + FROM %s + WHERE user_id = '%d' + AND class_type = '%d' + AND %s = '%s'", + ALIAS_DESTINATION,ALIAS_TABLE,$this_userinfo['user_id'],FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); + + if ( !($result = $db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 16002: '.sprintf(_('Unable to select: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); + } + $row = $db->sql_fetchrow($result); + + if ( $row ) + { + $sql = sprintf("UPDATE %s + SET active = 1, modified = '%d' + WHERE user_id = '%d' + AND class_type = '%s' + AND %s = '%s'", + ALIAS_TABLE,$config['current_time'],$this_userinfo['user_id'],FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); + + if ( !($db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 16003: '.sprintf(_('Unable to update: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); + } + watchdog($sql); + + } + else + { + $sql = sprintf("INSERT + INTO %1\$s + (user_id, %2\$s, domain_id, %3\$s, active, created, modified, class_type) + VALUES ('%4\$d', '%5\$s', '%6\$d', '%7\$s', '1', '%8\$d', '%8\$d', '%9\$d')", + ALIAS_TABLE,ALIAS_ALIAS,ALIAS_DESTINATION,$this_userinfo['user_id'],$this_userinfo[USERS_USER],$this_userinfo['domain_id'],$this_userinfo[USERS_USER],$config['current_time'],FORWARD_EMAIL); + + if ( !($db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 16004: '.sprintf(_('Unable to insert into: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); + } + watchdog($sql); + } + + } else { + $sql = sprintf("DELETE + FROM %s + WHERE user_id = '%d' + AND class_type = '%s' + AND %s = '%s'", + ALIAS_TABLE,$this_userinfo['user_id'],FORWARD_EMAIL,ALIAS_DESTINATION,$this_userinfo[USERS_USER]); + + if ( !($db->sql_query($sql)) ) + { + report_error(CRITICAL_MESSAGE,'Error 16000: '.sprintf(_('Unable to delete from: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); + } + watchdog($sql); + + } } return; diff -urN ../vmailadmin-2.0_RC5.orig/includes/functions/setup_tools.php ./includes/functions/setup_tools.php --- ../vmailadmin-2.0_RC5.orig/includes/functions/setup_tools.php 2006-11-16 04:37:26.000000000 +0200 +++ ./includes/functions/setup_tools.php 2021-08-25 21:18:45.001627000 +0300 @@ -57,13 +57,13 @@ * Guess at server URL and script path * **/ -if (!empty($_SERVER['SERVER_NAME']) || !empty($_ENV['SERVER_NAME'])) +if (!empty($_SERVER['HTTP_HOST']) || !empty($_ENV['HTTP_HOST'])) { - $server_url = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $_ENV['SERVER_NAME']; + $server_url = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; } -else if (!empty($_SERVER['HTTP_HOST']) || !empty($_ENV['HTTP_HOST'])) +else if (!empty($_SERVER['SERVER_NAME']) || !empty($_ENV['SERVER_NAME'])) { - $server_url = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; + $server_url = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $_ENV['SERVER_NAME']; } $script_path = $_SERVER['SCRIPT_URL']; diff -urN ../vmailadmin-2.0_RC5.orig/includes/functions/validate_tools.php ./includes/functions/validate_tools.php --- ../vmailadmin-2.0_RC5.orig/includes/functions/validate_tools.php 2007-01-02 03:09:01.000000000 +0200 +++ ./includes/functions/validate_tools.php 2007-08-24 16:12:06.000000000 +0300 @@ -107,6 +107,9 @@ **/ function mx_check($this_check,$this_record) { +print("\n"); +print("\n"); + global $config; if ( !$config['strong_mx_checks'] ) { @@ -118,6 +121,10 @@ { case 1: $this_record = "A"; + break; + + case -1: + $this_record = "MX"; break; default: diff -urN ../vmailadmin-2.0_RC5.orig/includes/menu/index.php ./includes/menu/index.php --- ../vmailadmin-2.0_RC5.orig/includes/menu/index.php 2007-01-07 21:10:21.000000000 +0200 +++ ./includes/menu/index.php 2007-01-26 12:08:24.000000000 +0200 @@ -62,6 +62,7 @@ 'config' => FALSE, 'domains' => array('headless','spam'), 'users' => array('alias'), + 'domains_headless_alias' => array('headless','spam'), 'spam' => FALSE, 'dspam' => FALSE, 'search' => FALSE, @@ -113,6 +114,12 @@ $is_authorized = TRUE; $string = _('Domains'); $title = _('Manage Domains'); + break; + + case 'domains_headless_alias': + $is_authorized = TRUE; + $string = _('Headless Aliases'); + $title = _('Manage Headless Aliases'); break; case 'users': diff -urN ../vmailadmin-2.0_RC5.orig/login.php ./login.php --- ../vmailadmin-2.0_RC5.orig/login.php 2006-12-29 22:11:26.000000000 +0200 +++ ./login.php 2010-07-19 12:37:35.000000000 +0300 @@ -197,9 +197,9 @@ $password = $password; $db_salt = $db_password = $row['password']; - if ( !($row['domain_id'] == DISABLE) ) +// if ( !($row['domain_id'] == DISABLE) ) { - if ( ($user_count > 0) && !($domaindata['active'] == ENABLE) ) + if (!($row['domain_id'] == DISABLE) and (($user_count > 0) && !($domaindata['active'] == ENABLE)) ) { $login_failed = DOMAIN_DISABLED; } diff -urN ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/domain_headless_alias_base.html ./styles/gris/templates/admin/domain_headless_alias_base.html --- ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/domain_headless_alias_base.html 1970-01-01 03:00:00.000000000 +0300 +++ ./styles/gris/templates/admin/domain_headless_alias_base.html 2007-06-16 17:03:22.000000000 +0300 @@ -0,0 +1,142 @@ +
+ + +
+
+
{display_domains.pagination.PAGEOF}
+
{display_domains.pagination.PAGES}
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
{L_DOMAINLIST}{L_LEGEND}{L_FUNCTIONS} 
+ + {display_domains.domain_loop.DOMAIN} + + + {display_domains.domain_loop.L_STATE_ALT} + {display_domains.domain_loop.L_CLASS_ALT} + + {display_domains.domain_loop.mxinfo_img.L_MXINFO_ALT} + + + {display_domains.domain_loop.alias_img.L_ALIAS_ALT} + + +   + + +
  + + {display_domains.privleged.L_TOGGLEALL} + +
+
+ +
+
+ + + + + + + + + +
+ +    + +    + + +    + +
+
+
+ +
+
+ {display_domains.icon_legend.LEGENDTITLE} + + + + + + + + + + + + + + + + + + + + + +
{display_domains.icon_legend.L_LEGENDICON1} {display_domains.icon_legend.L_LEGENDICON2} {display_domains.icon_legend.L_LEGENDICON3} {display_domains.icon_legend.L_LEGENDICON4}
{display_domains.icon_legend.L_LEGENDICON5} {display_domains.icon_legend.L_LEGENDICON6} {display_domains.icon_legend.L_LEGENDICON7} {display_domains.icon_legend.L_LEGENDICON8}
{display_domains.icon_legend.L_LEGENDICON10} {display_domains.icon_legend.L_LEGENDICON9}  
+
+
+ + + +
+
+
+ {new_domain.L_DOMAINFORM} +
+
+
+ + +    {new_domain.L_LOCAL} +    {new_domain.L_VIRTUAL} + +
+
+
+
+
+ + + + +    + +
+
+
+ +
diff -urN ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_add.html ./styles/gris/templates/admin/users_add.html --- ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_add.html 2006-11-15 06:22:04.000000000 +0200 +++ ./styles/gris/templates/admin/users_add.html 2007-06-05 20:30:59.000000000 +0300 @@ -61,12 +61,23 @@

{forwarding.L_ADDRESSEXPLAIN}
-
+
+ +
+
+

{forwarding.L_FORWARDSAVEEXPLAIN}
+
+ + {L_YES}   + {L_NO} + +
+
-
+
diff -urN ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_details.html ./styles/gris/templates/admin/users_details.html --- ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_details.html 2006-12-06 21:08:40.000000000 +0200 +++ ./styles/gris/templates/admin/users_details.html 2007-06-10 23:06:54.000000000 +0300 @@ -71,8 +71,19 @@

{forwarding.L_ADDRESSEXPLAIN}
-
+
+ +
+
+

{forwarding.L_FORWARDSAVEEXPLAIN}
+
+ + {L_YES}   + {L_NO} + +
+
diff -urN ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_modifylist.html ./styles/gris/templates/admin/users_modifylist.html --- ../vmailadmin-2.0_RC5.orig/styles/gris/templates/admin/users_modifylist.html 2006-11-15 06:20:43.000000000 +0200 +++ ./styles/gris/templates/admin/users_modifylist.html 2007-06-10 23:02:59.000000000 +0300 @@ -25,6 +25,7 @@ {display_users.user_loop.MAILBOX} + ({display_users.user_loop.NAME}) @@ -39,10 +40,12 @@ {display_users.user_loop.L_EDITUSER_ALT} {display_users.user_loop.L_ALIAS_ALT} + diff -urN ../vmailadmin-2.0_RC5.orig/styles/gris/templates/user_base.html ./styles/gris/templates/user_base.html --- ../vmailadmin-2.0_RC5.orig/styles/gris/templates/user_base.html 2006-11-14 04:19:20.000000000 +0200 +++ ./styles/gris/templates/user_base.html 2007-01-28 17:38:56.000000000 +0200 @@ -66,8 +66,22 @@

{forwarding.L_ADDRESSEXPLAIN}
- + + +
+
+
+

{forwarding.L_FORWARDSAVEEXPLAIN}
+
+ + + {L_YES}   + {L_NO} +
diff -urN ../vmailadmin-2.0_RC5.orig/users/user/index.php ./users/user/index.php --- ../vmailadmin-2.0_RC5.orig/users/user/index.php 2006-11-17 08:00:33.000000000 +0200 +++ ./users/user/index.php 2007-01-28 17:15:47.000000000 +0200 @@ -40,7 +40,9 @@ 'user_lang' => 'user_lang', 'forward_destination' => 'destination', 'forwarding' => 'forwarding', + 'forwarding_save' => 'forwarding_save', 'prev_destination' => 'prev_destination', + 'hidden_destination' => 'hidden_destination', 'style_id' => 'style_id', 'items_per_page' => 'items_per_page' ); diff -urN ../vmailadmin-2.0_RC5.orig/users/user/user_base.php ./users/user/user_base.php --- ../vmailadmin-2.0_RC5.orig/users/user/user_base.php 2006-11-14 04:22:25.000000000 +0200 +++ ./users/user/user_base.php 2007-01-28 17:00:59.000000000 +0200 @@ -107,6 +107,7 @@ if ( $domaindata['permit_mail_forwarding'] || $user->data['user_level'] == ADMIN || $user->data['user_level'] == ROOT ) { + $forwarding['destination'] = ''; if ( $user->data['forwarding'] ) { $sql = sprintf("SELECT %s @@ -120,12 +121,16 @@ report_error(CRITICAL_MESSAGE,'Error 2520: '.sprintf(_('Unable to query: %s'),ALIAS_TABLE),$sql,__FILE__,__LINE__); } $row = $db->sql_fetchrow($result); - $destination = $row['destination']; + $destination = $row[ALIAS_DESTINATION]; + $forwarding['destination'] = $row['destination']; } - $forwarding['destination'] = $row['destination']; - if ( empty($row['destination']) ) + if ( empty($forwarding['destination']) ) { + $forwarding['destination'] = $user->data['forward_dest']; + } + if ( empty($forwarding['destination']) ) + { $forwarding['destination'] = "... email@domain.tld ..."; } @@ -134,9 +139,13 @@ 'L_FORWARDEXPLAIN' => _('To enable mail forwarding, you must also provide the address to forward to below.'), 'L_ADDRESS' => _('Forwarding Address'), 'L_ADDRESSEXPLAIN' => _('Forwarding address must be in the format of user@domain.tld'), + 'L_FORWARDSAVE' => _('Save Forwarded Message'), + 'L_FORWARDSAVEEXPLAIN' => _('Retain a local copy of forwarded mail.'), 'INPUTSTATE' => !$user->data['forwarding'] ? 'disabled="disabled"' : NULL, 'FORWARDYES' => $user->data['forwarding'] ? 'checked="checked"' : NULL, 'FORWARDNO' => !$user->data['forwarding'] ? 'checked="checked"' : NULL, + 'FORWARDSAVEYES' => $user->data['forward_save'] ? 'checked="checked"' : NULL, + 'FORWARDSAVENO' => !$user->data['forward_save'] ? 'checked="checked"' : NULL, 'ADDRESS' => $forwarding['destination']) ); } diff -urN ../vmailadmin-2.0_RC5.orig/users/user/user_update.php ./users/user/user_update.php --- ../vmailadmin-2.0_RC5.orig/users/user/user_update.php 2006-11-10 10:39:10.000000000 +0200 +++ ./users/user/user_update.php 2007-06-10 20:37:21.000000000 +0300 @@ -45,9 +45,10 @@ $change_password = TRUE; } +$forward_state = $forwarding ? ENABLE : DISABLE; +$forward_save_state = $forwarding_save ? ENABLE : DISABLE; if ( !($forwarding == $user->data['forwarding']) || !($forward_destination == $prev_destination) ) { - $forward_state = $forwarding ? ENABLE : DISABLE; if ( $forward_state == ENABLE ) { if ( $forward_destination{0} == "." || !check_email($forward_destination) ) @@ -57,13 +58,14 @@ } } - ratify_user_mail_forwarding($user->data,$forward_state,$forward_destination); + ratify_user_mail_forwarding($user->data,$forward_state,$forward_destination,$forward_save_state); } +if (!$forward_destination ) $forward_destination = $hidden_destination; $sql = sprintf("UPDATE %s - SET %s name = '%s', user_lang = '%s', modified = '%d', items_per_page = '%d', forwarding = '%d', style_id = '%d' + SET %s name = '%s', user_lang = '%s', modified = '%d', items_per_page = '%d', forwarding = '%d', forward_save = '%d', forward_dest = '%s', style_id = '%d' WHERE user_id = '%d'", - USERS_TABLE,$update_password,$name,$user_lang,$config['current_time'],$items_per_page,$forward_state,$style_id,$user->data['user_id']); + USERS_TABLE,$update_password,$name,$user_lang,$config['current_time'],$items_per_page,$forward_state,$forward_save_state,$forward_destination,$style_id,$user->data['user_id']); if ( !($result = $db->sql_query($sql)) ) {