@social-mail/social-mail-web-server 1.7.293 → 1.7.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/smtp/services/WebSiteChannelService.d.ts.map +1 -1
- package/dist/server/smtp/services/WebSiteChannelService.js +5 -2
- package/dist/server/smtp/services/WebSiteChannelService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/server/smtp/services/WebSiteChannelService.ts +7 -3
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import Inject, {
|
|
2
|
+
import Inject, { RegisterSingleton, ServiceObject, ServiceProvider } from "@entity-access/entity-access/dist/di/di.js";
|
|
3
3
|
import SocialMailContext from "../../model/SocialMailContext.js";
|
|
4
4
|
import { cacheFor, ICacheContainer, ObjectCache } from "../../../common/cacheFor.js";
|
|
5
5
|
import MessagingService from "../../services/message-events/MessagingService.js";
|
|
@@ -21,13 +21,13 @@ export default class WebSiteChannelService
|
|
|
21
21
|
|
|
22
22
|
host = host?.toLocaleLowerCase() ?? "localhost";
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const mailboxList = await db.mailboxes.where({ host}, (p) => (x) =>
|
|
25
25
|
x.websiteChannels
|
|
26
26
|
.some((w) => w.website.hosts
|
|
27
27
|
.some((h)=> h.host === p.host)))
|
|
28
28
|
.toArray();
|
|
29
29
|
|
|
30
|
-
const mailboxes =
|
|
30
|
+
const mailboxes = mailboxList.map((x) => x.mailboxID);
|
|
31
31
|
|
|
32
32
|
const domainList = await db.hostedDomains.where({ host }, (p) => (x) =>
|
|
33
33
|
x.websiteChannelDomains
|
|
@@ -37,6 +37,10 @@ export default class WebSiteChannelService
|
|
|
37
37
|
|
|
38
38
|
const domains = domainList.map((x) => x.domainID);
|
|
39
39
|
|
|
40
|
+
if (domains.length === 0 && mailboxes.length === 0) {
|
|
41
|
+
domains.push(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
return {
|
|
41
45
|
mailboxes: mailboxes.length ? mailboxes : void 0,
|
|
42
46
|
domains
|