head	1.4;
access;
symbols
	TIGRIS_1_1_0RC2:1.3
	TIGRIS_1_1_0RC1:1.3
	TIGRIS_1_1:1.3.0.14
	TIGRIS_1_0_8:1.3
	TIGRIS_1_0_8RC3:1.3
	TIGRIS_1_0_8RC2:1.3
	TIGRIS_1_0_8RC1:1.3
	TIGRIS_1_0_7:1.3
	TIGRIS_1_0_7RC3:1.3
	TIGRIS_1_0_7RC2:1.3
	TIGRIS_1_0_7RC1:1.3
	TIGRIS_1_0_6:1.3
	TIGRIS_1_0_6RC5:1.3
	TIGRIS_1_0_6RC4:1.3
	TIGRIS_1_0_6RC3:1.3
	TIGRIS_1_0_6RC2:1.3
	TIGRIS_1_0_6RC1:1.3
	TIGRIS_1_0_5:1.3
	TIGRIS_1_0_5RC6:1.3
	TIGRIS_1_0_5RC5:1.3
	TIGRIS_1_0_5RC4:1.3
	TIGRIS_1_0_5RC3:1.3
	TIGRIS_1_0_5RC2:1.3
	TIGRIS_1_0_5RC1:1.3
	TIGRIS_1_0_4:1.3
	TIGRIS_1_0_3:1.3
	TIGRIS_1_0_2:1.3
	TIGRIS_1_0_1:1.3
	TIGRIS_1_0:1.3.0.16
	TIGRIS_1_0_0:1.3
	TIGRIS_1_0_0_RC1:1.3.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.3
	TIGRIS_0_9_2_1:1.3
	TIGRIS_0_9_2:1.3.0.10
	TIGRIS_0_9_0:1.3.0.8
	TIGRIS_0_8_4:1.3.0.6
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.3.0.4
	TIGRIS_NOV_11_2000:1.3
	TIGRIS_SEP_13_2000:1.3.0.2
	TIGRIS_BASELINE:1.3;
locks; strict;
comment	@# @;


1.4
date	2001.08.14.21.57.24;	author edk;	state dead;
branches;
next	1.3;

1.3
date	2000.07.13.03.23.57;	author ed;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.03.04.21.34;	author jrobbins;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.30.03.22.37;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.06;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.4
log
@remove obsolete/non-functional scripts
@
text
@# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# Helm/QmailAlias.pm
# --------------------
# Update the qmail aliases to match the user list; forward all the email
# addrs to the proper place.
#
# Note that for this to work (and the qmail mailing lists - see
# Helm::QmailLists) several users must exist and be configured in
# qmail. The user configured in the $qmail_user config parameter
# (see Helm::Config) must exist and qmail be set to use it for
# mail to domain.org (in control/virtualdomains). For each project,
# qmail should map project.domain.org to ${qmail_user}-project.
#
# Note that we create these aliases for each domain, so that mail to
# user@@tigris.org works as well as user@@project.tigris.org.

package Helm::QmailAlias;

use Helm::Updater;
@@ISA = qw(Helm::Updater);

use strict;
use Helm::Config;
use Helm::TableSync;

use Helm::QmailUtils;

sub user {
    my ($class, $db) = @@_;
    return $db->config('qmail_user');
}

# update Helm::QmailAlias $db;
# perform the update - make all the files proper
sub update {
    my ($class, $db) = @@_;
    my ($ts, $home);

    # Find the home directory of the qmail user;
    $home = Helm::QmailUtils::home($db);

    $ts = new Helm::TableSync($db, 'domain_users', 'username',
				"$home/tigris-qmail", \&_qmail_map);
    $ts->check("$home/.qmail-", 'email', undef, 'email');
}

# Map email addr into qmail file. The cookie is a string giving
# the prefix - $HOME_OF_QMAIL_USER/.qmail-project- - this just adds
# the username, really.
sub _qmail_map {
    my ($cookie, $db, $cols) = @@_;
    return "$cookie$cols->[0]";
}

sub add_project {
    my ($class, $db, $project) = @@_;

    # We don't need to do much, but remind the user...
    return("add $project." . $db->config('domain_dns')
	   . ':' . $db->config('qmail_user')
	   . "-$project to control/virtualdomains\n");
}

# If a project is deleted, we must remove all of its qmail-alias files
sub del_project {
    my ($class, $db, $project) = @@_;

    my $home = Helm::QmailUtils::home;
    my $ts = new Helm::TableSync($db, 'domain_users', 'username',
				   "$home/tigris-qmail-$project",
				   \&_qmail_map);
    $ts->delete;

    # Note to the user
    return("remove $project." . $db->config('domain_dns')
	   . " from control/virtualdomains\n");
}
@


1.3
log
@don't create project-user for each project -- users will only have
one alias user@@domain -- user@@project.domain won't work.
@
text
@@


1.2
log
@Added tigris.org license
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@a90 8

    # Now for each project
    my $proj;
    foreach $proj ($db->projects) {
	$ts = new Helm::TableSync($db, 'domain_users', 'username',
				    "$home/tigris-qmail-$proj", \&_qmail_map);
	$ts->check("$home/.qmail-$proj-", 'email', undef, 'email');
    }
@


1.1
log
@initial checkin
@
text
@d1 46
a46 1
# Copyright (c) 2000 Collab.Net, Inc.
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@d1 1
a1 46
# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#

d46 8
@


