Squirrelmail CAN'T BE CONFIGURED THROUGH A PROXY, so that configuration is currently commented out. We need to find a way to run the webmail on another web host than the panel one, that's all. No other solution found. So, next step for alternc-squirrelmail is to propose a vhost from the panel index WHEN ADMIN has a 'squirrelmail' type vhost ...

This commit is contained in:
Benjamin Sonntag 2012-08-26 19:59:12 +00:00
parent c8e5670c7a
commit 4a096f265c
16 changed files with 206 additions and 34 deletions

6
.gitattributes vendored
View File

@ -422,7 +422,6 @@ etc/alternc/templates/alternc/bureau.conf -text
etc/alternc/templates/apache2/panel.conf -text
etc/alternc/templates/apache2/url.conf -text
etc/alternc/templates/apache2/vhost.conf -text
etc/alternc/templates/apache2/webmail.conf -text
etc/alternc/templates/bind/automatic.conf -text
etc/alternc/templates/bind/named.conf.options -text
etc/alternc/templates/bind/slaveip.conf -text
@ -472,6 +471,7 @@ install/upgrades/0.9.9.sql -text
install/upgrades/1.0.1.php -text
install/upgrades/1.0.3.sql -text
install/upgrades/1.0.sql -text
install/upgrades/1.1.php -text
install/upgrades/1.1.sql -text
install/upgrades/README -text
lang/README -text
@ -501,8 +501,12 @@ po/fr/LC_MESSAGES/alternc-admintools.po -text
selenium/20120826-alternc-panel-testsuite.html -text
selenium/README -text
selenium/alternc.domain-local-mail-tld.html -text
squirrelmail/Makefile -text
squirrelmail/apache-panel.d/squirrelmail.conf -text
squirrelmail/apache2.conf -text
squirrelmail/redirect.php -text
squirrelmail/squirrelmail-install -text
squirrelmail/templates/apache2/squirrelmail.conf -text
squirrelmail/templates/javascript-common/javascript-common.conf -text
squirrelmail/templates/squirrelmail/apache.conf -text
squirrelmail/templates/squirrelmail/avelsieve-config.php -text

View File

@ -1,8 +1,11 @@
etc/apache2/conf.d
etc/alternc
etc/alternc/apache-panel.d
etc/alternc/templates/squirrelmail
etc/alternc/templates/apache2
etc/alternc/templates/javascript-common
etc/cron.d
etc/squirrelmail
usr/share/alternc/install
usr/lib/alternc/install.d
usr/share/alternc-squirrelmail

View File

@ -14,10 +14,12 @@ case "$1" in
if ! getent passwd alternc-squirrelmail; then
useradd -g nogroup -u 1997 alternc-squirrelmail -d /usr/share/squirrelmail
fi
dpkg-statoverride --list /var/spool/squirrelmail/attach >/dev/null ||
dpkg-statoverride --add alternc-squirrelmail root 0750 /var/spool/squirrelmail/attach
dpkg-statoverride --add alternc-squirrelmail root 0750 /usr/lib/squirrelmail/data
chown -R alternc-squirrelmail:root /var/spool/squirrelmail/attach /usr/lib/squirrelmail/data
chmod -R 750 /var/spool/squirrelmail/attach /usr/lib/squirrelmail/data
dpkg-statoverride --list /var/lib/squirrelmail/data >/dev/null ||
dpkg-statoverride --add alternc-squirrelmail root 0750 /var/lib/squirrelmail/data
chown -R alternc-squirrelmail:root /var/spool/squirrelmail/attach /var/lib/squirrelmail/data
chmod -R 750 /var/spool/squirrelmail/attach /var/lib/squirrelmail/data
;;
esac

35
debian/control vendored
View File

