服务器配置 > SMTP 配置 > 为封闭式邮件转发配置 SMTP 服务器
为封闭式邮件转发配置 SMTP 服务器
为封闭式邮件转发配置 SMTP 服务器
要为封闭式邮件转发设置 SMTP 服务器,您必须在 is.properties 文件中配置以下特性。请务必确保所有特性均已正确配置,并且未留有空白项。
* 
切换邮件转发系统时,您必须考虑以下事项:
若要切换邮件转发,则需要重新启动服务器。
如果您在使用封闭式邮件转发系统时修改了任何已配置特性,则需要重新启动服务器。
mksis.smtp.authentication -- 将该值设置为 true 可使用封闭式邮件转发发送邮件。将此特性设置为 false 可使应用程序使用开放式邮件转发发送邮件。
mksis.smtp.ssl.enabled -- 将该值设置为 true 可在 SMTP 服务器上启用 TLS 加密。仅当使用签名者许可证给 SMTP 服务器配置了 TLS 加密时,可使用该选项。如果 SMTP 服务器配置了 TLS 加密,则可以使用 keytool.exe 命令将签名者证书 (自定义根 CA 或自定义中间 CA) 从 SMTP 服务器导入受信任密钥库。keytool.exe 命令位于 JRE/JDK 文件夹中。

%jdk%\bin\keytool -importcert -alias <<SMTP Server name>> -storetype PKCS12
-keystore jdk\lib\security\cacerts
-file <custome_CA_certificate>
where
-importcert - specifies to import the certificate response
-alias - specifies the name of the entry from which to import
-file - specifies the path from which to read the CA response
You must repeat the command for all the CAs.
mksis.logging.email.from -- 包含发件人的身份验证用户名
mksis.logging.emailfrom.password -- 包含密码
mksis.logging.email.server.hostname -- 包含 SMTP 服务器的名称。
mksis.logging.email.server.port -- 包含端口号
* 
添加或修改身份验证用户名和密码后,请保存 is.properties 文件并运行加密工具。此操作可确保 is.properties 文件中提供的密码得到加密。
如需查看完整的特性列表,请参阅主题 is.properties 中的 PTC RV&S 服务器特性
电子邮件触发器
若要继续使用开放式邮件转发,则无需进行任何更改,触发器会继续按预期运行。若要切换到 SMTP 封闭式邮件转发系统,则必须按上文所述配置 is.properties 文件,并对应用程序提供的预设触发器脚本进行以下更改:
如您使用 Java Mail API 和样本触发器脚本 (emailAdvanced_closedmail.js),请务必确保使用适合的加密技术从 getSMTPPassword()getSMTPUserName() 函数中检索身份验证详细信息。以下代码片段可供使用:

// NOTE: SMTP closed mail configuration requires username and password to send
// e-mails. As storing plain-text password is not recommended, using an appropriate encryption
// technique is recommended in retrieving authentication details from getSMTPUserName(),
// getSMTPPassword() functions.
function getSMTPUserName()
{
var smtpUsername = null;
return smtpUsername;
}
function getSMTPPassword()
{
var smtpPassword = null;
return smtpPassword;
}
//enable authentication
jmail_props.put( "mail.smtp.auth", true);
//enable TLS
jmail_props.put( "mail.smtp.starttls.enable", "true");
Packages.javax.mail.Transport.send(html_msg, getSMTPUserName(), getSMTPPassword());
如您使用非 Java Mail API (sendmail() 函数),则必须使用与 SMTP 基本身份验证中所提供用户名一致的正确用户名。例如,您可以使用函数 eb.sendmail([email protected], email, subject, message)
这对您有帮助吗?