Skip to content

Commit a523664

Browse files
committed
fix: try fixing appsettings.json error
1 parent fd3faf2 commit a523664

1 file changed

Lines changed: 72 additions & 118 deletions

File tree

Rnwood.Smtp4dev/appsettings.json

Lines changed: 72 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,27 @@
2525

2626

2727
"ServerOptions": {
28-
2928
// Locks settings from being changed by user via web interface
3029
// Default value: false
3130
"LockSettings": false,
32-
3331
// The URLs the web interface should listen on.
3432
// For example, http://localhost:123.
3533
// Use `*` in place of hostname to listen for requests on any IP address or hostname using the specified port and protocol (for example, http://*:5000).
3634
// Separate multiple values with ;
3735
"Urls": "http://localhost:5000",
38-
3936
// Specifies the virtual path from web server root where SMTP4DEV web interface will be hosted. e.g. "/" or "/smtp4dev"
4037
// Default value: "/"
4138
"BasePath": "/",
42-
4339
// Specifies the server hostname. Used in auto-generated TLS certificate for SMTP if enabled.
4440
// Default value: <DNS name of machine>
4541
//"HostName": "localhost",
4642

4743
// Set the port the SMTP server listens on. Specify 0 to assign automatically
4844
// Default value: 25
4945
"Port": 25,
50-
5146
// Specifies if remote connections will be allowed to the SMTP and IMAP servers
5247
// Default value: true
5348
"AllowRemoteConnections": true,
54-
5549
// Specifies the IP address to bind to for SMTP and IMAP servers.
5650
// If not specified, the behavior is determined by AllowRemoteConnections:
5751
// - When AllowRemoteConnections is true: binds to all interfaces (0.0.0.0 for IPv4, :: for IPv6)
@@ -64,77 +58,61 @@
6458
// If true, SMTP and IMAP servers will NOT listen using IPv6 Dual Stack (both IPv4 and IPV6)
6559
// When using port 0 (automatic), different port numbers may be assigned for IPv4 and IPv6 loopback if allow remote connections option is off.
6660
"DisableIPv6": false,
67-
6861
// 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.
6962
// Default value: "database.db"
7063
"Database": "database.db",
71-
7264
// Specifies the number of messages to keep per mailbox
7365
// Default value: 100
7466
"NumberOfMessagesToKeep": 100,
75-
7667
// Specifies the number of sessions to keep
7768
// Default value: 100
7869
"NumberOfSessionsToKeep": 100,
79-
8070
// Specifies the TLS mode to use for SMTP. Valid options are: None, StartTls or ImplicitTls.
8171
// Default value: "None"
8272
"TlsMode": "None",
83-
8473
// Specifies the SSL/TLS protocol version(s) that will be allowed.
8574
//Separate multiple values with commas.
8675
// See https://learn.microsoft.com/en-us/dotnet/api/system.security.authentication.sslprotocols?view=net-9.0
8776
// Default value:
8877
// Note that empty string singifies those decided by the OS.
8978
"SslProtocols": "",
90-
9179
//Specifies the TLS cipher suites to be allowed. Not supported on Windows.
9280
//Separate multiple values with commas.
9381
//See https://learn.microsoft.com/en-us/dotnet/api/system.net.security.tlsciphersuite?view=net-9.0
9482
//Default value:
9583
//Empty string signifies to use the defaults.
9684
"TlsCipherSuites": "",
97-
9885
// Specifies a thumbprint to load a certificate from the computer's store. Specify "" to not load from the store, and follow configuration from TlsCertificate
9986
// Default value: ""
10087
// This must be an X509 certificate. Note: the user needs to have read access, under "All Tasks > Manage Private Keys" in the certificate MMC snap-in. With IIS, the user will be "II USRS\<Application Pool Name>"
10188
"TlsCertificateStoreThumbprint": "",
102-
10389
// Specifies the file containing TLS certificate to use for SMTP if TLS is enabled/requested. Specify "" to use an auto-generated self-signed certificate (then see console output on first startup)
10490
// Default value: ""
10591
// This must be an X509 certificate - generally a .CER, .CRT or .PFX file. If using .CER or .CRT, you must provide the private key separately using TlsCertificatePrivateKey.
10692
"TlsCertificate": "",
107-
10893
//Specifies the corresponding private key file for the SMTP TLS certificate if the private key is not part of the TlsCertificate file.
10994
//This must be in PEM format - generally a .KEY file.
11095
"TlsCertificatePrivateKey": "",
111-
11296
//Specifies the password for the SMTP TLSCertificate/TlsCertificatePrivateKey. Specify "" if the certificate is not password-protected.
11397
//Default value: ""
11498
"TlsCertificatePassword": "",
115-
11699
// Specify location of the Certificate private .key file for SMTP. Ignored if TlsCertificate is blank.
117100
//"TlsCertificatePrivateKey": "",
118101

119102
// Specifies the port the IMAP server will listen on - allows standard email clients to view/retrieve messages
120103
"ImapPort": 143,
121-
122104
//Disables message HTML sanitisation. Dangerous if your messages are not generated by you
123105
//and not reflective of how messages might render in most email client.
124106
//Default value: false
125107
"DisableMessageSanitisation": false,
126-
127108
// True if SMTP and IMAP will require authentication
128109
// The client will recieve an error if a message is attempted without authentication.
129110
// See 'Users'
130111
"AuthenticationRequired": false,
131-
132-
133112
// True if the SMTP server will allow any credentials to be used without checking them again the 'Users'.
134113
// If false credentials must match one of the users.
135114
// 'AuthenticationRequired' must be on or the server will not enforce that authentication takes place.
136115
"SmtpAllowAnyCredentials": true,
137-
138116
// Controls which auth mechanisms are allowed for SMTP when connection is not using SSL/TLS
139117
// Note that real SMTP servers will likely allow zero auth mechanisms until the connection is upgraded using STARTTLS.
140118
// Values are:
@@ -143,14 +121,11 @@
143121
// LOGIN
144122
// XOAUTH2
145123
"SmtpEnabledAuthTypesWhenNotSecureConnection": "PLAIN,LOGIN,CRAM-MD5",
146-
147124
// Controls which auth mechanisms are allowed for SMTP when connection is using SSL/TLS
148125
"SmtpEnabledAuthTypesWhenSecureConnection": "PLAIN,LOGIN,CRAM-MD5",
149-
150126
// True if the SMTP session will require a secure connection.
151127
// The client will recieve an error if a message is attempted without TLS - this must be enabled separately.
152128
"SecureConnectionRequired": false,
153-
154129
// A JavaScript expression used to validate credentials
155130
// The return value is a boolean value where true will accept the credentials.
156131
// The variable `credentials` refers to the credentials that were presented. See:
@@ -160,7 +135,6 @@
160135
// Examples:
161136
// credentials.Type == 'USERNAME_PASSWORD' && credentials.username == 'rob' && credentials.password == 'pass'
162137
"CredentialsValidationExpression": "",
163-
164138
// A JavaScript expression used to validate recipients
165139
// The return value is a boolean value where true will accept the recipient.
166140
// The variable 'recipient' refers to the current recipient (one call per recipient)
@@ -174,7 +148,6 @@
174148
// recipient != "foo@bar.com"
175149
// - Rejects this recipient only
176150
"RecipientValidationExpression": "",
177-
178151
// A JavaScript expression used to validate message to determine if the server will accept it.
179152
// The return value is a boolean value where true will accept the message.
180153
//If the return value is a number it will be used as response code
@@ -191,7 +164,6 @@
191164
// message.subject.includes("19") ? 441 : null
192165
// - Rejects messages that include 19 with a 441, otherwise accepts
193166
"MessageValidationExpression": "",
194-
195167
//A JavaScript expression used to validate commands and allowing you to change the response.
196168
//The return value is a boolean value where true will accept the command.
197169
//If the return value is a number it will be used as response code
@@ -209,15 +181,12 @@
209181
// - Rejects "HELO rob" with a custom error
210182
//
211183
"CommandValidationExpression": "",
212-
213184
//True if web interface and API will need BASIC auth.
214185
//See 'Users'
215186
"WebAuthenticationRequired": false,
216-
217187
//True if the mailbox recipient filter should be ignored for authenticated smtp sessions and messages should be
218188
// delivered to the user's default mailbox instead
219189
"DeliverMessagesToUsersDefaultMailbox": true,
220-
221190
//List of users for SMTP, IMAP and web interface
222191
//DefaultMailbox is name of mailbox that user will get via IMAP
223192
"Users": [
@@ -227,7 +196,6 @@
227196
// "DefaultMailbox": "Sales"
228197
//}
229198
],
230-
231199
//List of mailboxes
232200
//Order is important. Each recipient is processed separately and first match gets the message for that recipient.
233201
//The message will only be delivered once to each mailbox.
@@ -253,108 +221,94 @@
253221
// "Recipients": "*"
254222
//}
255223
],
256-
257224
// Defines the config used for HTML validation
258225
// See https://html-validate.org/usage/index.html#configuration
259226
"HtmlValidateConfig": "{ \"$schema\": \"https://html-validate.org/schemas/config.json\", \"extends\": [ \"html-validate:recommended\" ]}",
260-
261227
// Disables HTML validation entirely when true. Useful for large HTML emails that generate many warnings and impact UI performance.
262228
// Default value: false
263229
"DisableHtmlValidation": false,
264-
265230
// Disables HTML compatibility checks entirely when true. Useful for large HTML emails that generate many warnings and impact UI performance.
266231
// Default value: false
267232
"DisableHtmlCompatibilityCheck": false,
268-
269233
// The MaxMessageSize option configures the SIZE header
270234
// The SIZE extension is always enabled, this option merely configures an maximum message size (in bytes) that is accepted by the server.
271235
// When the option is non-negative, the optional parameter is added to the SIZE header (i.e. SIZE=12345).
272236
// Otherwise the optional parameter is omitted.
273237
"MaxMessageSize": null
274238
},
275-
276-
"RelayOptions": {
277-
278-
// Sets the name of the SMTP server that will be used to relay messages or \"\" if messages relay should not be allowed
279-
// Default value: ""
280-
"SmtpServer": "",
281-
282-
// Sets the port number for the SMTP server used to relay messages.
283-
// Default value: 25
284-
"SmtpPort": 25,
285-
286-
// Sets the TLS mode when connecting to relay SMTP server
287-
// See: http://www.mimekit.net/docs/html/T_MailKit_Security_SecureSocketOptions.htm
288-
// Default value: Auto
289-
"TlsMode": "Auto",
290-
291-
// Specifies a list of recipient addresses for which messages will be relayed automatically. An empty list means that no messages are relayed.
292-
// Default value: []
293-
"AutomaticEmails": [],
294-
295-
// A JavaScript expression that determines if the message should be relayed automatically to the specified recipient.
296-
// The return value should be a string or array of strings with the overriden recipients.
297-
// As a shortcut, true can be returned and the original recpient will be used
298-
// The variable 'recipient' refers to the current recipient (one call per recipient)
299-
// The variable `message` refers to the the current messgage:
300-
// For available properties see https://github.com/rnwood/smtp4dev/blob/master/Rnwood.Smtp4dev/ApiModel/Message.cs
301-
// The variable `session` refers to the the current session:
302-
// For available properties see https://github.com/rnwood/smtp4dev/blob/master/Rnwood.Smtp4dev/ApiModel/Session.cs
303-
//
304-
// Examples:
305-
// message.subject.includes('QP')
306-
// - If message includes QP in the subject then relay to original recipient
307-
// recipient.replace(/@mailinator.com$/,'@smtp4dev.com')
308-
// - Relay all messages to their original recipient except those to @mailinator.com, which are relayed instead to @smtp4dev.com
309-
// message.subject.includes('QP') ? 'newrecip@test.com' : null
310-
// - If message includes QP in the subject then relay to newrecip@test.com, otherwise don't relay
311-
// message.subject.includes('QP') ? 'newrecip@test.com' : recipient
312-
// - If message includes QP in the subject then relay to newrecip@test.com, otherwise relay to original recpient
313-
"AutomaticRelayExpression": "",
314-
315-
// Specifies the address used in MAIL FROM when relaying messages. (Sender address in message headers is left unmodified). The sender of each message is used if not specified.
316-
// Default value: ""
317-
"SenderAddress": "",
318-
319-
// The username for the SMTP server used to relay messages. If \"\" no authentication is attempted.
320-
// Default value: ""
321-
"Login": "",
322-
323-
// The password for the SMTP server used to relay messages
324-
"Password": ""
325-
},
326-
327-
//Settings used by Rnwood.Smtp4dev.Desktop only
328-
"DesktopSettings": {
329-
//True if app will minimise to notification icon.
330-
"MinimiseToTrayIcon": true
239+
"RelayOptions": {
240+
// Sets the name of the SMTP server that will be used to relay messages or \"\" if messages relay should not be allowed
241+
// Default value: ""
242+
"SmtpServer": "",
243+
// Sets the port number for the SMTP server used to relay messages.
244+
// Default value: 25
245+
"SmtpPort": 25,
246+
// Sets the TLS mode when connecting to relay SMTP server
247+
// See: http://www.mimekit.net/docs/html/T_MailKit_Security_SecureSocketOptions.htm
248+
// Default value: Auto
249+
"TlsMode": "Auto",
250+
// Specifies a list of recipient addresses for which messages will be relayed automatically. An empty list means that no messages are relayed.
251+
// Default value: []
252+
"AutomaticEmails": [],
253+
// A JavaScript expression that determines if the message should be relayed automatically to the specified recipient.
254+
// The return value should be a string or array of strings with the overriden recipients.
255+
// As a shortcut, true can be returned and the original recpient will be used
256+
// The variable 'recipient' refers to the current recipient (one call per recipient)
257+
// The variable `message` refers to the the current messgage:
258+
// For available properties see https://github.com/rnwood/smtp4dev/blob/master/Rnwood.Smtp4dev/ApiModel/Message.cs
259+
// The variable `session` refers to the the current session:
260+
// For available properties see https://github.com/rnwood/smtp4dev/blob/master/Rnwood.Smtp4dev/ApiModel/Session.cs
261+
//
262+
// Examples:
263+
// message.subject.includes('QP')
264+
// - If message includes QP in the subject then relay to original recipient
265+
// recipient.replace(/@mailinator.com$/,'@smtp4dev.com')
266+
// - Relay all messages to their original recipient except those to @mailinator.com, which are relayed instead to @smtp4dev.com
267+
// message.subject.includes('QP') ? 'newrecip@test.com' : null
268+
// - If message includes QP in the subject then relay to newrecip@test.com, otherwise don't relay
269+
// message.subject.includes('QP') ? 'newrecip@test.com' : recipient
270+
// - If message includes QP in the subject then relay to newrecip@test.com, otherwise relay to original recpient
271+
"AutomaticRelayExpression": "",
272+
// Specifies the address used in MAIL FROM when relaying messages. (Sender address in message headers is left unmodified). The sender of each message is used if not specified.
273+
// Default value: ""
274+
"SenderAddress": "",
275+
// The username for the SMTP server used to relay messages. If \"\" no authentication is attempted.
276+
// Default value: ""
277+
"Login": "",
278+
// The password for the SMTP server used to relay messages
279+
"Password": ""
280+
},
281+
//Settings used by Rnwood.Smtp4dev.Desktop only
282+
"DesktopSettings": {
283+
//True if app will minimise to notification icon.
284+
"MinimiseToTrayIcon": true
285+
},
286+
"Serilog": {
287+
"Using": [
288+
"Serilog",
289+
"Serilog.Sinks.Console"
290+
],
291+
"MinimumLevel": {
292+
"Default": "Information",
293+
"Override": {
294+
// For detailed diagnostics set to Information
295+
"Microsoft": "Warning",
296+
"Microsoft.EntityFrameworkCore": "Warning"
297+
}
331298
},
332-
333-
"Serilog": {
334-
"Using": [ "Serilog", "Serilog.Sinks.Console" ],
335-
"MinimumLevel": {
336-
"Default": "Information",
337-
"Override": {
338-
// For detailed diagnostics set to Information
339-
"Microsoft": "Warning",
340-
"Microsoft.EntityFrameworkCore": "Warning"
299+
"WriteTo": [
300+
{
301+
"Name": "Console",
302+
"args": {
303+
"outputTemplate": "{Message:lj}{NewLine}{Exception}"
341304
}
342-
},
343-
"WriteTo": [
344-
{
345-
"Name": "Console",
346-
"args": {
347-
"outputTemplate": "{Message:lj}{NewLine}{Exception}"
348-
}
349-
}
350-
],
351-
"Properties": {
352-
"ApplicationName": "Smtp4Dev"
353305
}
354-
},
355-
"ClientOptions": {
356-
"PageSize": 30
306+
],
307+
"Properties": {
308+
"ApplicationName": "Smtp4Dev"
357309
}
358-
359-
360-
}
310+
},
311+
"ClientOptions": {
312+
"PageSize": 30
313+
}
314+
}

0 commit comments

Comments
 (0)