I had this problem earlier but somehow managed to repair it.
One month after I had to reinstall Dovecot and Postfix and the same error appeared.
In my php.ini which is located at /etc/php/7.3/apache2/ is sendmail_path set to
sendmail_path = /etc/postfix
It writes I have a problem with permissions:
user@occamy:/etc$ sudo tail /var/log/mail.warn
Oct 21 16:27:36 localhost postfix/sendmail[20073]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
Oct 21 16:28:36 localhost postfix/sendmail[20079]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
Oct 21 16:35:02 localhost postfix/postfix-script[20270]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Oct 21 16:35:02 localhost postfix/postfix-script[20273]: warning: symlink leaves directory: /etc/postfix/./postfix_ab/makedefs.out
Oct 21 16:35:07 localhost postfix/sendmail[20328]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
Oct 21 16:35:32 localhost postfix/sendmail[20350]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
Oct 21 16:37:00 localhost postfix/postfix-script[20565]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Oct 21 16:37:00 localhost postfix/postfix-script[20568]: warning: symlink leaves directory: /etc/postfix/./postfix_ab/makedefs.out
Oct 21 16:37:07 localhost postfix/sendmail[20623]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
Oct 21 16:37:15 localhost postfix/sendmail[20625]: fatal: /etc/postfix/dynamicmaps.cf: file open failed: Permission denied
/etc/postfix/dynamicmaps.cf
I had the same problem with main.cf. I resolved it with chmod 775 which is not that good I guess...
Then it writes this permission error.
The weirdest thing on it is this progress I am doing to obtain e-mail:
- Mail returns FALSE when sending mail()
- Changing the whole postfix directory to perm. 775 and sending mail - returns TRUE
- Email is not received
- Changing back to all of the previous permissions for each file
- Email has been magically received but cannot send it again. Aaand repeat from point 1
Also when I set dynamicmaps.cf to chmod 775, sudo postconf -m writes:
btree
cidr
environ
fail
hash
inline
internal
memcache
nis
pipemap
proxy
randmap
regexp
socketmap
static
tcp
texthash
unionmap
unix
and the mysql is missing with those permissions set.
Thank you in an advance for your replies!