Bug #78916 [Com]: php-fpm 7.4.0 don't send mail via mail()

From: Date: Thu, 05 Dec 2019 14:58:52 +0000
Subject: Bug #78916 [Com]: php-fpm 7.4.0 don't send mail via mail()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224076@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78916&edit=1 ID: 78916 Comment by: retertertert at fgfgfg dot com Reported by: ilya at ilya dot pp dot ua Summary: php-fpm 7.4.0 don't send mail via mail() Status: Feedback Type: Bug Package: *Configuration Issues Operating System: systemd/linux PHP Version: 7.4.0 Block user comment: N Private report: N New Comment: > To properly diagnose the problem, we need a short > but complete example script to be able to reproduce > this bug ourselves this is sonsense obviously the namespace/capabilities options used in the systemd unit are killing the communiction of the postfix processes runnin on hebalv the server, that's how sendmail prcoess works, it opens other postfix related processes which need capabilities this sounds more than RestrictAddressFamilies is also used now and "AF_UNIX AF_NETLINK" is missing, without a spamass-milter can't send BCC mails too RestrictAddressFamilies=AF_INET AF_INET6 AF_LOCAL AF_UNIX AF_NETLINK Previous Comments: ------------------------------------------------------------------------ [2019-12-05 14:37:21] sjon@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I run php-fpm using the same version and CapabilityBoundingSet and mail works fine - so we need more details. Since the error is logged by postfix I don't think this is caused by php-fpm, who provides /usr/bin/sendmail on this machine? ------------------------------------------------------------------------ [2019-12-05 14:23:23] ilya at ilya dot pp dot ua Description: ------------ After update to 7.4.0 php-fpm don't send mail via mail()/ In postfix mail log: fatal: inet_addr_local[getifaddrs]: getifaddrs: Address family not supported by protocol nginx log empty. php-fpm.service CapabilityBoundingSet=CAP_CHOWN CAP_SETGID CAP_SETUID What else needs to be added here so php can send mail again? Test script: --------------- protected static function mail($to,$subject,$body) { $from = escape(CONFIG['mail']['name']).' <'.CONFIG['mail']['mail'].'>'; $headers = [ 'MIME-Version' => '1.0', 'Content-Type' => 'text/html; charset=UTF-8', 'Content-Transfer-Encoding' => 'binary', 'From' => $from, 'Reply-To' => $from, ]; return mail($to, $subject, $body, $headers, '-f'.CONFIG['mail']['mail']); } Expected result: ---------------- Send mail Actual result: -------------- fatal: inet_addr_local[getifaddrs]: getifaddrs: Address family not supported by protocol ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78916&edit=1

« previous php.bugs (#224076) next »