@social-mail/social-mail-web-server 1.11.21 → 1.11.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.11.21",
3
+ "version": "1.11.23",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -41,11 +41,11 @@ export default class FileVersionService {
41
41
 
42
42
  if ( /text\//i.test(file.contentType)) {
43
43
  const rootFolders = file.path.split("/").filter((x) => x && x !== file.appFileID.toString()) as any[];
44
- console.log(`Updating sites ${rootFolders.join(",")}`);
44
+ console.log(`Updating sites ${rootFolders.join(",")} for user ${user.userID}`);
45
45
  await db.websiteFolders.where({ rootFolders }, (x, p) => Sql.in(x.folderID, p.rootFolders))
46
46
  // .trace((x) => console.log(`Updating site ${rootFolders.join(",")} ${x}`))
47
47
  .update(user, (x, p) => ({
48
- lastModifiedByUserID: p.userID,
48
+ lastModifiedByUserID: Sql.cast.asBigInt(p.userID),
49
49
  isModified: true,
50
50
  lastModified: Sql.date.now()
51
51
  }));
@@ -80,6 +80,7 @@ export default class MailReceiverService {
80
80
  // private sender: EmailAddress;
81
81
 
82
82
  private recipients: Map<string, Mailbox>;
83
+ private domain: string;
83
84
 
84
85
  async start(session: smtpServer.SMTPServerSession) {
85
86
  this.session = session;
@@ -106,12 +107,7 @@ export default class MailReceiverService {
106
107
  this.from = address;
107
108
 
108
109
  const domain = this.fromDomain = this.from.address.split("@",2).pop();
109
-
110
- const error = await this.domainReputation.checkReputation(domain);
111
- if (error) {
112
- console.error(`Reputation failed for ${this.from.address}`);
113
- throw error;
114
- }
110
+ this.domain = domain;
115
111
 
116
112
  // const mailbox = await this.emailAddressService.getHostedMailboxByAddress(address.address);
117
113
  // if (mailbox && !mailbox.isExternal) {
@@ -237,6 +233,15 @@ export default class MailReceiverService {
237
233
  throw new SmtpError("Content not acceptable", SmtpStatusCodes.DeliveryNotPermitted);
238
234
  }
239
235
 
236
+ const { domain } = this;
237
+
238
+ const error = await this.domainReputation.checkReputation(domain);
239
+ if (error) {
240
+ const recipients = Array.from(this.recipients.keys()).join();
241
+ console.error(`Reputation failed for ${this.from.address} rcpt to ${recipients}`);
242
+ throw error;
243
+ }
244
+
240
245
  // store file locally somewhere...
241
246
  const tempFile = await this.tempFileService.createTempFile(".eml");
242
247
  await fsp.writeFile(tempFile.path, stream);