-
-
Notifications
You must be signed in to change notification settings - Fork 345
Expand file tree
/
Copy pathSmtp4DevConfiguration.cs
More file actions
118 lines (107 loc) · 5.21 KB
/
Smtp4DevConfiguration.cs
File metadata and controls
118 lines (107 loc) · 5.21 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
namespace TestContainers.Smtp4Dev;
/// <inheritdoc cref="ContainerConfiguration" />
[PublicAPI]
public class Smtp4DevConfiguration : ContainerConfiguration
{
/// <summary>
/// Initializes a new instance of the <see cref="Smtp4DevConfiguration" /> class.
/// </summary>
/// <param name="lockSettings">Locks settings form being changed by user via web interface.</param>
/// <param name="basePath">
/// Specifies the virtual path from web server root where SMTP4DEV web interface will be hosted. e.g. "/" or
/// "/smtp4dev".
/// </param>
/// <param name="database">
/// Specifies the path where the database will be stored relative to APPDATA env var on Windows or XDG_CONFIG_HOME
/// on non-Windows. Specify "" to use an in memory database.
/// </param>
/// <param name="numberOfMessagesToKeep">Specifies the number of messages to keep per mailbox.</param>
/// <param name="numberOfSessionsToKeep">Specifies the number of sessions to keep.</param>
/// <param name="disableMessageSanitisations">
/// Disables message HTML sanitisation. Dangerous if your messages are not generated by you and not reflective of
/// how messages might render in most email clients.
/// </param>
public Smtp4DevConfiguration(
bool? lockSettings = null,
string basePath = null,
string database = null,
int? numberOfMessagesToKeep = null,
int? numberOfSessionsToKeep = null,
bool? disableMessageSanitisations = null)
{
LockSettings = lockSettings;
BasePath = basePath;
Database = database;
NumberOfMessagesToKeep = numberOfMessagesToKeep;
NumberOfSessionsToKeep = numberOfSessionsToKeep;
DisableMessageSanitisations = disableMessageSanitisations;
}
/// <summary>
/// Initializes a new instance of the <see cref="Smtp4DevConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public Smtp4DevConfiguration(IResourceConfiguration<CreateContainerParameters> resourceConfiguration)
: base(resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}
/// <summary>
/// Initializes a new instance of the <see cref="Smtp4DevConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public Smtp4DevConfiguration(IContainerConfiguration resourceConfiguration)
: base(resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}
/// <summary>
/// Initializes a new instance of the <see cref="Smtp4DevConfiguration" /> class.
/// </summary>
/// <param name="resourceConfiguration">The Docker resource configuration.</param>
public Smtp4DevConfiguration(Smtp4DevConfiguration resourceConfiguration)
: this(new Smtp4DevConfiguration(), resourceConfiguration)
{
// Passes the configuration upwards to the base implementations to create an updated immutable copy.
}
/// <summary>
/// Initializes a new instance of the <see cref="Smtp4DevConfiguration" /> class.
/// </summary>
/// <param name="oldValue">The old Docker resource configuration.</param>
/// <param name="newValue">The new Docker resource configuration.</param>
public Smtp4DevConfiguration(Smtp4DevConfiguration oldValue, Smtp4DevConfiguration newValue)
: base(oldValue, newValue)
{
LockSettings = BuildConfiguration.Combine(oldValue.LockSettings, newValue.LockSettings);
BasePath = BuildConfiguration.Combine(oldValue.BasePath, newValue.BasePath);
Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database);
NumberOfMessagesToKeep = BuildConfiguration.Combine(oldValue.NumberOfMessagesToKeep, newValue.NumberOfMessagesToKeep);
NumberOfSessionsToKeep = BuildConfiguration.Combine(oldValue.NumberOfSessionsToKeep, newValue.NumberOfSessionsToKeep);
DisableMessageSanitisations = BuildConfiguration.Combine(oldValue.DisableMessageSanitisations, newValue.DisableMessageSanitisations);
}
/// <summary>
/// Gets whether settings can be changed by user via web interface.
/// </summary>
public bool? LockSettings { get; }
/// <summary>
/// Gets the virtual path from web server root where SMTP4DEV web interface will be hosted. e.g. "/" or
/// "/smtp4dev".
/// </summary>
public string BasePath { get; }
/// <summary>
/// Gets the path where the database will be stored relative to APPDATA env var on Windows or XDG_CONFIG_HOME
/// on non-Windows. Specify "" to use an in memory database.
/// </summary>
public string Database { get; }
/// <summary>
/// Gets the number of messages to keep per mailbox.
/// </summary>
public int? NumberOfMessagesToKeep { get; }
/// <summary>
/// Gets the number of sessions to keep.
/// </summary>
public int? NumberOfSessionsToKeep { get; }
/// <summary>
/// Gets whether message HTML sanitisation is disabled.
/// </summary>
public bool? DisableMessageSanitisations { get; }
}