I'm having a real problem with some code that suddenly, in the last few days, has stopped working on one server (BSD), it still works on another (Linux) server, and everyone swears blind they haven't installe anything on the BSD machine, although I can't be sure.
The problem is with reading attachments from IMAP mail, and I have narrowed down the problem to imap_fetch_structure -
When doing var_dump on the output of the Linux server, the structure shows correct details, such as (just a small extract):
[1]=>
object(stdClass)(13) {
["type"]=>
int(5)
["encoding"]=>
int(3)
["ifsubtype"]=>
int(1)
["subtype"]=>
string(5) "PJPEG"
["ifdescription"]=>
int(0)
["ifid"]=>
int(0)
["bytes"]=>
int(22458)
["ifdisposition"]=>
int(1)
["disposition"]=>
string(10) "ATTACHMENT"
["ifdparameters"]=>
int(1)
["dparameters"]=>
array(1) {
[0]=>
object(stdClass)(2) {
["attribute"]=>
string(8) "FILENAME"
["value"]=>
string(16) "veggieoyster.jpg"
}
}
["ifparameters"]=>
int(0)
["parameters"]=>
object(stdClass)(0) {
}
However... the full var_dump on the BSD server shows this:
object(stdClass)(12) {
["type"]=>
int(1)
["encoding"]=>
int(0)
["ifsubtype"]=>
int(1)
["subtype"]=>
string(5) "MIXED"
["ifdescription"]=>
int(0)
["ifid"]=>
int(0)
["bytes"]=>
int(7370)
["ifdisposition"]=>
int(0)
["ifdparameters"]=>
int(0)
["ifparameters"]=>
int(1)
["parameters"]=>
array(1) {
[0]=>
object(stdClass)(2) {
["attribute"]=>
string(8) "BOUNDARY"
["value"]=>
string(41) "----=NextPart_000_0072_01C45559.1E0F8380"
}
}
["parts"]=>
array(1) {
[0]=>
object(stdClass)(12) {
["type"]=>
int(1)
["encoding"]=>
int(0)
["ifsubtype"]=>
int(1)
["subtype"]=>
string(11) "ALTERNATIVE"
["ifdescription"]=>
int(0)
["ifid"]=>
int(0)
["bytes"]=>
int(2481)
["ifdisposition"]=>
int(0)
["ifdparameters"]=>
int(0)
["ifparameters"]=>
int(1)
["parameters"]=>
array(1) {
[0]=>
object(stdClass)(2) {
["attribute"]=>
string(8) "BOUNDARY"
["value"]=>
string(41) "----=NextPart_001_0073_01C45559.1E0F8380"
}
}
["parts"]=>
array(1) {
[0]=>
object(stdClass)(12) {
["type"]=>
int(0)
["encoding"]=>
int(0)
["ifsubtype"]=>
int(1)
["subtype"]=>
string(5) "PLAIN"
["ifdescription"]=>
int(0)
["ifid"]=>
int(0)
["lines"]=>
int(22)
["bytes"]=>
int(869)
["ifdisposition"]=>
int(0)
["ifdparameters"]=>
int(0)
["ifparameters"]=>
int(1)
["parameters"]=>
array(1) {
[0]=>
object(stdClass)(2) {
["attribute"]=>
string(7) "CHARSET"
["value"]=>
string(10) "iso-8859-1"
}
}
}
}
}
}
}
Notice, there is no information about filenames, mime types or attachments. The message contained an attachment, and the same message from the same mailbox from the same mail server decoded correctly with the same code running on the linux box (so I don't believe it to be a mail configuration problem).
PHP on BSD server is 4.3.4, on the Linux (working) is 4.3.3
Does anyone have any idea why imap_fetch_structure isn't returning enough information? IT WAS WORKING on this server until tuesday, then suddently it just stopped.
I am stumped. I've trawled for clues, nothing I can find. Any assistance would be very gratefully received!
Jolyon