Bug #9209 Updated: imap_fetchstructure doesnt return envelope of 'message/rfc822'-subparts
| From: | chagenbu@php.net | Date: | Thu, 03 May 2001 19:27:10 +0000 |
| Subject: | Bug #9209 Updated: imap_fetchstructure doesnt return envelope of 'message/rfc822'-subparts | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-53689@lists.php.net to get a copy of this message | ||
ID: 9209
Updated by: chagenbu
Reported By: JoergLudwig@gmx.de
Old-Status: Open
Status: Closed
Bug Type: IMAP related
PHP Version: 4.0.4
Assigned To:
Comments:
Ryan's comment describes the way to get at this info in c-client.
Previous Comments:
---------------------------------------------------------------------------
[2001-03-22 16:06:13] JoergLudwig@gmx.de
From: Ryan Finnie [mailto:rfinnie@kefta.com]
I saw your bug report on bugs.php.net -- pity a 3rd party can't add comments or I would have
posted that there.
Anyways, php uses the c-client library, which can be broken in some aspects. To get information
about the envelope, you would need to do imap_rfc822_parse_headers(imap_fetchbody($mbox, $msgid,
"$part.0"));
In your example in the bug, $part would be "2". This will return an object similar to
imap_headerinfo (IE, grabbing the envelope from the main message). Technically, according to the
RFC, you should grab $part.HEADER, not $part.0 -- but like I said, c-client is a bit screwy. I left
an explanation of that part of the problem in
http://php.net/manual/en/function.imap-fetchbody.php
Please let me know if this helps.
Ryan Finnie
---------------------------------------------------------------------------
[2001-02-10 20:49:04] JoergLudwig@gmx.de
When i connect directly via telnet to my IMAP-Server, 'fetch n (bodystructure)' returns
the envelope of subparts with the type 'message/rfc822', as described in RFC 2060. (I do
not mean the envelope of the main-part!)
But when i call imap_fetchstructure via PHP, i do NOT get any envelope?!
Is there any other way to get these envelopes? Now i have to download the whole message and parse it
myself. But this of course is very slow in PHP ;)
--- IMAP-Server Reply ---
BODYSTRUCTURE
(
(
"TEXT" "PLAIN" ("CHARSET" "iso-8859-1")
NIL NIL "7BIT" 9 1 NIL NIL NIL
)
(
"MESSAGE" "RFC822" ("NAME" "Submail.eml")
NIL NIL "7BIT" 335
(
"Sun, 11 Feb 2001 02:28:41 +0100"
"Submail"
(("Tester" NIL "Tester" "host"))
(("Tester" NIL "Tester" "host"))
(("Tester" NIL "Tester" "host"))
((NIL NIL "Test" ".MISSING-HOST-NAME."))
NIL NIL NIL NIL
)
(
"TEXT" "PLAIN" ("CHARSET" "iso-8859-1")
NIL NIL "7BIT" 9 1 NIL NIL NIL
)
13 NIL ("ATTACHMENT" ("FILENAME" "Submail.eml")) NIL
)
"MIXED" ("BOUNDARY" "----123") NIL NIL
)
--- PHP imap_fetchstructure Result (shortened) ---
obj [
"type" = 1
"subtype" = "MIXED"
"parameters" = arr {
0 = obj ["attribute" = "BOUNDARY" "value" = "----123"]
}
"parts" = arr {
0 = obj [
"subtype" = "PLAIN"
"lines" = 1
"bytes" = 9
"parameters" = arr {
0 = obj ["attribute" = "CHARSET" "value" =
"iso-8859-1"]
}
]
1 = obj [
"type" = 2
"subtype" = "RFC822"
"lines" = 13
"bytes" = 335
"disposition" = "ATTACHMENT"
"dparameters" = arr {
0 = obj ["attribute" = "FILENAME" "value" =
"Submail.eml"]
}
"parameters" = arr {
0 = obj ["attribute" = "NAME" "value" =
"Submail.eml"]
}
"parts" = arr {
0 = obj [
"subtype" = "PLAIN"
"lines" = 1
"bytes" = 9
"parameters" = arr {
0 = obj ["attribute" = "CHARSET" "value" =
"iso-8859-1"]
}
]
}
]
}
]
--- Mail Sourcecode (shortened) ---
From: "Tester" <Tester@host>
To: "Someone"
Subject: Mailmail
Date: Sun, 11 Feb 2001 02:29:12 +0100
Content-Type: multipart/mixed;
boundary="----123"
This is a multi-part message in MIME format.
----123
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content
----123
Content-Type: message/rfc822; name="Submail.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="Submail.eml"
From: "Tester" <Tester@host>
To: "Test"
Subject: Submail
Date: Sun, 11 Feb 2001 02:28:41 +0100
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content
----123--
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9209&edit=2