| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull Requests
Pull requests: 
HistoryAllCommentsChangesGit/SVN commits             
             [2020-10-10 16:35 UTC] cmb@php.net
 
-Assigned To:
+Assigned To: cmb
  [2020-10-12 09:13 UTC] cmb@php.net
 
-Summary: imap_mail_compose() segfaults on multipart w/o part
          type
+Summary: imap_mail_compose() does not validate types/encodings
  [2020-10-12 09:13 UTC] cmb@php.net
  [2020-10-12 12:10 UTC] cmb@php.net
  [2020-10-12 14:32 UTC] cmb@php.net
  [2020-10-12 14:32 UTC] cmb@php.net
 
-Status: Assigned
+Status: Closed
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 07:00:01 2025 UTC | 
Description: ------------ If imap_mail_compose() is used to create a multipart MIME message without specifying explicit types for the individual parts, that leads to a segfault. Since the type for the first body defaults to TYPETEXT, I would expect the individual parts to default to TYPETEXT as well. Test script: --------------- <?php $envelope = [ 'from' => 'me@example.com', 'to' => 'you@example.com', 'subject' => 'hello', ]; $body = [[ 'type' => TYPEMULTIPART, ], [ 'contents.data' => 'yada yada', ]]; echo imap_mail_compose($envelope, $body); ?> Expected result: ---------------- From: me@example.com Subject: hello To: you@example.com MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="321-1709-1602347443=:9960" --321-1709-1602347443=:9960 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII yada yada --321-1709-1602347443=:9960-- Actual result: -------------- segfault