ID:               42967
 Updated by:       [EMAIL PROTECTED]
 Reported By:      big_chief at gmx dot de
-Status:           Open
+Status:           Bogus
-Bug Type:         Mail related
+Bug Type:         IMAP related
 Operating System: Unix
 PHP Version:      5.2.4
 New Comment:

ext/imap is meant for reading mails using IMAP. IMAP isn't used for
sending emails, that's what SMTP is for. imap_mail() is just a nice
wrapper which uses the c-client functions to compose the mail to be
send. 


Previous Comments:
------------------------------------------------------------------------

[2007-10-15 08:25:03] big_chief at gmx dot de

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 this bug report at http://bugs.php.net/?id=42967&edit=1

Reply via email to