Skip to content

Commit

Permalink
squash. clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Apr 10, 2024
1 parent 886054d commit f5947d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/re/src/mailMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace
* \note This microservice sends e-mail using the mail command in the unix system. No attachments are supported. The
* sender of the e-mail is the unix user-id running the irodsServer.
*
* \warning This microservice will fail unless /advanced_settings/enable_msiSendMail is set to true in server_config.json.
* \warning This microservice will fail unless /advanced_settings/enable_msiSendMail is set to true in
* server_config.json.
*
* \usage See clients/icommands/test/rules/
*
Expand All @@ -55,20 +56,22 @@ namespace
* \sa none
**/
int msiSendMail( msParam_t* xtoAddr, msParam_t* xsubjectLine, msParam_t* xbody, ruleExecInfo_t* ) {

const auto enabled = [] {
try {
return irods::get_advanced_setting<bool>("enable_msiSendMail");
}
catch (...) {
log_msi::trace("msiSendMail: [/advanced_settings/enable_msiSendMail] is not defined in server_config.json. Defaulting to false.");
log_msi::trace("msiSendMail: [/advanced_settings/enable_msiSendMail] is not defined in server_config.json. "
"Defaulting to false.");
return false;
}
}();

// Do not allow this MSI to proceed unless the local administrator has approved it for use.
if (!enabled) {
log_msi::error("{}: Use of this microservice is not allowed. Blocked by the local administrator. See server_config.json.", __func__);
log_msi::error(
"{}: Use of this microservice is not allowed. Blocked by the local administrator. See server_config.json.",
__func__);
return SYS_NOT_ALLOWED;
}

Expand Down

0 comments on commit f5947d5

Please sign in to comment.