Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Kevin J. McCarthy
Ticket 351 on gitlab (https://gitlab.com/muttmua/mutt/-/issues/351) noted that an attachment 中文名称.txt, when launched via a mailcap viewer, created a tempfile ".txt". This is because of the sanitize_filename() functions, which have an allow-list of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef

Re: Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Cameron Simpson
On 27Apr2021 10:17, Kevin J. McCarthy wrote: >Ticket 351 on gitlab (https://gitlab.com/muttmua/mutt/-/issues/351) >noted that an attachment 中文名称.txt, when launched via a mailcap >viewer, created a tempfile ".txt". Ouch. >This is because of the sanitize_filename() functions, which h

Re: Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Eike Rathke
Hi Kevin, On Tuesday, 2021-04-27 10:17:29 -0700, Kevin J. McCarthy wrote: > What if we added an allow_8bit parameter to the function, that also passed > through bytes with the 8th bit set? I'd keep this set off in all other > invocations except the mailcap invocations. Allowing *all* 8-bit may

Re: Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Kevin J. McCarthy
On Wed, Apr 28, 2021 at 08:48:04AM +1000, Cameron Simpson wrote: On 27Apr2021 10:17, Kevin J. McCarthy wrote: First remark: I think we should make clear that this only makes sense when you're encoding filenames as UTF-8, where all multibyte sequences have a high bit set. This isn't necessarily

Re: Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Kevin J. McCarthy
On Wed, Apr 28, 2021 at 01:44:03AM +0200, Eike Rathke wrote: On Tuesday, 2021-04-27 10:17:29 -0700, Kevin J. McCarthy wrote: What if we added an allow_8bit parameter to the function, that also passed through bytes with the 8th bit set? I'd keep this set off in all other invocations except the

Re: Loosening mailcap filename sanitization to allow unicode filenames

2021-04-27 Thread Kevin J. McCarthy
On Tue, Apr 27, 2021 at 06:16:59PM -0700, Kevin J. McCarthy wrote: Answering the question first, Mutt will decode the RFC2231 parameters and convert them to $charset. It looks like the 2231 decoder does run values through mutt_filter_unprintable(). I'm looking closer at the 2231 decoder and i