forked from cosullivan/SmtpServer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSmtpResponse.cs
More file actions
99 lines (83 loc) · 3.71 KB
/
Copy pathSmtpResponse.cs
File metadata and controls
99 lines (83 loc) · 3.71 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
namespace SmtpServer.Protocol
{
/// <summary>
/// Smtp Response
/// </summary>
public class SmtpResponse
{
/// <summary>
/// 250 Ok
/// </summary>
public static readonly SmtpResponse Ok = new SmtpResponse(SmtpReplyCode.Ok, "Ok");
/// <summary>
/// 220 ServiceReady
/// </summary>
public static readonly SmtpResponse ServiceReady = new SmtpResponse(SmtpReplyCode.ServiceReady, "ready when you are");
/// <summary>
/// 550 MailboxUnavailable
/// </summary>
public static readonly SmtpResponse MailboxUnavailable = new SmtpResponse(SmtpReplyCode.MailboxUnavailable, "mailbox unavailable");
/// <summary>
/// 553 MailboxNameNotAllowed
/// </summary>
public static readonly SmtpResponse MailboxNameNotAllowed = new SmtpResponse(SmtpReplyCode.MailboxNameNotAllowed, "mailbox name not allowed");
/// <summary>
/// 221 ServiceClosingTransmissionChannel
/// </summary>
public static readonly SmtpResponse ServiceClosingTransmissionChannel = new SmtpResponse(SmtpReplyCode.ServiceClosingTransmissionChannel, "bye");
/// <summary>
/// 501 SyntaxError
/// </summary>
public static readonly SmtpResponse SyntaxError = new SmtpResponse(SmtpReplyCode.SyntaxError, "syntax error");
/// <summary>
/// 552 SizeLimitExceeded
/// </summary>
public static readonly SmtpResponse SizeLimitExceeded = new SmtpResponse(SmtpReplyCode.SizeLimitExceeded, "size limit exceeded");
/// <summary>
/// 554 TransactionFailed
/// </summary>
public static readonly SmtpResponse NoValidRecipientsGiven = new SmtpResponse(SmtpReplyCode.TransactionFailed, "no valid recipients given");
/// <summary>
/// 535 AuthenticationFailed
/// </summary>
public static readonly SmtpResponse AuthenticationFailed = new SmtpResponse(SmtpReplyCode.AuthenticationFailed, "authentication failed");
/// <summary>
/// 235 AuthenticationSuccessful
/// </summary>
public static readonly SmtpResponse AuthenticationSuccessful = new SmtpResponse(SmtpReplyCode.AuthenticationSuccessful, "go ahead");
/// <summary>
/// 554 TransactionFailed
/// </summary>
public static readonly SmtpResponse TransactionFailed = new SmtpResponse(SmtpReplyCode.TransactionFailed);
/// <summary>
/// 503 BadSequence
/// </summary>
public static readonly SmtpResponse BadSequence = new SmtpResponse(SmtpReplyCode.BadSequence, "bad sequence of commands");
/// <summary>
/// 530 AuthenticationRequired
/// </summary>
public static readonly SmtpResponse AuthenticationRequired = new SmtpResponse(SmtpReplyCode.AuthenticationRequired, "authentication required");
/// <summary>
/// 552 MaxMessageSizeExceeded
/// </summary>
public static readonly SmtpResponse MaxMessageSizeExceeded = new SmtpResponse(SmtpReplyCode.SizeLimitExceeded, "message size exceeds fixed maximium message size");
/// <summary>
/// Constructor.
/// </summary>
/// <param name="replyCode">The reply code.</param>
/// <param name="message">The reply message.</param>
public SmtpResponse(SmtpReplyCode replyCode, string message = null)
{
ReplyCode = replyCode;
Message = message;
}
/// <summary>
/// Gets the Reply Code.
/// </summary>
public SmtpReplyCode ReplyCode { get; }
/// <summary>
/// Gets the response message.
/// </summary>
public string Message { get; }
}
}