Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
MailSenderConfiguration | 34 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.mail; | |
21 | ||
22 | import java.util.List; | |
23 | import java.util.Properties; | |
24 | ||
25 | import org.xwiki.component.annotation.Role; | |
26 | ||
27 | /** | |
28 | * Represents all XWiki configuration options for the Mail Sending feature. | |
29 | * | |
30 | * @version $Id: 3640ce2a940bdbe3496773f2cbec6f60bab0f86e $ | |
31 | * @since 6.1M2 | |
32 | */ | |
33 | @Role | |
34 | public interface MailSenderConfiguration | |
35 | { | |
36 | /** | |
37 | * @return the SMTP server | |
38 | */ | |
39 | String getHost(); | |
40 | ||
41 | /** | |
42 | * @return the SMTP server port | |
43 | */ | |
44 | int getPort(); | |
45 | ||
46 | /** | |
47 | * @return the SMTP user name to authenticate to the SMTP server, if any | |
48 | */ | |
49 | String getUsername(); | |
50 | ||
51 | /** | |
52 | * @return the SMTP password to authenticate to the SMTP server, if any | |
53 | */ | |
54 | String getPassword(); | |
55 | ||
56 | /** | |
57 | * @return the default email address to use when sending the email. This is optional and if the user of the API sets | |
58 | * it, then it overrides this default value | |
59 | */ | |
60 | String getFromAddress(); | |
61 | ||
62 | /** | |
63 | * @return the list of default email addresses to add to the BCC mail header when sending email.This is optional and | |
64 | * if the user of the API sets it, then it overrides this default value | |
65 | * @since 6.4M2 | |
66 | */ | |
67 | List<String> getBCCAddresses(); | |
68 | ||
69 | /** | |
70 | * @return the list of additional Java Mail properties (in addition to the host, port, username and from | |
71 | * properties) to use when sending the mail (eg {@code mail.smtp.starttls.enable=true} if TLS should be | |
72 | * used). See <a href="https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html">Java | |
73 | * Mail Properties</a> for the full list of available properties. | |
74 | */ | |
75 | Properties getAdditionalProperties(); | |
76 | ||
77 | /** | |
78 | * @return the full list of Java Mail properties to use when sending the email (this includes the Java Mail | |
79 | * properties for host ({@code mail.smtp.host}), port ({@code mail.smtp.port}), | |
80 | * username ({@code mail.smtp.user}), from {@code mail.smtp.from}) + the all the additional properties | |
81 | * from {@link #getAdditionalProperties()} | |
82 | */ | |
83 | Properties getAllProperties(); | |
84 | ||
85 | /** | |
86 | * @return if true then the SMTP server requires authentication | |
87 | */ | |
88 | boolean usesAuthentication(); | |
89 | ||
90 | /** | |
91 | * @return the hint of the {@link org.xwiki.mail.script.ScriptServicePermissionChecker} component to use to check if a | |
92 | * mail is allowed to be sent or not when using the Mail Sender Script Service API. For example: | |
93 | * "alwaysallow", "programmingrights". | |
94 | * @since 6.4M2 | |
95 | */ | |
96 | String getScriptServicePermissionCheckerHint(); | |
97 | ||
98 | /** | |
99 | * @return the delay to wait between each mail being sent, in milliseconds. This is done to support mail throttling | |
100 | * and not considered a spammer by mail servers. | |
101 | * @since 6.4RC1 | |
102 | */ | |
103 | long getSendWaitTime(); | |
104 | } |