forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspf-failure-table.js
More file actions
80 lines (78 loc) · 2.47 KB
/
spf-failure-table.js
File metadata and controls
80 lines (78 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import {
GraphQLInt,
GraphQLObjectType,
GraphQLString,
GraphQLBoolean,
} from 'graphql'
import { globalIdField } from 'graphql-relay'
import { guidanceTagType } from '../../guidance-tag/objects'
export const spfFailureTableType = new GraphQLObjectType({
name: 'SpfFailureTable',
description:
'This table contains the data fields for senders who are in the SPF fail category.',
fields: () => ({
id: globalIdField('spfFail'),
dnsHost: {
type: GraphQLString,
description: 'Host from reverse DNS of source IP address.',
resolve: ({ dnsHost }) => dnsHost,
},
envelopeFrom: {
type: GraphQLString,
description: 'Domain from SMTP banner message.',
resolve: ({ envelopeFrom }) => envelopeFrom,
},
guidance: {
type: GraphQLString,
description: 'Guidance for any issues that were found from the report.',
resolve: ({ guidance }) => guidance,
deprecationReason:
'This has been turned into the `guidanceTag` field providing detailed information to act upon if a given tag is present.',
},
guidanceTag: {
type: guidanceTagType,
description: 'Guidance for any issues that were found from the report.',
resolve: async (
{ guidance },
_args,
{ loaders: { loadAggregateGuidanceTagByTagId } },
) => {
if (guidance) {
return await loadAggregateGuidanceTagByTagId.load(guidance)
}
return {}
},
},
headerFrom: {
type: GraphQLString,
description: 'The address/domain used in the "From" field.',
resolve: ({ headerFrom }) => headerFrom,
},
sourceIpAddress: {
type: GraphQLString,
description: 'IP address of sending server.',
resolve: ({ sourceIpAddress }) => sourceIpAddress,
},
spfAligned: {
type: GraphQLBoolean,
description: 'Is SPF aligned.',
resolve: ({ spfAligned }) => spfAligned,
},
spfDomains: {
type: GraphQLString,
description: 'Domains used for SPF validation.',
resolve: ({ spfDomains }) => spfDomains,
},
spfResults: {
type: GraphQLString,
description:
'The results of DKIM verification of the message. Can be pass, fail, neutral, soft-fail, temp-error, or perm-error.',
resolve: ({ spfResults }) => spfResults,
},
totalMessages: {
type: GraphQLInt,
description: 'Total messages from this sender.',
resolve: ({ totalMessages }) => totalMessages,
},
}),
})