Covered by Behat tests.
MDL-64665 was integrated to master but it should also be backported to 3.6 (as we're doing with all the behat tests: MDL-63986).
MDL-65169 Messaging: search should respect profile visibility when site-wide messaging is used
MDL-64665 Add behat test for new UI to manage messaging preferences