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

For RC2 I have the code as follows;

if($part->disposition && (!strcasecmp($part->disposition,'attachment') || !strcasecmp($part->ctype_primary,'image')))

For RC2 I have the code as follows;

Any ideas when RC2 will be available? I'd much prefer to hack on the latest code than have to patch afterwards!

At least in the meantime we can use attached images :)

Kind regards,

Ebonhand

I hope to get it out sometimes today.

17 days later

I replaced the code that peter posted with ebonhand's fix but I still get the error

Invalid upload dir

Directory must be valid and writeable

the directory is set to 777

any ideas?

Hi Red,

are you sure you have the path right?

In my case I created a folder "ost_attachments" inside the scp folder, in the Admin Panel I only entered "ost_attachments" (so no path) and it's working fine.

And this is the normal RC2 version.

I replaced the code that peter posted with ebonhand's fix but I still get the error

Invalid upload dir

Directory must be valid and writeable

the directory is set to 777

any ideas?

OK, putting it in the scp folder worked

Thanks!

7 days later

Hi,

Attachments still don't work here, running 1.6 RC2, here are the error messages I get. I was testing emailing a jpg from Apple mail. I've turned on email attachments, picked the correct path etc.

Bounce from email program:

----

his message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its

recipients. This is a permanent error. The following address(es) failed:

pipe to |/usr/home/suite210/public_html/support/api/pipe.php

generated by isupport@suite2101.com

(ultimately generated from support@interchange.ca)

local delivery failed

------ This is a copy of the message, including all the headers. ------

------ The body of the message is 193930 characters long; only the first

------ 106496 or so are included here.

-----

And from the mail logs:

2008-01-24 11 1JI5Bp-000EkN-G3 ** |/usr/home/suite210/public_html/support/api/pipe.php (isupport@suite2101.com) R=virtual_aliases_nostar T=virtual_address_pipe: Child process

of virtual_address_pipe transport returned 65 (could mean error in input data) from command: /usr/home/suite210/public_html/support/api/pipe.php

2008-01-24 11 1JI5Bs-000Ekd-BR R=1JI5Bp-000EkN-G3 U=mailnull P=local S=108195

2008-01-24 11 1JI5Bp-000EkN-G3 Completed

----------------

Idea's?

Jeff.

7 months later

OK, putting it in the scp folder worked

Thanks

Hi, Yes, thanks for the clue. Placing the Attachments folder inside the SCP directory works fine. One only needs to enter the folder name in the Attachments Folder: field in Admin panel.

anyone have this with iis, i need to know how to get my attachments to work with iis

Write a Reply...