Skip to content
Snippets Groups Projects
Commit ffd7bc9f authored by gnaegi's avatar gnaegi
Browse files

OO-275 different mail configurations

parent b60af4dd
No related branches found
No related tags found
No related merge requests found
Showing
with 35 additions and 20 deletions
......@@ -60,8 +60,15 @@ smtp.pwd=
fromemail=no-reply@your.domain
# set this email to a mail address in your domain (used as reply-to address)
adminemail=webmaster@your.domain
# set this email to a mail address in your domain (for RS-reports)
# set this email to a mail address in your domain (used for 'ask for help here' type of messages that do not have special address)
supportemail=${adminemail}
# set this email to a mail address in your domain (used to tell users how to apply for more quote disk space)
quotaemail=${supportemail}
# set this email to a mail address in your domain (used to notify when users are deleted from the system)
deleteuseremail=${supportemail}
# set this email to a mail address in your domain (used for red-screen error reports)
erroremail=${adminemail}
########################################################################
# OLAT identity settings
......
......@@ -150,8 +150,8 @@ public class BulkDeleteController extends BasicController {
String subject = translate("mail.subject");
String body = getTranslator().translate("mail.body", bodyArgs);
ContactList cl = new ContactList(WebappHelper.getMailConfig("mailSupport"));
cl.add(WebappHelper.getMailConfig("mailSupport"));
ContactList cl = new ContactList(WebappHelper.getMailConfig("mailDeleteUser"));
cl.add(WebappHelper.getMailConfig("mailDeleteUser"));
cl.add(ureq.getIdentity());
List<ContactList> lstAddrTO = new ArrayList<ContactList>();
lstAddrTO.add(cl);
......
......@@ -148,7 +148,7 @@ public class CalendarFileUploadController extends BasicController {
// exceeded UL limit
Tracing.logWarn("IOException in CalendarFileUploadController: ", ioe, this.getClass());
String slimitKB = String.valueOf(fileUploadLimit);
String supportAddr = WebappHelper.getMailConfig("mailSupport");//->{0} für e-mail support e-mail adresse
String supportAddr = WebappHelper.getMailConfig("mailQuota");//->{0} für e-mail support e-mail adresse
getWindowControl().setError(translator.translate("cal.import.form.limit.error", new String[] { slimitKB, supportAddr }));
return;
} catch (OLATRuntimeException e) {
......
......@@ -225,7 +225,7 @@ public class FileChooseCreateEditController extends BasicController{
mainPanel.pushContent(uploadComp);
fileChooser.put(mainPanel.getComponentName(), mainPanel);
} else { // quota exceeded or no valid upload comp.
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
String msg = translate("QuotaExceededSupport", new String[] { supportAddr });
myContent.contextPut("quotaover", msg);
fileChooser.contextPut("quotaover", msg);
......
......@@ -733,7 +733,7 @@ public class FileUploadController extends FormBasicController {
*/
public void setMaxUploadSizeKB(int uploadLimitKB) {
this.uploadLimitKB = uploadLimitKB;
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
fileEl.setMaxUploadSizeKB(uploadLimitKB, "ULLimitExceeded", new String[] { Formatter.roundToString((uploadLimitKB+0f) / 1000, 1), supportAddr });
}
......@@ -822,7 +822,7 @@ public class FileUploadController extends FormBasicController {
if (remainingQuotKB != -1) {
if (fileEl.getUploadFile().length() / 1024 > remainingQuotKB) {
fileEl.clearError();
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
getWindowControl().setError(translate("ULLimitExceeded", new String[] { Formatter.roundToString((uploadLimitKB+0f) / 1000, 1), supportAddr }));
return false;
}
......
......@@ -63,7 +63,7 @@ public class CmdCopyFile extends BasicController implements FolderCommand {
//check for quota
long quotaLeft = VFSManager.getQuotaLeftKB(folderComponent.getCurrentContainer());
if (quotaLeft < -2) {
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
String msg = translate("QuotaExceededSupport", new String[] { supportAddr });
getWindowControl().setError(msg);
return null;
......
......@@ -108,7 +108,7 @@ public class CmdCreateFile extends BasicController implements FolderCommand {
//check for quota
long quotaLeft = VFSManager.getQuotaLeftKB(folderComponent.getCurrentContainer());
if (quotaLeft <= 0 && quotaLeft != -1 ) {
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
String msg = translate("QuotaExceededSupport", new String[] { supportAddr });
this.getWindowControl().setError(msg);
return null;
......
......@@ -150,7 +150,7 @@ public class CmdUpload extends BasicController implements FolderCommand {
//if folder full show error msg
if (remainingQuotaKB == 0 ) {
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
String msg = translate("QuotaExceededSupport", new String[] { supportAddr });
getWindowControl().setError(msg);
return null;
......
......@@ -86,7 +86,7 @@ public class ErrorFeedbackMailer implements Dispatcher {
out.append(iter.next());
}
}
String to = WebappHelper.getMailConfig("mailSupport");
String to = WebappHelper.getMailConfig("mailError");
String subject = "Feedback from Error Nr.: " + errorNr;
String body = feedback + "\n------------------------------------------\n\n --- from user: " + username
+ " ---" + out.toString();
......@@ -102,7 +102,7 @@ public class ErrorFeedbackMailer implements Dispatcher {
private void handleException(HttpServletRequest request, Exception e) {
String feedback = request.getParameter("textarea");
String username = request.getParameter("username");
Tracing.logError("Error sending error feedback mail to olat support (" + WebappHelper.getMailConfig("mailSupport") + ") from: "
Tracing.logError("Error sending error feedback mail to OpenOLAT error support (" + WebappHelper.getMailConfig("mailError") + ") from: "
+ username + " with content: " + feedback, e, this.getClass());
}
......
......@@ -189,7 +189,7 @@ public class ExceptionWindowController extends DefaultChiefController {
msg.contextPut("detailedmessage", detailedmessage);
// Cluster NodeId + E-Nr
msg.contextPut("errnum", Settings.getNodeInfo() + "-E"+ refNum);
msg.contextPut("supportaddress", WebappHelper.getMailConfig("mailSupport"));
msg.contextPut("supportaddress", WebappHelper.getMailConfig("mailError"));
msg.contextPut("time", formatter.formatDateAndTime(new Date()));
WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("errormessagewindow", this);
......
......@@ -162,7 +162,7 @@ class FeedFormController extends FormBasicController {
Long remainingQuotaKb = feedQuota.getRemainingSpace();
if (remainingQuotaKb != -1 && newFile.length() / 1024 > remainingQuotaKb) {
unsetImage();
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
Long uploadLimitKB = feedQuota.getUlLimitKB();
getWindowControl().setError(translate("ULLimitExceeded", new String[] { Formatter.roundToString(uploadLimitKB.floatValue() / 1024f, 1), supportAddr }));
}
......@@ -293,7 +293,7 @@ class FeedFormController extends FormBasicController {
file.limitToMimeType(mimeTypes, "feed.form.file.type.error.images", null);
int maxFileSizeKB = feedQuota.getUlLimitKB().intValue();
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
file.setMaxUploadSizeKB(maxFileSizeKB, "ULLimitExceeded", new String[]{ new Long(maxFileSizeKB / 1024).toString(), supportAddr });
// if external feed, display feed-url text-element:
......
......@@ -196,7 +196,7 @@ public class EpisodeFormController extends FormBasicController {
Quota feedQuota = baseDir.getLocalSecurityCallback().getQuota();
Long remainingQuotaKb = feedQuota.getRemainingSpace();
if (remainingQuotaKb != -1 && file.getUploadFile().length() / 1024 > remainingQuotaKb) {
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
Long uploadLimitKB = feedQuota.getUlLimitKB();
getWindowControl().setError(translate("ULLimitExceeded", new String[] { Formatter.roundToString(uploadLimitKB.floatValue() / 1024f, 1), supportAddr }));
}
......@@ -267,7 +267,7 @@ public class EpisodeFormController extends FormBasicController {
file.addActionListener(this, FormEvent.ONCHANGE);
if(baseDir.getLocalSecurityCallback() != null && baseDir.getLocalSecurityCallback().getQuota() != null) {
Long uploadLimitKB = baseDir.getLocalSecurityCallback().getQuota().getUlLimitKB();
String supportAddr = WebappHelper.getMailConfig("mailSupport");
String supportAddr = WebappHelper.getMailConfig("mailQuota");
file.setMaxUploadSizeKB(uploadLimitKB.intValue(), "ULLimitExceeded", new String[] { Formatter.roundToString((uploadLimitKB.floatValue()) / 1024f, 1), supportAddr });
}
......
......@@ -79,7 +79,7 @@ public class DeletionModule extends AbstractOLATModule {
*/
public void init() {
archiveRootPath = getStringConfigParameter(CONF_ARCHIVE_ROOT_PATH, System.getProperty("java.io.tmpdir") + File.separator+"olatdata"+File.separator + "deleted_archive", false);
emailResponseTo = getStringConfigParameter(CONF_DELETE_EMAIL_RESPONSE_TO_USER_NAME, WebappHelper.getMailConfig("mailSupport"), false);
emailResponseTo = getStringConfigParameter(CONF_DELETE_EMAIL_RESPONSE_TO_USER_NAME, WebappHelper.getMailConfig("mailDeleteUser"), false);
if (!emailResponseTo.contains("@")) {
Identity identity = baseSecurityManager.findIdentityByName(emailResponseTo);
......
......@@ -24,6 +24,9 @@
<entry key="mailFrom" value="${fromemail}"/>
<entry key="mailReplyTo" value="${adminemail}"/>
<entry key="mailSupport" value="${supportemail}"/>
<entry key="mailQuota" value="${quotaemail}"/>
<entry key="mailDeleteUser" value="${deleteuseremail}"/>
<entry key="mailError" value="${erroremail}"/>
<entry key="mailAttachmentMaxSize" value="${mail.attachment.maxsize}"/>
</map>
</property>
......
......@@ -110,9 +110,14 @@ smtp.sslCheckCertificate=false
fromemail=no-reply@your.domain
# set this email to a mail address in your domain (used as reply-to address)
adminemail=webmaster@your.domain
# set this email to a mail address in your domain (for RS-reports)
# set this email to a mail address in your domain (used for 'ask for help here' type of messages that do not have special address)
supportemail=${adminemail}
# set this email to a mail address in your domain (used to tell users how to apply for more quote disk space)
quotaemail=${supportemail}
# set this email to a mail address in your domain (used to notify when users are deleted from the system)
deleteuseremail=${supportemail}
# set this email to a mail address in your domain (used for red-screen error reports)
erroremail=${adminemail}
# maximum size for email attachements (in MB)
mail.attachment.maxsize=5
# if mail intern is enabled you must make sure, that your mysql-db accepts large packets to also save the attachments:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment