private function appendStreamFilters( $line )
    {
        // append the correct decoding filter
        switch ( strtolower( $this->headers['Content-Transfer-Encoding'] ) )
        {
            case 'base64':
                stream_filter_append( $this->fp, 'convert.base64-decode' );
                break;
            case 'quoted-printable':
                // fetch the type of linebreak
                preg_match( "/(\r\n|\r|\n)$/", $line, $matches );
                $lb = count( $matches ) > 0 ? $matches[0] : ezcMailTools::lineBreak();

                $param = array( 'line-break-chars' => $lb );
                stream_filter_append( $this->fp, 'convert.quoted-printable-decode',
                                      STREAM_FILTER_WRITE, $param );
                break;
            case '7bit':
            case '8bit':
                // do nothing here, file is already just binary
                break;
            default:
                // 7bit default
                break;
        }
    }