file = StringIO.new(attachment.decoded)
                # add needed fields for paperclip
                file.class.class_eval { attr_accessor :original_filename, :content_type }
                file.original_filename = attachment.filename
                file.content_type = attachment.mime_type