0

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:

  1. Mail returns FALSE when sending mail()
  2. Changing the whole postfix directory to perm. 775 and sending mail - returns TRUE
  3. Email is not received
  4. Changing back to all of the previous permissions for each file
  5. 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!

Junek
  • 3
  • 3

1 Answers1

0

You've customized the sendmail_path parameter without knowing what it does.

From the PHP docs:

Where the sendmail program can be found, usually /usr/sbin/sendmail or /usr/lib/sendmail. configure does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here.

You most likely don't need to tune it as it will work by default if all packages are from the package manager and if you do need to tune it, you certainly can't pass a folder as value.

The permission errors from postfix are likely because the file owners aren't properly setup. As a general rule of thumb, chmod or chown in /etc should be uncommon at least.

Ginnungagap
  • 1,998
  • 8
  • 9