Koozali.org: home of the SME Server

PHP mail command fails

Offline pcowley

  • *
  • 14
  • +0/-0
PHP mail command fails
« on: January 23, 2012, 10:46:27 AM »
Hi

This problem has only recently been noticed but started showing up in the httpd/error_log file from November 21  ...  (I'm on SME server 7.5.1 and PHP 5.3.2 on some selected ibays)

Mail sent from PHP scripts fails with an error in the http.error.log of sh: -t; command not found

This example script:

<?php

// The message

$message = "Testing email from PHP\nin SME server 7.6\nwhich suddenly seems to have stopped working";



// In case any of our lines are larger than 70 characters, we should use wordwrap()

$message = wordwrap($message, 70);



// Send

mail('pete@cowleyconsulting.co.nz', 'Test Email', $message);

?>



Give this in the httpd/error_log file

[Mon Jan 23 21:47:35 2012] [error] [client 192.168.211.96] sh: -t: command not found

Going back through the error logs it seems this started on November 21st

These was a huge update sometime between the 5th and 19th of November as follows:

Installing:
 kernel                  i686       2.6.9-89.31.1.EL  smeupdates         13 M
 kernel-smp              i686       2.6.9-89.31.1.EL  smeupdates         12 M
Updating:
 apr                     i386       0.9.4-26.el4     updates            94 k
 apr-util                i386       0.9.4-22.el4_8.3  updates            52 k
 bash                    i386       3.0-27.el4       updates           1.7 M
 bind-libs               i386       20:9.2.4-37.el4  updates           570 k
 bind-utils              i386       20:9.2.4-37.el4  updates           143 k
 bzip2                   i386       1.0.2-16.el4_8   smeupdates         48 k
 bzip2-libs              i386       1.0.2-16.el4_8   updates            34 k
 centos-release          i386       6:4-9.1          updates            23 k
 clamav                  i386       0.97-1.el4.rf    smeupdates        2.2 M
 clamav-db               i386       0.97-1.el4.rf    smeupdates         26 M
 clamd                   i386       0.97-1.el4.rf    smeupdates        225 k
 coreutils               i386       5.2.1-37.el4     updates           2.9 M
 cups-libs               i386       1:1.1.22-0.rc1.9.32.el4.10  updates           115 k
 curl                    i386       7.12.1-17.el4    updates           231 k
 device-mapper           i386       1.02.28-3.el4    updates           578 k
 dhclient                i386       7:3.0.1-68.el4   updates           228 k
 dhcp                    i386       7:3.0.1-68.el4   updates           567 k
 dosfstools              i386       2.8-20           updates            64 k
 dstat                   noarch     0.7.2-1.el4.rf   smeos             135 k
 dump                    i386       0.4b39-5.el4_8   smeupdates        816 k
 e-smith-backup          noarch     2.0.0-32.el4.sme  smeupdates         94 k
 e-smith-base            i386       5.0.0-15.el4.sme  smeupdates        342 k
 e-smith-devtools        noarch     2.0.0-2.el4.sme  smeupdates         26 k
 e-smith-email           noarch     5.0.0-9.el4.sme  smeupdates        142 k
 e-smith-formmagick      noarch     2.0.0-3.el4.sme  smeupdates         45 k
 e-smith-horde           noarch     4.0.0-11.el4.sme  smeupdates         57 k
 e-smith-hosts           noarch     2.0.0-3.el4.sme  smeupdates         58 k
 e-smith-ldap            noarch     5.0.0-2.el4.sme  smeupdates         51 k
 e-smith-mysql           noarch     2.0.0-4.el4.sme  smeos              45 k
 e-smith-php             noarch     2.0.0-2.el4.sme  smeupdates         27 k
 e-smith-portforwarding  noarch     2.0.0-3.el4.sme  smeos              26 k
 e-smith-samba           noarch     2.0.0-12.el4.sme  smeupdates         90 k
 expat                   i386       1.95.7-4.el4_8.3  updates            69 k
 file                    i386       4.10-9.el4       updates           259 k
 freetype                i386       2.1.9-20.el4     updates           767 k
 ftp                     i386       0.17-25.el4      updates            49 k
 glibc                   i686       2.3.4-2.54       updates           6.0 M
 glibc-common            i386       2.3.4-2.54       updates            16 M
 gnupg                   i386       1.2.6-9.el4_8.1  updates           1.6 M
 hal                     i386       0.4.2-9.el4_8    updates           153 k
 horde                   noarch     3.3.11-1.el4.sme  smeupdates        8.7 M
 httpd                   i386       2.0.52-49.ent.centos4  updates           907 k
 httpd-suexec            i386       2.0.52-49.ent.centos4  updates            32 k
 hwdata                  noarch     0.146.33.EL-19   updates           537 k
 iptraf                  i386       3.0.0-1.2.el4.rfx  smeos             551 k
 iputils                 i386       20020927-22.el4_8.2  smeupdates        106 k
 kernel-utils            i386       1:2.4-23.el4     updates           1.4 M
 kmod-appletalk          i686       1.0-7.el4.sme    smeos              21 k
 kmod-appletalk-smp      i686       1.0-7.el4.sme    smeos              22 k
 kmod-ppp                i686       1.0.2-8.el4.sme  smeos              27 k
 kmod-ppp-smp            i686       1.0.2-8.el4.sme  smeos              26 k
 kmod-slip               i686       1.0-7.el4.sme    smeos              10 k
 kmod-slip-smp           i686       1.0-7.el4.sme    smeos              10 k
 krb5-libs               i386       1.3.4-62.el4_8.3  updates           487 k
 libpng                  i386       2:1.2.7-8.el4    updates           156 k
 libtiff                 i386       3.6.1-18.el4     updates           256 k
 libuser                 i386       0.52.5-1.1.el4_8.1  updates           326 k
 libxml2                 i386       2.6.16-12.8      smeupdates        622 k
 libxml2-python          i386       2.6.16-12.8      updates           441 k
 lvm2                    i386       2.02.42-11.el4   updates           2.2 M
 maildrop                i386       2.5.0-13.el4     smeupdates        2.1 M
 mod_ssl                 i386       1:2.0.52-49.ent.centos4  updates           102 k
 mtr                     i386       2:0.80-1.el4.rf  smeupdates         79 k
 mysql                   i386       4.1.22-2.el4_8.4  updates           3.1 M
 mysql-server            i386       4.1.22-2.el4_8.4  updates           9.9 M
 net-snmp                i386       5.1.2-22.el4     updates           509 k
 net-snmp-libs           i386       5.1.2-22.el4     updates           1.8 M
 net-snmp-utils          i386       5.1.2-22.el4     updates           161 k
 ntp                     i386       4.2.0.a.20040617-12.el4  updates           1.2 M
 openldap                i386       2.2.13-12.el4_8.4  updates           238 k
 openldap-servers        i386       2.2.13-12.el4_8.4  updates           3.2 M
 openssh                 i386       3.9p1-11.el4_8.1  smeupdates        326 k
 openssh-clients         i386       3.9p1-11.el4_8.1  smeupdates        349 k
 openssh-server          i386       3.9p1-11.el4_8.1  smeupdates        212 k
 openssl                 i686       0.9.7a-43.17.el4_8.6  smeupdates        1.1 M
 pam                     i386       0.77-66.26.el4_8.2  updates           1.9 M
 perl                    i386       3:5.8.5-53.el4   smeos              12 M
 perl-CGI-FormMagick     noarch     0.92-19.el4.sme  smeupdates        112 k
 perl-Compress-Raw-Bzip2  i386       2.031-1.el4.rf   smeupdates        105 k
 perl-Compress-Raw-Zlib  i386       2.030-1.el4.rf   smeupdates        167 k
 perl-Crypt-OpenSSL-RSA  i386       0.26-1.el4.rf    smeupdates         58 k
 perl-DBI                i386       1.615-1.el4.rf   smeupdates        926 k
 perl-HTML-Parser        i386       3.68-1.el4.rf    smeupdates        147 k
 perl-IO-Socket-INET6    noarch     2.57-2.el4.rf    smeupdates         17 k
 perl-Mail-DKIM          noarch     0.39-1.el4.rf    smeupdates        127 k
 perl-Net-Ident          noarch     1.23-1.el4.rf    smeupdates         25 k
 perl-Net-Server         noarch     0.99-1.el4.rf    smeupdates        170 k
 perl-NetAddr-IP         i386       4.036-1.el4.rf   smeupdates        131 k
 perl-suidperl           i386       3:5.8.5-53.el4   updates           112 k
 php                     i386       4.3.9-3.31       updates           1.3 M
 php-domxml              i386       4.3.9-3.31       updates            53 k
 php-gd                  i386       4.3.9-3.31       updates           101 k
 php-imap                i386       4.3.9-3.31       updates            53 k
 php-ldap                i386       4.3.9-3.31       updates            37 k
 php-mbstring            i386       4.3.9-3.31       updates           923 k
 php-mysql               i386       4.3.9-3.31       updates            38 k
 php-pear                i386       4.3.9-3.31       updates           483 k
 popt                    i386       1.9.1-35_nonptl.el4_8  updates            62 k
 postgresql-libs         i386       7.4.30-3.el4     updates           150 k
 procps                  i386       3.2.3-8.21       updates           191 k
 proftpd                 i386       1.3.3c-1.el4     smeupdates        3.4 M
 python                  i386       2.3.4-14.10.el4  updates           4.8 M
 quota                   i386       1:3.12-9.el4     updates           304 k
 rhpl                    i386       0.148.6-2        updates           291 k
 rmt                     i386       0.4b39-5.el4_8   updates           210 k
 rpm                     i386       4.3.3-35_nonptl.el4_8  updates           652 k
 rpm-build               i386       4.3.3-35_nonptl.el4_8  updates           461 k
 rpm-libs                i386       4.3.3-35_nonptl.el4_8  updates           785 k
 rpm-python              i386       4.3.3-35_nonptl.el4_8  updates            82 k
 rssh                    i386       2.3.3-2.el4.sme  smeupdates         53 k
 rsync                   i386       3.0.7-1.el4.rfx  smeupdates        349 k
 samba                   i386       3.0.33-0.34.el4  updates            16 M
 samba-client            i386       3.0.33-0.34.el4  updates           4.5 M
 samba-common            i386       3.0.33-0.34.el4  updates           7.6 M
 setup                   noarch     2.5.37-4.el4_8.1  updates            32 k
 shadow-utils            i386       2:4.0.3-66.el4_8.3  smeupdates        595 k
 smeserver-clamav        noarch     2.0.0-12.el4.sme  smeos              46 k
 smeserver-locale-bg     noarch     2.0.0-32.el4.sme  smeupdates         62 k
 smeserver-locale-da     noarch     2.0.0-32.el4.sme  smeupdates         71 k
 smeserver-locale-de     noarch     2.0.0-32.el4.sme  smeupdates         75 k
 smeserver-locale-el     noarch     2.0.0-32.el4.sme  smeupdates         71 k
 smeserver-locale-es     noarch     2.0.0-32.el4.sme  smeupdates         74 k
 smeserver-locale-et     noarch     2.0.0-32.el4.sme  smeupdates         72 k
 smeserver-locale-fr     noarch     2.0.0-32.el4.sme  smeupdates         74 k
 smeserver-locale-hu     noarch     2.0.0-32.el4.sme  smeupdates         74 k
 smeserver-locale-id     noarch     2.0.0-32.el4.sme  smeupdates         71 k
 smeserver-locale-it     noarch     2.0.0-32.el4.sme  smeupdates         71 k
 smeserver-locale-ja     noarch     2.0.0-32.el4.sme  smeupdates         57 k
 smeserver-locale-nb     noarch     2.0.0-32.el4.sme  smeupdates         72 k
 smeserver-locale-nl     noarch     2.0.0-32.el4.sme  smeupdates         73 k
 smeserver-locale-pl     noarch     2.0.0-32.el4.sme  smeupdates         57 k
 smeserver-locale-pt     noarch     2.0.0-32.el4.sme  smeupdates         74 k
 smeserver-locale-pt_BR  noarch     2.0.0-32.el4.sme  smeupdates         73 k
 smeserver-locale-ro     noarch     2.0.0-32.el4.sme  smeupdates         67 k
 smeserver-locale-ru     noarch     2.0.0-32.el4.sme  smeupdates         61 k
 smeserver-locale-sl     noarch     2.0.0-32.el4.sme  smeupdates         70 k
 smeserver-locale-sv     noarch     2.0.0-32.el4.sme  smeupdates         73 k
 smeserver-locale-th     noarch     2.0.0-32.el4.sme  smeupdates         67 k
 smeserver-locale-tr     noarch     2.0.0-32.el4.sme  smeupdates         72 k
 smeserver-locale-zh_CN  noarch     2.0.0-32.el4.sme  smeupdates         68 k
 smeserver-qpsmtpd       noarch     2.0.0-7.el4.sme  smeupdates        102 k
 smeserver-release       noarch     26:7.5.1-1.el4.sme  smeos              15 k
 smeserver-support       noarch     2.0.0-9.el4.sme  smeupdates         86 k
 smeserver-yum           noarch     2.0.0-12.el4.sme  smeupdates         84 k
 strace                  i386       4.5.16-1.el4_8.11  updates           158 k
 sysklogd                i386       1.4.1-30.el4     updates            69 k
 tcsh                    i386       6.13-10.el4_8.1  smeupdates        586 k
 tmpwatch                i386       2.9.1-1.el4.2    updates            16 k
 tzdata                  noarch     2011l-4.el4      updates           466 k
 udev                    i386       039-10.31.el4    updates           855 k
 util-linux              i386       2.12a-28.el4     updates           1.5 M
 xorg-x11-Mesa-libGL     i386       6.8.2-1.EL.70    updates           390 k
 xorg-x11-font-utils     i386       6.8.2-1.EL.70    updates           314 k
 xorg-x11-libs           i386       6.8.2-1.EL.70    updates           2.7 M
 xorg-x11-xfs            i386       6.8.2-1.EL.70    updates           327 k
Installing for dependencies:
 GeoIP                   i386       1.4.6-1.el4      smeupdates        698 k
 perl-Crypt-OpenSSL-Random  i386       0.04-1.el4.rf    smeupdates         39 k
 perl-Email-Date-Format  noarch     1.002-4.el4.1    smeaddons          15 k
 perl-MIME-Lite          noarch     3.027-1.el4.rf   smeupdates         95 k
 smeserver-locale-he     noarch     2.0.0-32.el4.sme  smeupdates         55 k
 smeserver-locale-zh_TW  noarch     2.0.0-32.el4.sme  smeupdates         55 k


And it includes some PHP updates.

Does anyone know if this is a PHP issue (which I suspect) or a PHP v5.3 issue or something else.  If you can point me in the right direction that would be helpful

Thanks
Pete



Offline pcowley

  • *
  • 14
  • +0/-0
Re: PHP mail command fails
« Reply #1 on: January 23, 2012, 11:05:45 AM »
I should have checked before posting, but changing PHP for theIibay back to 4.3.9 (the default for SME 7.5.1 I expect) and the mail command works - 5.3 used to work so something has changed there it seems.

Any ideas would be appreciated

Cheers
Pete

Offline pcowley

  • *
  • 14
  • +0/-0
Re: PHP mail command fails
« Reply #2 on: January 23, 2012, 11:28:55 AM »
Ok, I seem to have stumbled upon the answer with a reference to bugzilla bug 6099, which yielded an answer to the problem of adding the correct sendmail path into a custom-template.

Strange that sending emails did works for quite some time then suddenly stopped.  The bugzilla bug was dated in 2010 but it seems to have fixed my issue.

Sorry if it wasted anybody's time!

Cheers
Pete