Moodle 3.4 incoming mail server: message inbound task pickup_messages sender validation fails if email address isn't exact case

Moodle 3.4 incoming mail server: message inbound task pickup_messages sender validation fails if email address isn't exact case

by Donald Barrett -
Number of replies: 0

Hi there,

I am setting up and testing (locally) the inbound message with reply to forum posts message handler enabled. 


When I make a forum post and then run cron which sends the forum post to the subscribed users I receive the email but when I reply to the email and run the message inbound task pickup messages I get the following.

Found 1 messages to parse. Parsing...
- Parsing message 508
-- Subject:	Re: course0: POST to be
-- From:	Firstname.Lastname@organisation.co.nz
-- Recipient:	secure.person+AAAAAAAAAAIAAAAAAAAABAAAAAAAAAAbohB0gp8EDm8EfNHt@gmail.com
-- Processing the message as user 4 (learner0).
-- Message did not meet validation but is possibly recoverable. Fail code 256
--> Sending a message to the user to report an verification failure.
--- Original message retained on mail server and confirmation message sent to user.
-- Returning to the original user.


The users email address in moodle is firstname.lastname@organisation.co.nz but the email was received by Firstname.Lastname@organisation.co.nz. Would it be better for the validation to compare convert the senders email address and the users email address to lowercase before evaluating?


// Line 412 of file $CFG->dirroot/lib/classes/message/inbound/address_manager.php
if ($this->handler->validateaddress) {
// Validation of the sender's e-mail address is also required.
if ($address !== $this->record->user->email) {
// The e-mail address of the originator did not match the
// address held on record for this user.
$returnvalue += self::VALIDATION_ADDRESS_MISMATCH;
}
}

Average of ratings: -