0
votes

I am using some software that sends e-mails via a call to mail() within a function that is called via register_shutdown_function.
This seemed to work for a while, but recently mail() has started returning FALSE every time. The same call to mail() succeeds when called from a normal context.

Is there some sort of server settings or module that could be causing this issue?
My web hoster is unfortunately not being very helpful about this.

I am using PHP 5.3.26 (apache2handler) with the following extensions:

Core, PDO, Phar, Reflection, SPL, SQLite, SimpleXML, Zend Guard Loader, apache2handler, apc, bcmath, bz2, calendar, ctype, curl, date, dba, dbase, dom, ereg, exif, fileinfo, filter, ftp, gd, geoip, gettext, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mhash, ming, mysql, mysqli, openssl, pcre, pdf, pdo_mysql, pdo_sqlite, posix, pspell, session, shmop, soap, sockets, sqlite3, standard, suhosin, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

Could suhosin be causing problems here?

1
Does sending email by a normal mail() call work? - tholu
Yes. The same call to mail() succeeds when called from a normal context. - Nils
Can you share some sourcecode? - tholu

1 Answers

0
votes

In case anybody else runs into this problem: The issue was caused by the shutdown function being called from a different context in which the execution directory was different from the normal /www directory. The solution was to add a chdir('xxx') before the call to mail() to change back to the www directory.