Mail.json
Cautions
When changing parameters, please refer to "Confirmation When Changing Parameters".
Setting Values
The setting values for this parameter file are as follows.
Common Settings
| Parameter name | e.g. | Description |
| SmtpEnableSsl | false | Specify true to enable SSL/TLS. If set to true, the StartTls encryption method will be applied. If you want to specify a different method, use the SecureSocketOptions Parameter. |
| ServerCertificateValidationCallback | false | Specify true to suppress the error "An error occurred while attempting to establish an SSL or TLS connection". |
| SecureSocketOptions | "SslOnConnect" | Specify the SSL/TLS encryption method to use for the connection. The default value is null. For allowed strings, refer to Enum Names available in MimeKit. |
| FixedFrom | "fixed@example.com" | If an email address is specified, this will be the from address when sending an email. If null is set, the logged-in user's email address will be the from address. |
| AllowedFrom | ["support@example.com"] | If FixedFrom is not null and corresponds to an email address listed in AllowedFrom, FixedFrom will not be used and the email address of the logged-in user will be the from. |
| SupportFrom | "support@example.com" | Specify a support email address. Required when using "Enable 2-step Authentication by Email". |
| InternalDomains | ".example1.com,.example2.com" | If you want to restrict the domains to which emails can be sent, specify a whitelist separated by commas. |
| AddressValidation | "\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+\b" | Specify the regular expression used to validate email addresses. |
| Encoding | "shift_jis" | The default value is null. Specify explicitly if you want to change it to something other than UTF-8. If the system does not support the encoding name, an error will be output to SysLogs when the settings are loaded, and then sending will be attempted in UTF-8. |
| ContentEncoding | "SevenBit" | The default value is null. For permitted strings, refer to Enum Names available in MimeKit. |
How to Register in System Environment Variables
SmtpUserName, SmtpPassword, OAuthClientId, OAuthClientSecret, SendGrid.ApiKey, AwsSes.AccessKeyId, AwsSes.SecretAccessKey, and AwsSes.SessionToken can be registered in system environment variables. OAuthClientId and OAuthClientSecret can be registered in 1.5.1.0 and later, and SendGrid.ApiKey, AwsSes.AccessKeyId, AwsSes.SecretAccessKey, and AwsSes.SessionToken in 1.5.5.0 and later.
For OAuthClientId and OAuthClientSecret, also refer to "Configure Pleasanter to send mail using the SMTP server of M365".
1. Naming Convention
The naming convention of the system environment variables is as follows.
(Service name)_Mail_SmtpUserName
(Service name)_Mail_SmtpPassword
(Service name)_Mail_OAuthClientId
(Service name)_Mail_OAuthClientSecret
(Service name)_Mail_SendGrid_ApiKey
(Service name)_Mail_AwsSes_AccessKeyId
(Service name)_Mail_AwsSes_SecretAccessKey
(Service name)_Mail_AwsSes_SessionToken
| Column | Required | Description |
| Service name | ○ | Specify "EnvironmentName" or "Name" in Service.json |
You can also set these values in this parameter file as before. For Azure, you can add or edit them via [App Service Settings] -> [Configuration] -> [Application Settings].
Example Settings
| Variable | Example |
| Implem.Pleasanter_Mail_SmtpUserName | UserName |
| Implem.Pleasanter_Mail_SmtpPassword | Password |
| Implem.Pleasanter_Mail_OAuthClientId | ClientId |
| Implem.Pleasanter_Mail_OAuthClientSecret | ClientSecret |
| Implem.Pleasanter_Mail_SendGrid_ApiKey | SG.xxxxAPIKeyxxxxxx... |
| Implem.Pleasanter_Mail_AwsSes_AccessKeyId | AccessKeyId |
| Implem.Pleasanter_Mail_AwsSes_SecretAccessKey | SecretAccessKey |
| Implem.Pleasanter_Mail_AwsSes_SessionToken | SessionToken |
2. Priority Order
If a value is set in both this parameter file and the system environment, or if it is set in an abbreviated form, the priority is as follows.
3. Notes When Registering in System Environment Variables
As described in "2. Priority Order", the value set in the parameter file takes the highest priority. Therefore, when you register a value in a system environment variable, specify "null" in the parameter file.
Supported Versions
| Supported versions | Body |
| 1.3.18.0 and later | Added ServerCertificateValidationCallback |
| 1.3.49.0 and later | Added SecureSocketOptions |