Skip to content

Commit

Permalink
chore(config): Improve docs for SMTP TLS cert file options and requir…
Browse files Browse the repository at this point in the history
…ements. (#1459)
  • Loading branch information
rnwood authored May 5, 2024
1 parent 536def0 commit 2815229
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Rnwood.Smtp4dev/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public static MapOptions<CommandLineOptions> TryParseCommandLine(IEnumerable<str
{ "messagestokeep=", "Specifies the number of messages to keep per mailbox", data => map.Add(data, x => x.ServerOptions.NumberOfMessagesToKeep) },
{ "sessionstokeep=", "Specifies the number of sessions to keep", data => map.Add(data, x => x.ServerOptions.NumberOfSessionsToKeep) },
{ "tlsmode=", "Specifies the TLS mode to use for SMTP. None=Off. StartTls=On demand if client supports STARTTLS. ImplicitTls=TLS as soon as connection is established.", data => map.Add(data, x => x.ServerOptions.TlsMode) },
{ "tlscertificate=", "Specifies the 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)", data => map.Add(data, x => x.ServerOptions.TlsCertificate) },
{ "tlscertificateprivatekey=", "Specifies the TLS certificate private key for SMTP. Ignored if tlscertificate is blank", data => map.Add(data, x => x.ServerOptions.TlsCertificatePrivateKey) },
{ "tlscertificate=", "Specifies the TLS certificate file to use for SMTP if TLS is enabled/requested. 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. Specify \"\" to use an auto-generated self-signed certificate (then see console output on first startup).", data => map.Add(data, x => x.ServerOptions.TlsCertificate) },
{ "tlscertificateprivatekey=", "Specifies the corresponding private key file for the SMTP TLS certificate if the private key is not part of the TlsCertificate file", data => map.Add(data, x => x.ServerOptions.TlsCertificatePrivateKey) },
{ "tlscertificatepassword=", "Specifies the password for SMTP TLSCertificate/TlsCertificatePrivateKey", data => map.Add(data, x => x.ServerOptions.TlsCertificatePassword) },
{ "relaysmtpserver=", "Sets the name of the SMTP server that will be used to relay messages or \"\" if messages relay should not be allowed", data => map.Add(data, x => x.RelayOptions.SmtpServer) },
{ "relaysmtpport=", "Sets the port number for the SMTP server used to relay messages", data => map.Add(data, x => x.RelayOptions.SmtpPort) },
{ "relayautomaticallyemails=", "A comma separated list of recipient addresses for which messages will be relayed automatically. An empty list means that no messages are relayed", data => map.Add(data, x => x.RelayOptions.AutomaticEmailsString) },
Expand Down
10 changes: 8 additions & 2 deletions Rnwood.Smtp4dev/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@
// Default value: "None"
"TlsMode": "None",

// Specifies the 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)
// 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)
// Default value: ""
// 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.
"TlsCertificate": "",
//Specifies the TLS certificate password for SMTP. Specify "" if the certificate is not password-protected.

//Specifies the corresponding private key file for the SMTP TLS certificate if the private key is not part of the TlsCertificate file.
//This must be in PEM format - generally a .KEY file.
"TlsCertificatePrivateKey": "",

//Specifies the password for the SMTP TLSCertificate/TlsCertificatePrivateKey. Specify "" if the certificate is not password-protected.
//Default value: ""
"TlsCertificatePassword": "",

Expand Down

0 comments on commit 2815229

Please sign in to comment.