Skip to content

Fix default sendmail path when not found during build #5548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Ingramz
Copy link
Contributor

@Ingramz Ingramz commented May 9, 2020

This is my attempt to fix Bug #78757 where the default sendmail_path was not correctly set if it was not found on the system. Without the fix the path to binary would be empty, resulting in not so useful sendmail_path = -t -i in case sendmail is installed later to the default path.

Since PHP_PROG_SENDMAIL is set unconditionally, it made sense to simply fill the fallback value in the autoconf script. However, this approach seems to have a drawback that now the configure script will report checking for sendmail... /usr/sbin/sendmail instead of the previous checking for sendmail... no if sendmail cannot be found. I'm open to suggestions on how to improve it if needed.

#else
# define DEFAULT_SENDMAIL_PATH "/usr/sbin/sendmail -t -i"
# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t -i"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is now the same as in the above elif branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, since PHP_PROG_SENDMAIL is always defined.

@nikic
Copy link
Member

nikic commented May 11, 2020

It would be better to find the sendmail binary in PATH at runtime, but this is clearly better than what it does now...

@php-pulls php-pulls closed this in 5174318 May 11, 2020
chrismshelton added a commit to LastCallMedia/PHP-Docker that referenced this pull request Aug 23, 2022
petk added a commit to petk/php-src that referenced this pull request Jul 14, 2024
The sendmail is set to default value of /usr/sbin/sendmail if not found
on the host system. This was already properly fixed via phpGH-5548
(commit 5174318). This change now
also outputs "no" when searching for sendmail and a minimalistic notice
that default send_mail INI directive has been set to /usr/sbin/sendmail.

Fixes and closes: https://bugs.php.net/78757
petk added a commit that referenced this pull request Jul 14, 2024
The sendmail is set to default value of /usr/sbin/sendmail if not found
on the host system. This was already properly fixed via GH-5548
(commit 5174318). This change now
also outputs "no" when searching for sendmail and a minimalistic notice
that default send_mail INI directive has been set to /usr/sbin/sendmail.

Fixes and closes: https://bugs.php.net/78757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants