Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30750 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59791 invoked by uid 1010); 10 Jul 2007 21:26:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59770 invoked from network); 10 Jul 2007 21:26:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2007 21:26:15 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:60293] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/F5-12502-479F3964 for ; Tue, 10 Jul 2007 17:26:13 -0400 Received: (qmail 21990 invoked by uid 507); 10 Jul 2007 21:26:06 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.88.108) by mail4.netbeat.de with ESMTPA; 10 Jul 2007 21:26:06 -0000 To: PHP Internals List Content-Type: multipart/mixed; boundary="=-FiF8OUGVPQYszBvCWkKk" Date: Tue, 10 Jul 2007 23:25:06 +0200 Message-ID: <1184102707.455.42.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 (2.10.2-2.fc7) Subject: Always enable mail() function From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-FiF8OUGVPQYszBvCWkKk Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, recently I had the problem that we disable the mail() function if configure can't find the sendmail binary. Is there any real reason for this? I can image a few situations where the binary is in a non-standard location or PHP is compiled on a different host than used. I'd like to commit the attached patch which should always enable mail(), any objections? johannes P.S. If it doesn't come through: The patch is available on http://schlueters.de/~johannes/php/php_mail_always_available.diff too. --=-FiF8OUGVPQYszBvCWkKk Content-Disposition: attachment; filename=php_mail_always_available.diff Content-Type: text/x-patch; name=php_mail_always_available.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: ext/mbstring/mbstring.c =================================================================== RCS file: /repository/php-src/ext/mbstring/mbstring.c,v retrieving revision 1.268 diff -u -p -r1.268 mbstring.c --- ext/mbstring/mbstring.c 4 Apr 2007 15:23:09 -0000 1.268 +++ ext/mbstring/mbstring.c 10 Jul 2007 21:16:22 -0000 @@ -3317,7 +3317,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')) { \ @@ -3821,16 +3820,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]) Index: ext/standard/basic_functions.c =================================================================== RCS file: /repository/php-src/ext/standard/basic_functions.c,v retrieving revision 1.862 diff -u -p -r1.862 basic_functions.c --- ext/standard/basic_functions.c 3 Jul 2007 10:22:55 -0000 1.862 +++ ext/standard/basic_functions.c 10 Jul 2007 21:16:23 -0000 @@ -1816,7 +1816,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) @@ -1830,7 +1829,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, ZEND_ARG_INFO(0, additional_headers) ZEND_ARG_INFO(0, additional_parameters) ZEND_END_ARG_INFO() -#endif /* }}} */ /* {{{ math.c */ static @@ -3693,10 +3691,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 @@ -4944,14 +4940,9 @@ PHPAPI int _php_error_log(int opt_err, c 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; Index: ext/standard/mail.c =================================================================== RCS file: /repository/php-src/ext/standard/mail.c,v retrieving revision 1.93 diff -u -p -r1.93 mail.c --- ext/standard/mail.c 10 Jul 2007 20:23:26 -0000 1.93 +++ ext/standard/mail.c 10 Jul 2007 21:16:23 -0000 @@ -35,7 +35,6 @@ #include "php_ini.h" #include "exec.h" -#if HAVE_SENDMAIL #ifdef PHP_WIN32 #include "win32/sendmail.h" #endif @@ -271,13 +270,6 @@ PHP_MINFO_FUNCTION(mail) } /* }}} */ -#else - -PHP_FUNCTION(mail) {} -PHP_MINFO_FUNCTION(mail) {} - -#endif - /* * Local variables: * tab-width: 4 Index: ext/standard/php_mail.h =================================================================== RCS file: /repository/php-src/ext/standard/php_mail.h,v retrieving revision 1.20 diff -u -p -r1.20 php_mail.h --- ext/standard/php_mail.h 1 Jan 2007 09:29:32 -0000 1.20 +++ ext/standard/php_mail.h 10 Jul 2007 21:16:23 -0000 @@ -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 */ Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.734 diff -u -p -r1.734 main.c --- main/main.c 10 Jul 2007 18:42:01 -0000 1.734 +++ main/main.c 10 Jul 2007 21:16:23 -0000 @@ -341,7 +341,7 @@ static PHP_INI_MH(OnUpdateDefaultMimetyp #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 --=-FiF8OUGVPQYszBvCWkKk--