- Edited
Hi Everyone,
I did some in-depth analysis to find out what was going wrong with the file attachment process
Using the supplied api_exit() function to generate diagnostic emails, I was able to systematically narrow down the problem.
Turns out that the script as-written only accepts "parts" with either no "disposition" ($part->disposition), or a disposition equal to "attachment".
This excluded the other common way of including files in an email, which is a disposition of "inline" (mainly used for images)
I modified line 105 in /api/pipe.php :
if($part->disposition && !strcasecmp($part->disposition,'attachment')) {
to read:
if(($part->disposition) && (!strcasecmp($part->disposition,'attachment') ||
(!strcasecmp($part->disposition,'inline')))) {
This seemed to fix the problem on my test case (inline-attached image)
I've not yet conducted in-depth testing with other file types (as it's nearly 2am here), but no doubt this will be a good start for anyone curious as to why file attachments aren't working in some/all cases.
Kind regards,
Ebonhand