1 /*****************************************************************
2 * Licensed to the Apache Software Foundation (ASF) under one *
3 * or more contributor license agreements. See the NOTICE file *
4 * distributed with this work for additional information *
5 * regarding copyright ownership. The ASF licenses this file *
6 * to you under the Apache License, Version 2.0 (the *
7 * "License"); you may not use this file except in compliance *
8 * with the License. You may obtain a copy of the License at *
9 * *
10 * http://www.apache.org/licenses/LICENSE-2.0 *
11 * *
12 * Unless required by applicable law or agreed to in writing, *
13 * software distributed under the License is distributed on an *
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15 * KIND, either express or implied. See the License for the *
16 * specific language governing permissions and limitations *
17 * under the License. *
18 ****************************************************************/
19
20 package org.apache.james.smtpserver;
21
22 import org.apache.james.services.MailServer;
23 import org.apache.james.services.UsersRepository;
24
25 /***
26 * Provides a number of server-wide constant values to the
27 * SMTPHandlers
28 *
29 */
30 public interface SMTPHandlerConfigurationData {
31
32 /***
33 * Returns the service wide hello name
34 *
35 * @return the hello name
36 */
37 String getHelloName();
38
39 /***
40 * Returns the service wide reset length in bytes.
41 *
42 * @return the reset length
43 */
44 int getResetLength();
45
46 /***
47 * Returns the service wide maximum message size in bytes.
48 *
49 * @return the maximum message size
50 */
51 long getMaxMessageSize();
52
53 /***
54 * Returns whether relaying is allowed for the IP address passed.
55 *
56 * @param remoteIP the remote IP address in String form
57 * @return whether relaying is allowed
58 */
59 boolean isRelayingAllowed(String remoteIP);
60
61 /***
62 * Returns whether SMTP AUTH is active for this server, and
63 * necessary for the IP address passed.
64 *
65 * @param remoteIP the remote IP address in String form
66 * @return whether SMTP authentication is on
67 */
68 boolean isAuthRequired(String remoteIP);
69
70 /***
71 * Returns whether SMTP auth is active for this server.
72 *
73 * @return whether SMTP authentication is on
74 */
75 boolean isAuthRequired();
76
77 /***
78 * Returns whether the service validates the identity
79 * of its senders.
80 *
81 * @return whether SMTP authentication is on
82 */
83 boolean isVerifyIdentity();
84
85 /***
86 * Returns whether the remote server needs to send a HELO/EHLO
87 * of its senders.
88 *
89 * @return whether SMTP authentication is on
90 */
91 boolean useHeloEhloEnforcement();
92
93 /***
94 * Returns the MailServer interface for this service.
95 *
96 * @return the MailServer interface for this service
97 */
98 MailServer getMailServer();
99
100 /***
101 * Returns the UsersRepository for this service.
102 *
103 * @return the local users repository
104 */
105 UsersRepository getUsersRepository();
106
107 }