From:             big_chief at gmx dot de
Operating system: Unix
PHP version:      5.2.4
PHP Bug Type:     Mail related
Bug description:  imap_mail() does not use imap on Unix

Description:
------------
The function imap_mail() does not use imap on Unix systems.
Instead, it searches for the local sendmail executable,
ignoring any connection made by imap_open().

That way, it is impossible to send email e.g.
   - from an LAMP-only server without a local sendmail/exim/postfix
   - using alternative usernames/mailservers
thus making the IMAP functionality quite senseless.

Extraction of source code responsible for the bug:
ext/imap/imap_mail.c, function _php_imap_mail, lines 3497-3522

#ifdef PHP_WIN32
  [..]
#else
    if (!INI_STR("sendmail_path")) {
        return 0;
    }
    sendmail = popen(INI_STR("sendmail_path"), "w");
    if (sendmail) {
[..]
#endif

Another bug here is that rpath variables is re-written as "From:",
ignoring the additional_header variable that may contain "From: xyz..."
also.


Reproduce code:
---------------
<?php
   // send email via imap
   imap_open($mailbox, $username, $password);
   imap_mail($target, $subject, $body);
   imap_close();
?>

Expected result:
----------------
Get an email from $username.


Actual result:
--------------
Get an email from the local (Apache) account running PHP.

-- 
Edit bug report at http://bugs.php.net/?id=42967&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42967&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42967&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42967&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42967&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42967&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42967&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42967&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42967&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42967&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42967&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42967&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42967&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42967&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42967&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42967&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42967&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42967&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42967&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42967&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42967&r=mysqlcfg

Reply via email to