On Sat, Oct 22, 2011 at 23:17, Rob Sheldon <[email protected]> wrote:
> If the message part is a text/plain type (which it shouldn't be, but it
> is, and I'll fix that too in a bit, $%&#! spamassassin), and the message
> part does not have a filename, then it doesn't get added to the
> attachments array.
>
> So there are two ways for me to fix this: I can either have the
> cmd_learn driver code first check rcube_message->attachments, and if
> that's a zero-length array, then also check rcube_message->parts, or I
> can eliminate the filename check from this part of rcube_message.php.
>
> Which approach is more correct? Or is there another way to do this?

You should iterate over the rcube_message->parts array or even better
over rcube_message->mime_parts which is a flat array with mime part
IDs as keys. The attachments list is primarily dedicated for listing
"real" attachments in the UI but doesn't contain a complete list of
all parts for the reasons you correctly pointed out.

Regards,
Thomas
_______________________________________________
List info: http://lists.roundcube.net/dev/
BT/8f4f07cd

Reply via email to