01: /* CVS ID: $Id: WebMailVirtualDomain.java,v 1.1.1.1 2002/10/02 18:42:53 wastl Exp $ */
02: package net.wastl.webmail.server;
03:
04: import java.util.*;
05:
06: /*
07: * WebMailVirtualDomain.java
08: *
09: * Created: Sat Jan 15 14:08:30 2000
10: *
11: * Copyright (C) 2000 Sebastian Schaffert
12: *
13: * This program is free software; you can redistribute it and/or
14: * modify it under the terms of the GNU General Public License
15: * as published by the Free Software Foundation; either version 2
16: * of the License, or (at your option) any later version.
17: *
18: * This program is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU General Public License for more details.
22: *
23: * You should have received a copy of the GNU General Public License
24: * along with this program; if not, write to the Free Software
25: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26: */
27: /**
28: * Represents a virtual domain in WebMail.
29: * A virtual domain in WebMail allows the following things
30: * - users can belong to a certain domain
31: * - each domain has it's own default host, authentication host, and default email suffix
32: * - each domain can have specific security features, i.e. IMAP/POP hosts users of that domain
33: * are allowed to connect to.
34: *
35: * @author Sebastian Schaffert
36: * @version
37: */
38:
39: public interface WebMailVirtualDomain {
40:
41: /**
42: * Return the name of this domain. This will be appended to a new users email address
43: * and will be used in the login screen
44: */
45: public String getDomainName();
46:
47: public void setDomainName(String name) throws Exception;
48:
49: /**
50: * This returns the name of the default server that will be used.
51: * The default server is where a user gets his first folder (the one named "Default").
52: */
53: public String getDefaultServer();
54:
55: public void setDefaultServer(String name);
56:
57: /**
58: * If the authentication type for this domain is IMAP or POP, this host will be used
59: * to authenticate users.
60: */
61: public String getAuthenticationHost();
62:
63: public void setAuthenticationHost(String name);
64:
65: /**
66: * Check if a hostname a user tried to connect to is within the allowed range of
67: * hosts. Depending on implementation, this could simply check the name or do an
68: * DNS lookup to check for IP ranges.
69: * The default behaviour should be to only allow connections to the default host and
70: * reject all others. This behaviour should be configurable by the administrator, however.
71: */
72: public boolean isAllowedHost(String host);
73:
74: /**
75: * Set the hosts a user may connect to if host restriction is enabled.
76: * Excpects a comma-separated list of hostnames.
77: * The default host will be added to this list in any case
78: */
79: public void setAllowedHosts(String hosts);
80:
81: public Enumeration getAllowedHosts();
82:
83: /**
84: * Enable/Disable restriction on the hosts that a user may connect to.
85: * If "disabled", a user may connect to any host on the internet
86: * If "enabled", a user may only connect to hosts in the configured list
87: * @see isAllowedHost
88: */
89: public void setHostsRestricted(boolean b);
90:
91: public boolean getHostsRestricted();
92:
93: } // WebMailVirtualDomain
|