summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-07-11 17:36:56 +0000
committerJohannes Schlüter <johannes@php.net>2007-07-11 17:36:56 +0000
commitdc8d09bbbde45cfcc15907976c8bb5dd12fed64a (patch)
tree8e70c176ed1cca66281927f36ba180658398e847
parent90b9d6241e4a360288ed00fae0eeab0aee1cb7ca (diff)
downloadphp-git-dc8d09bbbde45cfcc15907976c8bb5dd12fed64a.tar.gz
- MFH: Always enable mail() function
-rw-r--r--NEWS1
-rw-r--r--acinclude.m43
-rw-r--r--ext/mbstring/mbstring.c11
-rw-r--r--ext/standard/basic_functions.c9
-rw-r--r--ext/standard/mail.c8
-rw-r--r--ext/standard/php_mail.h4
-rw-r--r--main/config.w32.h1
-rw-r--r--main/main.c2
-rw-r--r--win32/build/config.w32.h.in1
9 files changed, 2 insertions, 38 deletions
diff --git a/NEWS b/NEWS
index 404059920d..21d7de0a33 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ PHP NEWS
- Changed error handler to send HTTP 500 instead of blank page on PHP errors.
(Dmitry, Andrei Nigmatulin)
+- Changed mail() function to be always available. (Johannes)
- Added persistent connection status checker to pdo_pgsql.
(Elvis Pranskevichus, Ilia)
diff --git a/acinclude.m4 b/acinclude.m4
index 5b43d362e2..9814b1a24e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1991,9 +1991,6 @@ dnl
AC_DEFUN([PHP_PROG_SENDMAIL], [
PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib
AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH)
- if test -n "$PROG_SENDMAIL"; then
- AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
- fi
PHP_SUBST(PROG_SENDMAIL)
])
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 76f2cffccd..be3acfdd85 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -3297,7 +3297,6 @@ PHP_FUNCTION(mb_decode_numericentity)
/* {{{ proto int mb_send_mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
* Sends an email message with MIME scheme
*/
-#if HAVE_SENDMAIL
#define SKIP_LONG_HEADER_SEP_MBSTRING(str, pos) \
if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
@@ -3806,16 +3805,6 @@ PHP_FUNCTION(mb_send_mail)
#undef PHP_MBSTR_MAIL_MIME_HEADER2
#undef PHP_MBSTR_MAIL_MIME_HEADER3
#undef PHP_MBSTR_MAIL_MIME_HEADER4
-
-#else /* HAVE_SENDMAIL */
-
-PHP_FUNCTION(mb_send_mail)
-{
- RETURN_FALSE;
-}
-
-#endif /* HAVE_SENDMAIL */
-
/* }}} */
/* {{{ proto mixed mb_get_info([string type])
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index e93b3a9ed6..b53d283786 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1830,7 +1830,6 @@ ZEND_END_ARG_INFO()
#endif
/* }}} */
/* {{{ mail.c */
-#ifdef HAVE_SENDMAIL
static
ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
ZEND_ARG_INFO(0, addr)
@@ -1844,7 +1843,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
ZEND_ARG_INFO(0, additional_headers)
ZEND_ARG_INFO(0, additional_parameters)
ZEND_END_ARG_INFO()
-#endif
/* }}} */
/* {{{ math.c */
static
@@ -3650,10 +3648,8 @@ zend_function_entry basic_functions[] = {
PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
/* functions from mail.c */
-#ifdef HAVE_SENDMAIL
PHP_FE(mail, arginfo_mail)
PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
-#endif
/* functions from syslog.c */
#ifdef HAVE_SYSLOG_H
@@ -4997,14 +4993,9 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
case 1: /*send an email */
{
-#if HAVE_SENDMAIL
if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
return FAILURE;
}
-#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mail option not available!");
- return FAILURE;
-#endif
}
break;
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index f87a74410f..608350f555 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -36,7 +36,6 @@
#include "safe_mode.h"
#include "exec.h"
-#if HAVE_SENDMAIL
#ifdef PHP_WIN32
#include "win32/sendmail.h"
#endif
@@ -295,13 +294,6 @@ PHP_MINFO_FUNCTION(mail)
}
/* }}} */
-#else
-
-PHP_FUNCTION(mail) {}
-PHP_MINFO_FUNCTION(mail) {}
-
-#endif
-
/*
* Local variables:
* tab-width: 4
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index 84f256ec8b..99d32c4d8c 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -24,11 +24,7 @@
PHP_FUNCTION(mail);
PHP_MINFO_FUNCTION(mail);
-#if HAVE_SENDMAIL
-
PHP_FUNCTION(ezmlm_hash);
PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC);
-#endif
-
#endif /* PHP_MAIL_H */
diff --git a/main/config.w32.h b/main/config.w32.h
index 7292eed378..a86b9cffb6 100644
--- a/main/config.w32.h
+++ b/main/config.w32.h
@@ -118,7 +118,6 @@
#undef HAVE_SETITIMER
#undef HAVE_IODBC
#define HAVE_LIBDL 1
-#define HAVE_SENDMAIL 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_PUTENV 1
#define HAVE_LIMITS_H 1
diff --git a/main/main.c b/main/main.c
index 38c9769c9b..e55f26c8eb 100644
--- a/main/main.c
+++ b/main/main.c
@@ -231,7 +231,7 @@ static PHP_INI_MH(OnUpdateTimeout)
#if defined(PHP_PROG_SENDMAIL) && !defined(NETWARE)
# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t -i "
#else
-# define DEFAULT_SENDMAIL_PATH NULL
+# define DEFAULT_SENDMAIL_PATH "/usr/sbin/sendmail -t -i"
#endif
/* {{{ PHP_INI
*/
diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in
index 3b9e5fbe01..442850a3e5 100644
--- a/win32/build/config.w32.h.in
+++ b/win32/build/config.w32.h.in
@@ -56,7 +56,6 @@
#undef HAVE_SETITIMER
#undef HAVE_IODBC
#define HAVE_LIBDL 1
-#define HAVE_SENDMAIL 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_PUTENV 1
#define HAVE_LIMITS_H 1