@ -74,8 +74,8 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
Package: alternc-squirrelmail
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0, alternc (>= 1.1)
Depends: debianutils (>= 1.13.1), squirrelmail, squirrelmail-locales, avelsieve
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 1.1), squirrelmail, squirrelmail-locales, avelsieve
Conflicts: alternc (<= 1.0.3)
Provides: alternc-webmail
Suggests:
@ -102,3 +102,34 @@ Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
automatique des profiles avec la bonne adresse et la bonne langue.
.
Pour plus d'informations, consultez http://www.alternc.com/
Package: alternc-roundcube
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
Depends: debianutils (>= 1.13.1), alternc (>= 1.1), roundcube, roundcube-mysql, roundcube-plugins
Conflicts: alternc (<= 1.0.3)
Provides: alternc-webmail
Suggests:
Description: Roundcube-Webmail plugin and configuration for AlternC
AlternC is a mutualized hosting software manager for Linux.
It allows you to manage your websites, domains, ftp, emails, aliases,
web statistics, mailing-lists, jabber accounts, etc.
.
This extension to AlternC is installing and configuring properly the
Roundcube Webmail. It also configure sieve to allow server-side
filtering, the password changing through MySQL, and the automatic
creation of proper profile with the right address and language.
.
More information at http://www.alternc.com/
Homepage: http://www.alternc.com/
Description-fr.UTF-8: Suite logicielle d'hébergement mutualisé pour Debian
AlternC est un logiciel d'hébergement mutualisé pour serveur Linux.
Il permet de gérer les sites web, domaines, ftp, emails, alias,
statistiques web, listes de discussions, comptes jabber, etc.
.
Cette extension d'AlternC installe et configure le webmail Roundcube.
Il configure aussi sieve pour permettre l'accès au filtrage du courrier
côté serveur, ainsi que le changement de mot de passe via MySQL et la création
automatique des profiles avec la bonne adresse et la bonne langue.
.
Pour plus d'informations, consultez http://www.alternc.com/

6
debian/rules vendored
View File

