Oh, well ... looks like it's not moving anyway .... sooooooooo ....
That MSMTP (according to sourceforge) is a specialized MUA/MTA for SMTPserver. Interesting. As long as it works for ya, great!
How does Moodle know ... well, it checks for STMP settings it has in it's config. If found, Moodle uses code to build the messages (whatever they are ... forum posting, etc.) and then sends to SMTP server via PHPMailer.
Next time you install a LAMP box (Ubuntu if ya like) check to see what comes with their 'web server' package. Even if sendmail or postfix not included, they are easy installs. The hard part is config.
Since I started with sendmail I have a tendency to understand what's needed on a CentOS boxen for mail. And that's what the following dribble is about .... sendmail ...
submit.cf is for localhost and sendmail.cf is for true sending and possibly receiving mail.
In the sendmail.cf one could use a 'smart' relay host rule and defining that all mail not destined for a local user account (like root or other you've established) automagically goes to the SMTP server you point it to as the 'smart' relay host. Of course, one has to config that 'smart' relay host and have it allow relay from the Moodle servers sendmail.
Postfix is similar.
Advantage in using what you did, it's very limited but I would assume very secure ... but did require change to php.ini. Advantage in using sendmail/postfix/exim ... well, you can do more with it IF so inclined - no change/addition to php.ini.
Most folks just want it to work.
Check the headers of messages you get from your server via Moodle. That should show exactly what's going on with Moodle. Or, from terminal sessions/ssh, install pine or alpine - text based MTA ... those are configurable ... can set smtp host in them and test sending messages as root user or other user to/trough the SMTP server.
Check the header of messages you get from Moodle.org forums.
Due to spam/virus, etc. ... almost all mail servers will check sending servers for things like SPF and DKIM records in DNS .... checks for the validity of mail servers for a domain or server within a domain.
'spirit of sharing', Ken