Go to dovecot.service, in [Service] block after Type=forking add this line
ExecStartPost=/bin/sh -c 'chown root:dovecot /var/run/dovecot/master.pid'
then run cmd
systemctl daemon-reload && systemctl restart dovecot && systemctl status dovecot
And the dovecot status should appear like this:
dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-09-06 15:37:23 BST; 38ms ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 18381 ExecStop=/usr/bin/doveadm stop (code=exited, status=0/SUCCESS)
Process: 18396 ExecStartPost=/bin/sh -c chown root:dovecot /var/run/dovecot/master.pid (code=exited, status=0/SUCCESS)
Process: 18393 ExecStart=/usr/sbin/dovecot (code=exited, status=0/SUCCESS)
Process: 18391 ExecStartPre=/usr/sbin/portrelease dovecot (code=exited, status=0/SUCCESS)
Process: 18385 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 18395 (dovecot)
CGroup: /system.slice/dovecot.service
├─18395 /usr/sbin/dovecot
├─18398 dovecot/anvil
├─18399 dovecot/log
├─18400 dovecot/ssl-params
└─18403 dovecot/config
Sep 06 15:37:23 domain.com systemd[1]: Stopped Dovecot IMAP/POP3 email server.
Sep 06 15:37:23 domain.com systemd[1]: Starting Dovecot IMAP/POP3 email server...
Sep 06 15:37:23 domain.com dovecot[18395]: master: Dovecot v2.2.36 (1f10bfa63) starting up for imap, pop3, lmtp (core dumps disabled)
Sep 06 15:37:23 domain.com systemd[1]: Started Dovecot IMAP/POP3 email server.
type here