mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-46284 tool_messageinbound: Fail with warning if handler disabled
If a handler is disabled, the user should be informed of this issue. This issue is a part of the MDL-47194 Task. This issue is a part of the MDL-39707 Epic.
This commit is contained in:
parent
b92a7dd0d8
commit
262abe63fd
@ -334,6 +334,15 @@ class manager {
|
||||
// Now pass it through the Inbound Message processor.
|
||||
$status = $this->addressmanager->process_envelope($recipient, $sender);
|
||||
|
||||
if (($status & ~ \core\message\inbound\address_manager::VALIDATION_DISABLED_HANDLER) !== $status) {
|
||||
// The handler is disabled.
|
||||
mtrace("-- Skipped message - Handler is disabled. Fail code {$status}");
|
||||
// In order to handle the user error, we need more information about the message being failed.
|
||||
$this->process_message_data($envelope, $messagedata, $messageid);
|
||||
$this->inform_user_of_error(get_string('handlerdisabled', 'tool_messageinbound', $this->currentmessagedata));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the validation status early. No point processing garbage messages, but we do need to process it
|
||||
// for some validation failure types.
|
||||
if (!$this->passes_key_validation($status, $messageid)) {
|
||||
|
@ -36,6 +36,7 @@ $string['enabled'] = 'Enabled';
|
||||
$string['fixedvalidateaddress'] = 'Validate sender address';
|
||||
$string['fixedvalidateaddress_help'] = 'You cannot change the address validation for this handler. This may be because the handler requires a specific setting.';
|
||||
$string['fixedenabled_help'] = 'You cannot change the state of this handler. This may be because the handler is required by other handlers.';
|
||||
$string['handlerdisabled'] = 'The email handler you tried to contact has been disabled. Unable to process message at this time.';
|
||||
$string['incomingmailconfiguration'] = 'Incoming mail configuration';
|
||||
$string['incomingmailserversettings'] = 'Incoming mail server settings';
|
||||
$string['incomingmailserversettings_desc'] = 'Moodle is capable of connecting to appropriately configured IMAP servers. You can specify the settings used to connect to your IMAP server here.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user