java.lang.Object
com.aoindustries.aoserv.jilter.config.JilterConfiguration

public class JilterConfiguration extends Object
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 Details

  • Constructor Details

  • Method Details

    • getJilterConfiguration

      public static JilterConfiguration getJilterConfiguration() throws IOException
      Gets the current configuration. If the file has been updated, will reload the configuration from disk.
      Throws:
      IOException
    • saveIfChanged

      public void saveIfChanged(String comment) throws IOException
      Saves the new configuration if either the config file doesn't exist or has changed in any way.
      Throws:
      IOException
    • getVersion

      public String getVersion()
      Gets the version of this file this was loaded from.
    • getListenIp

      public String getListenIp()
    • getListenPort

      public int getListenPort()
    • getRestrictOutboundEmail

      public boolean getRestrictOutboundEmail()
    • getSmtpServer

      public String getSmtpServer()
      Gets the SMTP server to use for outbound email, empty or null means don't send emails.
    • getEmailSummaryFrom

      public String getEmailSummaryFrom()
      Gets the from address to be used for the summary email.
    • getEmailSummaryTo

      public String getEmailSummaryTo()
      Gets the comma-separated list of to addresses to be used for the summary email.
    • getEmailFullFrom

      public String getEmailFullFrom()
      Gets the from address to be used for the full email.
    • getEmailFullTo

      public String getEmailFullTo()
      Gets the comma-separated list of to addresses to be used for the full email.
    • getBusiness

      public String getBusiness(String domain)
      Gets the unique business name for a domain or null if domain doesn't exist.
    • getAddresses

      public Set<String> getAddresses(String domain)
      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 returns null. Domain is case-insensitive by conversion to lower-case.
    • isLocalIpAddress

      public boolean isLocalIpAddress(String ip)
      Returns true if the provided IP address is a local address.
    • isDenied

      public boolean isDenied(String ip)
      Returns true if the provided IP address is denied.
    • isDeniedSpam

      public boolean isDeniedSpam(String ip)
      Returns true if the provided IP address is denied because it has been reported as sending spam.
    • isAllowRelay

      public boolean isAllowRelay(String ip)
      Returns true if the provided IP address has explicit relay permission granted.
    • getEmailInLimit

      public EmailLimit getEmailInLimit(String accounting)
      Gets the inbound EmailLimit given its unique business name or null if unlimited.
    • getEmailOutLimit

      public EmailLimit getEmailOutLimit(String accounting)
      Gets the outbound EmailLimit given its unique business name or null if unlimited.
    • getEmailRelayLimit

      public EmailLimit getEmailRelayLimit(String accounting)
      Gets the relay EmailLimit given its unique business name or null if unlimited.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(JilterConfiguration other)
    • equals

      public static boolean equals(Set<?> set1, Set<?> set2)
      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

      public static boolean equalsMap(Map<?,?> map1, Map<?,?> map2)
      Compares two maps and makes sure they exactly match, including all their values.
    • equals

      @Deprecated public static boolean equals(Object o1, Object o2)
      Compares two objects with null being equal to null.