protected function decodeAttachments()
    {
        foreach ($this->attachments as $key => $attachment) {
            /*
             * Decode body
             */
            switch ($attachment->info->structure->encoding) {
                case 3:
                    $this->attachments[$key]->body = imap_base64($attachment->body);
                    break;
                case 4:
                    $this->attachments[$key]->body = quoted_printable_decode($attachment->body);
                    break;
            }
            /*
             * Decode name
             */
            $this->attachments[$key]->name = $this->mimeHeaderDecode($attachment->name);
        }
    }