@social-mail/social-mail-web-server 1.9.83 → 1.9.84

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.9.83",
3
+ "version": "1.9.84",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -30,9 +30,9 @@ export default class JsonClient {
30
30
  line += text;
31
31
  }
32
32
  this.socket.write(`${line}\n`, (error) => error && console.error(error));
33
- if (log) {
34
- console.log(line);
35
- }
33
+ // if (log) {
34
+ // console.log(line);
35
+ // }
36
36
  const v: any = await p;
37
37
  if(v?.value) {
38
38
  this.resolveReferences(v, new Map());
@@ -179,7 +179,7 @@ export default class JsonClient {
179
179
  let buffer = null as Buffer;
180
180
  s.on("data", (d) => {
181
181
  try {
182
- console.log(d.toString("utf-8"));
182
+ // console.log(d.toString("utf-8"));
183
183
  for(;;) {
184
184
  const i = d.indexOf(n);
185
185
  if (i === -1) {
@@ -16,7 +16,7 @@ export default class DomainReputationService
16
16
  ms: MessagingService;
17
17
 
18
18
  @localCache()
19
- async checkReputation(domainName: string, from?: string) {
19
+ async checkReputation(domainName: string) {
20
20
  using scope = ServiceProvider.createScope(this);
21
21
  const db = scope.resolve(SocialMailContext);
22
22
 
@@ -33,7 +33,7 @@ export default class DomainReputationService
33
33
 
34
34
  if (failed > 3) {
35
35
  if (failed > (reputation.received / 10)) {
36
- return new SmtpError(`Sender ${domainName} Blocked for 24 Hours from ${from}`, SmtpStatusCodes.SenderBlocked);
36
+ return new SmtpError(`Sender ${domainName} Blocked for 24 Hours`, SmtpStatusCodes.SenderBlocked);
37
37
  }
38
38
  }
39
39
 
@@ -107,8 +107,9 @@ export default class MailReceiverService {
107
107
 
108
108
  const domain = this.fromDomain = this.from.address.split("@",2).pop();
109
109
 
110
- const error = await this.domainReputation.checkReputation(domain, this.from.address);
110
+ const error = await this.domainReputation.checkReputation(domain);
111
111
  if (error) {
112
+ console.error(`Reputation failed for ${this.from.address}`);
112
113
  throw error;
113
114
  }
114
115