Class JilterConfiguration
java.lang.Object
com.aoindustries.aoserv.jilter.config.JilterConfiguration
In order to avoid a real-time dependency between the Jilter code and the full
AOServ Platform, the configuration values for the jilter are placed into a
properties file that is stored in
/etc/opt/aoserv-jilter/aoserv-jilter.properties
. The
aoserv-daemon
will rebuild this file when any of its related
tables have been updated and at daemon start-up. The result is that jilter
can work off the last config file even when AOServ is down for maintenance or
not working properly.- Author:
- AO Industries, Inc.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJilterConfiguration
(String listenIp, int listenPort, boolean restrictOutboundEmail, String smtpServer, String emailSummaryFrom, String emailSummaryTo, String emailFullFrom, String emailFullTo, Map<String, String> domainBusinesses, Map<String, Set<String>> domainAddresses, Set<String> ips, Set<String> denies, Set<String> denySpams, Set<String> allowRelays, Map<String, EmailLimit> emailInLimits, Map<String, EmailLimit> emailOutLimits, Map<String, EmailLimit> emailRelayLimits) Creates a new Jilter configuration. -
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(JilterConfiguration other) boolean
static boolean
Deprecated.static boolean
Compares two sets and makes sure they exactly match.static boolean
Compares two maps and makes sure they exactly match, including all their values.static boolean
equalsMapSetString
(Map<?, ? extends Set<?>> map1, Map<?, ? extends Set<?>> map2) Compares two maps and makes sure they exactly match, including all their mapped sets.getAddresses
(String domain) Gets the set of addresses for a specific domain (without the @domain part of the address).getBusiness
(String domain) Gets the unique business name for a domain ornull
if domain doesn't exist.Gets the from address to be used for the full email.Gets the comma-separated list of to addresses to be used for the full email.getEmailInLimit
(String accounting) Gets the inboundEmailLimit
given its unique business name ornull
if unlimited.getEmailOutLimit
(String accounting) Gets the outboundEmailLimit
given its unique business name ornull
if unlimited.getEmailRelayLimit
(String accounting) Gets the relayEmailLimit
given its unique business name ornull
if unlimited.Gets the from address to be used for the summary email.Gets the comma-separated list of to addresses to be used for the summary email.static JilterConfiguration
Gets the current configuration.int
boolean
Gets the SMTP server to use for outbound email, empty ornull
means don't send emails.Gets the version of this file this was loaded from.boolean
isAllowRelay
(String ip) Returnstrue
if the provided IP address has explicit relay permission granted.boolean
Returnstrue
if the provided IP address is denied.boolean
isDeniedSpam
(String ip) Returnstrue
if the provided IP address is denied because it has been reported as sending spam.boolean
Returnstrue
if the provided IP address is a local address.void
saveIfChanged
(String comment) Saves the new configuration if either the config file doesn't exist or has changed in any way.
-
Field Details
-
DEFAULT_MILTER_PORT
public static final int DEFAULT_MILTER_PORTThe default milter port.- See Also:
-
PROPS_FILE
- See Also:
-
-
Constructor Details
-
JilterConfiguration
public JilterConfiguration(String listenIp, int listenPort, boolean restrictOutboundEmail, String smtpServer, String emailSummaryFrom, String emailSummaryTo, String emailFullFrom, String emailFullTo, Map<String, String> domainBusinesses, Map<String, Set<String>> domainAddresses, Set<String> ips, Set<String> denies, Set<String> denySpams, Set<String> allowRelays, Map<String, EmailLimit> emailInLimits, Map<String, EmailLimit> emailOutLimits, Map<String, EmailLimit> emailRelayLimits) Creates a new Jilter configuration.
-
-
Method Details
-
getJilterConfiguration
Gets the current configuration. If the file has been updated, will reload the configuration from disk.- Throws:
IOException
-
saveIfChanged
Saves the new configuration if either the config file doesn't exist or has changed in any way.- Throws:
IOException
-
getVersion
Gets the version of this file this was loaded from. -
getListenIp
-
getListenPort
public int getListenPort() -
getRestrictOutboundEmail
public boolean getRestrictOutboundEmail() -
getSmtpServer
Gets the SMTP server to use for outbound email, empty ornull
means don't send emails. -
getEmailSummaryFrom
Gets the from address to be used for the summary email. -
getEmailSummaryTo
Gets the comma-separated list of to addresses to be used for the summary email. -
getEmailFullFrom
Gets the from address to be used for the full email. -
getEmailFullTo
Gets the comma-separated list of to addresses to be used for the full email. -
getBusiness
Gets the unique business name for a domain ornull
if domain doesn't exist. -
getAddresses
Gets the set of addresses for a specific domain (without the @domain part of the address). If the domain exists and has no addresses, returns an empty set. If the domain doesn't exist at all then returnsnull
. Domain is case-insensitive by conversion to lower-case. -
isLocalIpAddress
Returnstrue
if the provided IP address is a local address. -
isDenied
Returnstrue
if the provided IP address is denied. -
isDeniedSpam
Returnstrue
if the provided IP address is denied because it has been reported as sending spam. -
isAllowRelay
Returnstrue
if the provided IP address has explicit relay permission granted. -
getEmailInLimit
Gets the inboundEmailLimit
given its unique business name ornull
if unlimited. -
getEmailOutLimit
Gets the outboundEmailLimit
given its unique business name ornull
if unlimited. -
getEmailRelayLimit
Gets the relayEmailLimit
given its unique business name ornull
if unlimited. -
equals
-
equals
-
equals
Compares two sets and makes sure they exactly match. -
equalsMapSetString
public static boolean equalsMapSetString(Map<?, ? extends Set<?>> map1, Map<?, ? extends Set<?>> map2) Compares two maps and makes sure they exactly match, including all their mapped sets. -
equalsMap
Compares two maps and makes sure they exactly match, including all their values. -
equals
Deprecated.Please useObjects.equals(java.lang.Object, java.lang.Object)
instead.Compares two objects withnull
being equal tonull
.
-
Objects.equals(java.lang.Object, java.lang.Object)
instead.