@stamhoofd/backend 2.80.0 → 2.80.1
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": "@stamhoofd/backend",
|
|
3
|
-
"version": "2.80.
|
|
3
|
+
"version": "2.80.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@simonbackx/simple-encoding": "2.22.0",
|
|
39
39
|
"@simonbackx/simple-endpoints": "1.19.1",
|
|
40
40
|
"@simonbackx/simple-logging": "^1.0.1",
|
|
41
|
-
"@stamhoofd/backend-i18n": "2.80.
|
|
42
|
-
"@stamhoofd/backend-middleware": "2.80.
|
|
43
|
-
"@stamhoofd/email": "2.80.
|
|
44
|
-
"@stamhoofd/models": "2.80.
|
|
45
|
-
"@stamhoofd/queues": "2.80.
|
|
46
|
-
"@stamhoofd/sql": "2.80.
|
|
47
|
-
"@stamhoofd/structures": "2.80.
|
|
48
|
-
"@stamhoofd/utility": "2.80.
|
|
41
|
+
"@stamhoofd/backend-i18n": "2.80.1",
|
|
42
|
+
"@stamhoofd/backend-middleware": "2.80.1",
|
|
43
|
+
"@stamhoofd/email": "2.80.1",
|
|
44
|
+
"@stamhoofd/models": "2.80.1",
|
|
45
|
+
"@stamhoofd/queues": "2.80.1",
|
|
46
|
+
"@stamhoofd/sql": "2.80.1",
|
|
47
|
+
"@stamhoofd/structures": "2.80.1",
|
|
48
|
+
"@stamhoofd/utility": "2.80.1",
|
|
49
49
|
"archiver": "^7.0.1",
|
|
50
50
|
"aws-sdk": "^2.885.0",
|
|
51
51
|
"axios": "1.6.8",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "37793d55487f7e8792d7b97df20750f8bd5be9a3"
|
|
69
69
|
}
|
package/src/crons/amazon-ses.ts
CHANGED
|
@@ -72,14 +72,9 @@ async function handleBounce(message: any) {
|
|
|
72
72
|
)
|
|
73
73
|
) {
|
|
74
74
|
const organization: Organization | undefined = source ? await Organization.getByEmail(source) : undefined;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
await emailAddress.save();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
console.error('[AWS BOUNCES] Unknown organization for email address ' + source);
|
|
82
|
-
}
|
|
75
|
+
const emailAddress = await EmailAddress.getOrCreate(email, organization?.id ?? null);
|
|
76
|
+
emailAddress.hardBounce = true;
|
|
77
|
+
await emailAddress.save();
|
|
83
78
|
|
|
84
79
|
await saveLog({
|
|
85
80
|
id: b.feedbackId,
|
|
@@ -123,44 +118,39 @@ async function handleComplaint(message: any) {
|
|
|
123
118
|
|
|
124
119
|
const type: 'abuse' | 'auth-failure' | 'fraud' | 'not-spam' | 'other' | 'virus' = b.complaintFeedbackType;
|
|
125
120
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (type
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
157
|
-
}
|
|
121
|
+
for (const recipient of b.complainedRecipients) {
|
|
122
|
+
const email = recipient.emailAddress;
|
|
123
|
+
const emailAddress = await EmailAddress.getOrCreate(email, organization?.id ?? null);
|
|
124
|
+
emailAddress.markedAsSpam = type !== 'not-spam';
|
|
125
|
+
await emailAddress.save();
|
|
126
|
+
|
|
127
|
+
if (type !== 'not-spam') {
|
|
128
|
+
if (type === 'virus' || type === 'fraud') {
|
|
129
|
+
await saveLog({
|
|
130
|
+
id: b.feedbackId,
|
|
131
|
+
email: source,
|
|
132
|
+
organization,
|
|
133
|
+
type: AuditLogType.EmailAddressFraudComplaint,
|
|
134
|
+
subType: type || 'unknown',
|
|
135
|
+
sender: source,
|
|
136
|
+
response: recipient.diagnosticCode || '',
|
|
137
|
+
subject: message.mail.commonHeaders?.subject || '',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
await saveLog({
|
|
142
|
+
id: b.feedbackId,
|
|
143
|
+
email: source,
|
|
144
|
+
organization,
|
|
145
|
+
type: AuditLogType.EmailAddressMarkedAsSpam,
|
|
146
|
+
subType: type || 'unknown',
|
|
147
|
+
sender: source,
|
|
148
|
+
response: recipient.diagnosticCode || '',
|
|
149
|
+
subject: message.mail.commonHeaders?.subject || '',
|
|
150
|
+
});
|
|
158
151
|
}
|
|
159
152
|
}
|
|
160
153
|
}
|
|
161
|
-
else {
|
|
162
|
-
console.error('[AWS COMPLAINTS] Unknown organization for email address ' + source);
|
|
163
|
-
}
|
|
164
154
|
|
|
165
155
|
if (type === 'virus' || type === 'fraud') {
|
|
166
156
|
console.error('[AWS COMPLAINTS] Received virus / fraud complaint!');
|
|
@@ -18,7 +18,7 @@ class Query extends AutoEncoder {
|
|
|
18
18
|
|
|
19
19
|
type ResponseBody = EmailAddressSettings;
|
|
20
20
|
|
|
21
|
-
export class
|
|
21
|
+
export class GetEmailAddressEndpoint extends Endpoint<Params, Query, Body, ResponseBody> {
|
|
22
22
|
queryDecoder = Query as Decoder<Query>;
|
|
23
23
|
|
|
24
24
|
protected doesMatch(request: Request): [true, Params] | [false] {
|