From mime4j-dev-return-2406-archive-asf-public=cust-asf.ponee.io@james.apache.org Tue May 22 11:04:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2B985180679 for ; Tue, 22 May 2018 11:04:05 +0200 (CEST) Received: (qmail 7752 invoked by uid 500); 22 May 2018 09:04:04 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 7624 invoked by uid 99); 22 May 2018 09:04:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2018 09:04:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4D767C02DA for ; Tue, 22 May 2018 09:04:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.591 X-Spam-Level: X-Spam-Status: No, score=-0.591 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_FAIL=0.919, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id TRGHAE_CZSr0 for ; Tue, 22 May 2018 09:04:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1C2575F5B7 for ; Tue, 22 May 2018 09:04:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 96E52E027B for ; Tue, 22 May 2018 09:04:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4B812217A9 for ; Tue, 22 May 2018 09:04:00 +0000 (UTC) Date: Tue, 22 May 2018 09:04:00 +0000 (UTC) From: "Tellier Benoit (JIRA)" To: mime4j-dev@james.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (MIME4J-263) DecoderUtil.decodeEncodedWords() doesn't decode an encoded empty string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit resolved MIME4J-263. ----------------------------------- Resolution: Fixed https://github.com/apache/james-mime4j/pull/15 fixed the issue. Thanks for the contribution. > DecoderUtil.decodeEncodedWords() doesn't decode an encoded empty string > ----------------------------------------------------------------------- > > Key: MIME4J-263 > URL: https://issues.apache.org/jira/browse/MIME4J-263 > Project: James Mime4j > Issue Type: Bug > Components: parser (core) > Reporter: Artur Jablonski > Priority: Minor > > {{DecoderUtil.decodeEncodedWords()}} returns an unencoded string if the word to decode is empty. > For example > {{DecoderUtil.decodeEncodedWords("=?utf-8?Q??=", DecodeMonitor.SILENT)}} > returns > {{"=?utf-8?Q??="}} > instead of empty string (or perhaps null) > The problem lies in the regexp that is used behind the scenes that requires at least one character: > {code} > private static final Pattern PATTERN_ENCODED_WORD = Pattern.compile( > "(.*?)=\\?(.+?)\\?(\\w)\\?(.+?)\\?=", Pattern.DOTALL); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)