Dovecot does not work, After upgrade to Plesk 17.8: read-only filesystem

Recently one of our clients has recently upgraded to Plesk 17.8 and he was unable to receive/read mail, including webmail. On reading logs /var/log/maillog we found following messages:

 service=pop3, [email protected], ip=[203.0.113.2]. 
Mailbox INBOX: open(/var/qmail/mailnames/example.com/johndoe/Maildir/
dovecot-uidlist) failed: Read-only file system

Actually The latest Dovecot packages versions use the ProtectSystem=Full systemd directive in the /usr/lib/systemd/system/dovecot.service file which blocks Dovecot from writing into a non-default directory (in this case /home directory). Mail data was stored in a location different from the default.

To resolve this:

Use a mount point for mail storage other than /home

OR

Connect to the server via SSH;

Create a service.conf file at /etc/systemd/system/dovecot.d and add the following lines to it:

ProtectHome=false

Comment the following line in the /usr/lib/systemd/system/dovecot.service file:

#ProtectSystem=full

Note: Updating/reinstalling dovecot package may revert changes made in

/usr/lib/systemd/system/dovecot.service

file

Reload the systemd daemon:

# systemctl daemon-reload

Finally, restart Dovecot:

# systemctl restart dovecot