1 package com.atlassian.mail;
2
3 /**
4 * Represents global settings that control sending of outgoing mail by a {@link com.atlassian.mail.server.MailServer}
5 * instance.
6 *
7 * @since v2.5
8 */
9 public interface Settings
10 {
11 /**
12 * Key of the system property used by {@link Settings.Default} to determine whether outgoing mail should be sent or
13 * not.
14 */
15 public static String ATLASSIAN_MAIL_SEND_DISABLED_SYSTEM_PROPERTY_KEY = "atlassian.mail.senddisabled";
16
17 /**
18 * Whether outgoing mail is disabled or not.
19 *
20 * @return {@code true} if outgoing should not be sent; otherwise false.
21 */
22 boolean isSendingDisabled();
23
24 public static class Default implements Settings
25 {
26 /**
27 * Determines whether outgoing mail should be sent based on the value of the
28 * {@link Settings#ATLASSIAN_MAIL_SEND_DISABLED_SYSTEM_PROPERTY_KEY} system property.
29 *
30 * @return {@code true} if the {@link Settings#ATLASSIAN_MAIL_SEND_DISABLED_SYSTEM_PROPERTY_KEY} is set to
31 * {@code true}; otherwise {@code false}.
32 */
33 @Override
34 public boolean isSendingDisabled()
35 {
36 return Boolean.getBoolean(ATLASSIAN_MAIL_SEND_DISABLED_SYSTEM_PROPERTY_KEY);
37 }
38 }
39 }