--- smeserver-zarafa-0.9.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias.http 2008-12-21 18:19:28.000000000 +1100 +++ smeserver-zarafa-0.9.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86ZarafaAlias 2008-12-21 18:29:51.000000000 +1100 @@ -1,12 +1,37 @@ +{ + my $zstatus = $zarafa{'status'}; - Alias /zarafa /var/www/html/webaccess/ - - Options -Indexes - AllowOverride None - order allow,deny - allow from all - AddType application/x-httpd-php .php - php_flag magic_quotes_gpc off - php_flag track_vars on - + if (defined $zstatus && $zstatus eq 'enabled') + { + $OUT .= qq( +# Zarafa specific configuration files. + + + Options -Indexes + AllowOverride None + order allow,deny + allow from all + AddType application/x-httpd-php .php .php3 + php_flag magic_quotes_gpc off + + + + Options -Indexes + AllowOverride None + order allow,deny + allow from all + AddType application/x-httpd-php .php + php_flag magic_quotes_gpc off + php_flag register_globals off + php_flag magic_quotes_runtime off + php_flag short_open_tag on + + +); + } + else + { + $OUT .= "# Zarafa Webmail is not configured as it is disabled in the config db"; + } +} --- smeserver-zarafa-0.9.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases.http 2008-12-21 18:18:18.000000000 +1100 +++ smeserver-zarafa-0.9.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/29ZarafaAliases 2008-12-21 18:27:27.000000000 +1100 @@ -0,0 +1,27 @@ +{ + # vim: ft=perl: + + $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; + my $zwebmailStatus = $zarafa{'status'} || "disabled"; + my $zwebmailAccessType = $zarafa{'access'} || "SSL"; + + my $dirs; + $dirs{zarafa} = '/var/www/html/webaccess'; + $dirs{webaccess} = '/var/www/html/webaccess'; + $dirs{webmail} = '/var/www/html/webaccess'; + $dirs{mobile} = '/var/www/html/webaccess-mobile'; + $dirs{'Microsoft-Server-ActiveSync'} = '/var/www/html/z-push/index.php'; + + return " # Zarafa is disabled in this VirtualHost\n" + unless $zwebmailStatus eq 'enabled'; + + foreach $place ('zarafa','webaccess','webmail','mobile','Microsoft-Server-ActiveSync') + { + if (($port eq "80") && ($haveSSL eq 'yes') && ($zwebmailAccessType eq 'SSL')) + { + $OUT .= " RewriteRule ^/$place(/.*|\$) https://%{HTTP_HOST}/$place\$1 [L,R]\n"; + } else { + $OUT .= " Alias /$place $dirs{$place}\n"; + } + } +}