@ -96,10 +96,8 @@ install: build
cp debian/alternc.lintian debian/alternc/usr/share/lintian/overrides/alternc
cp debian/alternc-slave.lintian debian/alternc/usr/share/lintian/overrides/alternc-slave
install -m 644 squirrelmail/templates/squirrelmail/* debian/alternc-squirrelmail/etc/alternc/templates/squirrelmail/
install -m 644 squirrelmail/templates/javascript-common/* debian/alternc-squirrelmail/etc/alternc/templates/javascript-common/
install -m 750 squirrelmail/squirrelmail-install debian/alternc-squirrelmail/usr/lib/alternc/install.d/
install -m 644 squirrelmail/apache-panel.d/squirrelmail.conf debian/alternc-squirrelmail/etc/alternc/apache-panel.d/
# alternc-squirrelmail:
(cd squirrelmail && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc-squirrelmail)
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will

View File

@ -27,7 +27,7 @@
# Also launches scripts in /usr/lib/alternc/install.d/
# with an argument telling where you are in alternc.install
# argument will be : startup, templates, before-reload, end
# argument will be : startup, templates, apache2, before-reload, end
# Somes check before start operations
if [ `id -u` -ne 0 ]; then
@ -243,8 +243,11 @@ rm -f $SED_SCRIPT
php="`ls /usr/lib/apache*/*/*php*.so | sed -e 's/^.*libphp\(.\)\.so$/php\1/' | tail -1`"
ln -fs /etc/alternc/alternc.ini /etc/$php/conf.d/alternc.ini || true
if [ -x /usr/sbin/apache2 ]; then
# hook
run-parts --arg=apache2 /usr/lib/alternc/install.d
s=""
# unused from AlternC 1.1
# unused from AlternC 1.1, FIXME: remove it later
if [ -L /etc/apache2/mods-enabled/vhost_alias.load ]
then
a2dismod vhost_alias

View File

@ -496,15 +496,14 @@ INSERT IGNORE INTO `domaines_type` (name, description, target, entry, compatibil
('vhost','Locally hosted', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt,defmx,defmx2,mx,mx2', false, false, false, 'ALL'),
('url','URL redirection', 'URL', '%SUB% IN A @@PUBLIC_IP@@','txt,defmx,defmx2', true, false, false, 'ALL'),
('ip','IPv4 redirect', 'IP', '%SUB% IN A %TARGET%','url,ip,ipv6,txt,mx,mx2,defmx,defmx2', false, true, false, 'ALL'),
('webmail', 'Webmail access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt', false, false, false, 'ALL'),
('ipv6','IPv6 redirect', 'IPV6', '%SUB% IN AAAA %TARGET%','ip,ipv6,webmail,txt,mx,mx2,defmx,defmx2',true, true, true , 'ALL'),
('ipv6','IPv6 redirect', 'IPV6', '%SUB% IN AAAA %TARGET%','ip,ipv6,txt,mx,mx2,defmx,defmx2',true, true, true , 'ALL'),
('cname', 'CNAME DNS entry', 'DOMAIN', '%SUB% CNAME %TARGET%', 'txt,mx,mx2,defmx,defmx2',true, true, true , 'ALL'),
('txt', 'TXT DNS entry', 'TXT', '%SUB% IN TXT "%TARGET%"','vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2,defmx,defmx2',true, true, true, 'ALL'),
('mx', 'MX DNS entry', 'DOMAIN', '%SUB% IN MX 5 %TARGET%', 'vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2',true, false, true, 'ALL'),
('mx2', 'secondary MX DNS entry', 'DOMAIN', '%SUB% IN MX 10 %TARGET%', 'vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2',true, false, true, 'ALL'),
('defmx', 'Default mail server', 'NONE', '%SUB% IN MX 5 @@DEFAULT_MX@@.', 'vhost,url,ip,webmail,ipv6,cname,txt,defmx2',true, false, true, 'ADMIN'),
('defmx2', 'Default backup mail server', 'NONE', '%SUB% IN MX 10 @@DEFAULT_SECONDARY_MX@@.', 'vhost,url,ip,webmail,ipv6,cname,txt,defmx',true, false, true, 'ADMIN'),
('panel', 'AlternC panel access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2,defmx,defmx2',true, false, true, 'ALL')
('txt', 'TXT DNS entry', 'TXT', '%SUB% IN TXT "%TARGET%"','vhost,url,ip,ipv6,cname,txt,mx,mx2,defmx,defmx2',true, true, true, 'ALL'),
('mx', 'MX DNS entry', 'DOMAIN', '%SUB% IN MX 5 %TARGET%', 'vhost,url,ip,ipv6,cname,txt,mx,mx2',true, false, true, 'ALL'),
('mx2', 'secondary MX DNS entry', 'DOMAIN', '%SUB% IN MX 10 %TARGET%', 'vhost,url,ip,ipv6,cname,txt,mx,mx2',true, false, true, 'ALL'),
('defmx', 'Default mail server', 'NONE', '%SUB% IN MX 5 @@DEFAULT_MX@@.', 'vhost,url,ip,ipv6,cname,txt,defmx2',true, false, true, 'ADMIN'),
('defmx2', 'Default backup mail server', 'NONE', '%SUB% IN MX 10 @@DEFAULT_SECONDARY_MX@@.', 'vhost,url,ip,ipv6,cname,txt,defmx',true, false, true, 'ADMIN'),
('panel', 'AlternC panel access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'vhost,url,ip,ipv6,cname,txt,mx,mx2,defmx,defmx2',true, false, true, 'ALL')
;

21
install/upgrades/1.1.php Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/php
<?php
// We check that mysql php module is loaded
if(!function_exists('mysql_connect')) {
if(!dl("mysql.so"))
exit(1);
}
// we don't check our AlternC session
if(!chdir("/var/alternc/bureau"))
exit(1);
require("/var/alternc/bureau/class/config_nochk.php");
// we go super-admin
$admin->enabled=1;
$db->query("SELECT * FROM sub_domaines WHERE type='webmail'");
if ($db->num_rows()) {
echo "WARNING: You have webmail domain-types, you need to install alternc-squirrelmail or alternc-roundcube to be able to use them again. They will work but may break until you do that\n";
}

View File

@ -225,3 +225,7 @@ DROP TABLE stats2;
-- With Dovecot, no more use of size_mail
DROP TABLE size_mail;
-- now that we have separate packages for the webmails, we can't serve webmail domainetype anymore
DELETE FROM domaines_type WHERE name='webmail';
UPDATE domaines_type SET compatibility=REPLACE(compatibility,'webmail,','');

34
squirrelmail/Makefile Normal file
View File

@ -0,0 +1,34 @@
# ----------------------------------------------------------------------
# AlternC - Web Hosting System
# Copyright (C) 2000-2012 by the AlternC Development Team.
# https://alternc.org/
# ----------------------------------------------------------------------
# LICENSE
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# To read the license please visit http://www.gnu.org/copyleft/gpl.html
# ----------------------------------------------------------------------
# Purpose of file: Install the files of alternc-squirrelmail packages
# ----------------------------------------------------------------------
install:
# alternc-squirrelmail files install
install -m 644 templates/squirrelmail/* $(DESTDIR)/etc/alternc/templates/squirrelmail/
install -m 644 templates/javascript-common/* $(DESTDIR)/etc/alternc/templates/javascript-common/
install -m 750 squirrelmail-install $(DESTDIR)/usr/lib/alternc/install.d/
install -m 644 apache-panel.d/squirrelmail.conf $(DESTDIR)/etc/alternc/apache-panel.d/
# default webmail vhost: squirrelmail.local, will be proxified from http://panel/squirrel/
install -m 644 apache2.conf $(DESTDIR)/etc/apache2/conf.d/alternc-squirrelmail.conf
# domaintype template:
install -m 644 templates/apache2/squirrelmail.conf $(DESTDIR)/etc/alternc/templates/apache2/squirrelmail.conf
# empty folder for redirect to /squirrel location ...
install -m 644 redirect.php $(DESTDIR)/usr/share/alternc-squirrelmail/index.php

View File

@ -1,4 +1,22 @@
Alias /squirrel /usr/share/squirrelmail
Alias /javascript /usr/share/javascript
<Location /squirrel>
ProxyPass http://squirrelmail.local/squirrel
ProxyPassReverse http://squirrelmail.local/squirrel
</Location>
Alias /squirrel /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
php_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail/:/var/lib/squirrelmail/data/:/var/spool/squirrelmail/
php_admin_flag safe_mode off
Options Indexes FollowSymLinks
</Directory>
Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
Options FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>

23
squirrelmail/apache2.conf Normal file
View File

@ -0,0 +1,23 @@
<VirtualHost *:80>
ServerName squirrelmail.local
AssignUserId alternc-squirrelmail nogroup
# Due to the PROXY TRICK, We need squirrel to be available BOTH at / AND /squirrel ...
DocumentRoot /usr/share/squirrelmail/
Alias /squirrel /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
php_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail/:/var/lib/squirrelmail/data/:/var/spool/squirrelmail/
php_admin_flag safe_mode off
Options Indexes FollowSymLinks
</Directory>
Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
Options FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

View File

@ -0,0 +1,4 @@
<?php
header("Location: /squirrel");

View File

@ -27,13 +27,39 @@ then
echo "Installing Squirrelmail Templates ..."
cp -f /etc/alternc/templates/squirrelmail/avelsieve-config.php /etc/alternc/templates/squirrelmail/apache.conf /etc/squirrelmail/
cp -f /etc/alternc/templates/javascript-common/javascript-common.conf /etc/javascript-common/
echo "Done"
echo " Done"
. /usr/lib/alternc/functions.sh
echo "Setting squirrelmail as default webmail"
echo "Setting squirrelmail as default webmail & installing domaintype"
mysql_query "INSERT IGNORE INTO variable SET name='webmail_redirect', value='squirrel', comment='Set it to the name of your preferred webmail, /webmail will point to it (squirrel, rc...)';"
echo "Done"
mysql_query "INSERT IGNORE INTO domaines_type (name ,description ,target ,entry ,compatibility ,enable ,only_dns ,need_dns ,advanced )VALUES ('squirrelmail','Squirrelmail Webmail access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt', 'ALL', '0', '0', '0');"
echo " Done"
echo "Migrating old webmail domaine type to squirrelmail one:"
# migration of the "webmail" hosts to "squirrelmail" hosts:
mysql_query "INSERT IGNORE INTO sub_domaines (compte, domaine, sub, valeur, type, web_action, web_result, enable) SELECT compte, domaine, sub, valeur,'squirrelmail', 'UPDATE',0, enable FROM sub_domaines WHERE type='webmail' AND web_action='OK';"
mysql_query "UPDATE sub_domaines SET web_action='DELETE' WHERE type='webmail' AND web_action='OK';"
echo " Done"
# echo "Adding squirrelmail.local in /etc/hosts for webmail vhost"
# if ! grep -q "127.0.0.1.*squirrelmail.local" /etc/hosts
# then
# echo "127.0.0.1 squirrelmail.local" >>/etc/hosts
# fi
fi
#if [ "$1" = "apache2" ]
#then
# echo "Installing Apache Proxy module for Squirrelmail ..."
# if ! [ -L /etc/apache2/mods-enabled/proxy.load ]
# then
# a2enmod proxy
# fi
# if ! [ -L /etc/apache2/mods-enabled/proxy_http.load ]
# then
# a2enmod proxy_http
# fi
# echo "Done"
#fi

View File

@ -1,6 +1,6 @@
<VirtualHost *:80>
ServerName %%fqdn%%
AssignUserId www-data www-data
AssignUserId alternc-squirrelmail nogroup
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
DocumentRoot /usr/share/squirrelmail
@ -10,4 +10,12 @@
Options Indexes FollowSymLinks
</Directory>
Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
Options FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

View File

@ -1,12 +1,7 @@
#
# $Id: Makefile,v 1.20 2005/05/21 16:07:32 arnaud-lb Exp $
# ----------------------------------------------------------------------
# AlternC - Web Hosting System
# Copyright (C) 2002 by the AlternC Development Team.
# http://alternc.org/
# ----------------------------------------------------------------------
# Based on:
# Valentin Lacambre's web hosting softwares: http://altern.org/
# Copyright (C) 2000-2012 by the AlternC Development Team.
# https://alternc.org/
# ----------------------------------------------------------------------
# LICENSE
#
@ -24,7 +19,6 @@
# ----------------------------------------------------------------------
# Purpose of file: Makefile des binaires de /usr/lib/alternc
# ----------------------------------------------------------------------
#
SETUID=quota_edit quota_get mem_add mem_del du.pl
SCRIPTS=sqlbackup.sh quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh update_mails.sh postfix-add-policy
LIBS=functions.sh functions_hosting.sh functions_dns.sh