I found the following error when restarting dovecot on some servers
Restarting IMAP/POP3 mail server: dovecotWarning: mail_extra_groups setting was often used insecurely so it is now deprecated, use mail_access_groups or mail_privileged_group instead
as the error suggests you need to use another variable in the dovecot.conf other than mail_extra_groups as it is now deprecated.
Simply edit dovecot.conf
mail_extra_groups = mail
mail_access_groups = mail
service dovecot restart
Now the error should no longer appear