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

From: Date: Thu, 05 Dec 2019 14:37:21 +0000
Subject: Bug #78916 [Opn->Fbk]: 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-224075@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
 Updated by:         sjon@php.net
 Reported by:        ilya at ilya dot pp dot ua
 Summary:            php-fpm 7.4.0 don't send mail via mail()
-Status:             Open
+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:

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?


Previous Comments:
------------------------------------------------------------------------
[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


Thread (14 messages)

« previous php.bugs (#224075) next »