forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleEmailEvent.cs
More file actions
225 lines (192 loc) · 6.59 KB
/
SimpleEmailEvent.cs
File metadata and controls
225 lines (192 loc) · 6.59 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
using System;
using System.Collections.Generic;
namespace Amazon.Lambda.SimpleEmailEvents
{
/// <summary>
/// Simple Email Service event
/// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ses-email-receiving
/// </summary>
public class SimpleEmailEvent
{
/// <summary>
/// List of SNS records.
/// </summary>
public IList<SimpleEmailRecord> Records { get; set; }
/// <summary>
/// An SES record.
/// </summary>
public class SimpleEmailRecord
{
/// <summary>
/// The event version.
/// </summary>
public string EventVersion { get; set; }
/// <summary>
/// The event source.
/// </summary>
public string EventSource { get; set; }
/// <summary>
/// The SES message.
/// </summary>
public SimpleEmailService Ses { get; set; }
}
/// <summary>
/// An SES message record.
/// </summary>
public class SimpleEmailService
{
/// <summary>
/// The mail data for the SES message.
/// </summary>
public SimpleEmailMessage Mail { get; set; }
/// <summary>
/// The receipt data for the SES message.
/// </summary>
public SimpleEmailReceipt Receipt { get; set; }
}
/// <summary>
/// The mail data for the SES message.
/// </summary>
public class SimpleEmailMessage
{
/// <summary>
/// A few of the most important headers from the message.
/// </summary>
public SimpleEmailCommonHeaders CommonHeaders { get; set; }
/// <summary>
/// The source email address of the message, i.e. SMTP FROM.
/// </summary>
public string Source { get; set; }
/// <summary>
/// The timestamp of the message.
/// </summary>
public DateTime Timestamp { get; set; }
/// <summary>
/// The destination recipients of the message.
/// </summary>
public IList<string> Destination { get; set; }
/// <summary>
/// The headers associated with the message.
/// </summary>
public IList<SimpleEmailHeader> Headers { get; set; }
/// <summary>
/// Whether or not the Headers property is truncated.
/// </summary>
public bool HeadersTruncated { get; set; }
/// <summary>
/// The SES Message ID, which will also be the filename of the S3 object containing the message. Not to be confused with the incoming message's Message-ID header.
/// </summary>
public string MessageId { get; set; }
}
/// <summary>
/// The receipt data for the SES message.
/// </summary>
public class SimpleEmailReceipt
{
/// <summary>
/// The recipients of the message.
/// </summary>
public IList<string> Recipients { get; set; }
/// <summary>
/// The timestamp of the message.
/// </summary>
public DateTime Timestamp { get; set; }
/// <summary>
/// The spam verdict of the message, e.g. status: PASS.
/// </summary>
public SimpleEmailVerdict SpamVerdict { get; set; }
/// <summary>
/// The DKIM verdict of the message, e.g. status: PASS.
/// </summary>
public SimpleEmailVerdict DKIMVerdict { get; set; }
/// <summary>
/// The SPF verdict of the message, e.g. status: PASS.
/// </summary>
public SimpleEmailVerdict SPFVerdict { get; set; }
/// <summary>
/// The virus verdict of the message, e.g. status: PASS.
/// </summary>
public SimpleEmailVerdict VirusVerdict { get; set; }
/// <summary>
/// The virus verdict of the message, e.g. status: PASS.
/// </summary>
public SimpleEmailReceiptAction Action { get; set; }
/// <summary>
/// How long this incoming message took to process.
/// </summary>
public long ProcessingTimeMillis { get; set; }
}
/// <summary>
/// An SES message header.
/// </summary>
public class SimpleEmailHeader
{
/// <summary>
/// The header name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The header value.
/// </summary>
public string Value { get; set; }
}
}
/// <summary>
/// A few of the most important headers of the message.
/// </summary>
public class SimpleEmailCommonHeaders
{
/// <summary>
/// The From header's address(es)
/// </summary>
public IList<string> From { get; set; }
/// <summary>
/// The To header's address(es)
/// </summary>
public IList<string> To { get; set; }
/// <summary>
/// The Return-Path header.
/// </summary>
public string ReturnPath { get; set; }
/// <summary>
/// The incoming message's Message-ID header. Not to be confused with the SES messageId.
/// </summary>
public string MessageId { get; set; }
/// <summary>
/// The Date header.
/// </summary>
public string Date { get; set; }
/// <summary>
/// The Subject header.
/// </summary>
public string Subject { get; set; }
}
/// <summary>
/// The SES receipt's action.
/// </summary>
public class SimpleEmailReceiptAction
{
/// <summary>
/// The type of the action, e.g. "Lambda"
/// </summary>
public string Type { get; set; }
/// <summary>
/// The type of invocation, e.g. "Event"
/// </summary>
public string InvocationType { get; set; }
/// <summary>
/// The ARN of this function.
/// </summary>
public string FunctionArn { get; set; }
}
/// <summary>
/// Verdict to return status of Spam, DKIM, SPF, and Virus.
/// </summary>
public class SimpleEmailVerdict
{
/// <summary>
/// The verdict status, e.g. PASS or FAIL.
/// </summary>
public string Status { get; set; }
}
}