| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.Json.Serialization;
- using System.Threading.Tasks;
- namespace qdr.app.studiou.orders2printpack.EmailStorage
- {
- /// <summary>
- /// Configuration class for the EmailStorageProcessor containing all necessary
- /// settings for TSS (Temporary Shared Storage) API and SMTP server connectivity.
- /// This class is designed to be serialized/deserialized from JSON configuration files.
- /// </summary>
- public class EmailProcessorConfiguration
- {
- #region TSS API Configuration
- /// <summary>
- /// API key for accessing the Temporary Shared Storage (TSS) service.
- /// This key is required for file upload operations to the shared storage.
- /// </summary>
- [JsonPropertyName("tss-api-key")]
- [JsonRequired]
- public string TssAPIKey { get; set; } = string.Empty;
-
- /// <summary>
- /// Base URL for the Temporary Shared Storage (TSS) API endpoint.
- /// Should include the protocol (https://) and domain.
- /// </summary>
- [JsonPropertyName("tss-url")]
- [JsonRequired]
- public string TssUrl { get; set; } = string.Empty;
- #endregion
- #region SMTP Server Configuration
- /// <summary>
- /// SMTP server hostname or IP address for sending emails.
- /// Examples: smtp.gmail.com, mail.company.com, 192.168.1.100
- /// </summary>
- [JsonPropertyName("smtp-server")]
- [JsonRequired]
- public string SmtpServer { get; set; } = string.Empty;
-
- /// <summary>
- /// SMTP server port number for email communication.
- /// Common ports: 25 (plain), 587 (STARTTLS), 465 (SSL/TLS)
- /// Defaults to 587 which is the standard submission port with STARTTLS.
- /// </summary>
- [JsonPropertyName("smtp-server-port")]
- [JsonRequired]
- public int SmtpServerPort { get; set; } = 587; // Default SMTP submission port
-
- /// <summary>
- /// Username for SMTP server authentication.
- /// This is typically an email address or account name depending on the server.
- /// </summary>
- [JsonPropertyName("smtp-server-user")]
- [JsonRequired]
- public string SmtpServerUser { get; set; } = string.Empty;
-
- /// <summary>
- /// Password for SMTP server authentication.
- /// For security, consider using app-specific passwords when available.
- /// This value should be kept secure and not logged.
- /// </summary>
- [JsonPropertyName("smtp-server-pwd")]
- [JsonRequired]
- public string SmtpServerPassword { get; set; } = string.Empty;
-
- /// <summary>
- /// Indicates whether to enable SSL/TLS encryption for SMTP communication.
- /// Defaults to true for security. Most modern SMTP servers require encryption.
- /// </summary>
- [JsonPropertyName("smtp-enable-ssl")]
- public bool SmtpEnableSsl { get; set; } = true; // Default to secure connection
- #endregion
- }
- }
|