mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Add default mail configuration; For bug 77483
This commit is contained in:
@ -38,6 +38,8 @@ const mailService = require('./mailService');
|
|||||||
|
|
||||||
const cfgEditorDataStorage = config.get('services.CoAuthoring.server.editorDataStorage');
|
const cfgEditorDataStorage = config.get('services.CoAuthoring.server.editorDataStorage');
|
||||||
const cfgEditorStatStorage = config.get('services.CoAuthoring.server.editorStatStorage');
|
const cfgEditorStatStorage = config.get('services.CoAuthoring.server.editorStatStorage');
|
||||||
|
const cfgSmtpServerConfiguration = config.get('email.smtpServerConfiguration');
|
||||||
|
const cfgContactDefaults = config.get('email.contactDefaults');
|
||||||
const editorStatStorage = require('./../../DocService/sources/' + (cfgEditorStatStorage || cfgEditorDataStorage));
|
const editorStatStorage = require('./../../DocService/sources/' + (cfgEditorStatStorage || cfgEditorDataStorage));
|
||||||
|
|
||||||
const editorStat = editorStatStorage.EditorStat ? new editorStatStorage.EditorStat() : new editorStatStorage();
|
const editorStat = editorStatStorage.EditorStat ? new editorStatStorage.EditorStat() : new editorStatStorage();
|
||||||
@ -57,11 +59,11 @@ class MailTransport extends TransportInterface {
|
|||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
const mailServerConfig = ctx.getCfg('email.smtpServerConfiguration');
|
const mailServerConfig = ctx.getCfg('email.smtpServerConfiguration', cfgSmtpServerConfiguration);
|
||||||
this.host = mailServerConfig.host;
|
this.host = mailServerConfig.host;
|
||||||
this.port = mailServerConfig.port;
|
this.port = mailServerConfig.port;
|
||||||
this.auth = mailServerConfig.auth;
|
this.auth = mailServerConfig.auth;
|
||||||
const cfgMailMessageDefaults = ctx.getCfg('email.contactDefaults');
|
const cfgMailMessageDefaults = ctx.getCfg('email.contactDefaults', cfgContactDefaults);
|
||||||
|
|
||||||
mailService.createTransporter(ctx, this.host, this.port, this.auth, cfgMailMessageDefaults);
|
mailService.createTransporter(ctx, this.host, this.port, this.auth, cfgMailMessageDefaults);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user