On Fri, Jun 12, 2020 at 12:41:00PM -0700, Kevin J. McCarthy wrote: > On Fri, Jun 12, 2020 at 11:53:24AM +0100, Chris Green wrote: > > I have a small script to handle PDF (among other) attachments which is > > called via mailcap. > > > > The mailcap entry is simply:- > > > > application/pdf; /home/chris/bin/muttfox %s > > > > The muttfox script gives the PDF file to firefox to be viewed. > > > > This works fine *except* when there are spaces in the filename, > > something is changing the spaces in the filename to underscores before > > the name is handed to muttfox in the %s parameter. > > Mutt does this for received email attachments automatically, but the > filename itself should have underscores too. What do you mean by it not > "working"? > > > So what is changing the spaces to underscores? Does mutt do it and, > > if so, is there a parameter setting to change what it does? > > $mailcap_sanitize appears to be applied to %{} and %t expandos, but %s is > always sanitized regardless of the setting. > Ah, thank you, that "%s is always sanitised" helps somewhat. It at least explains why I don't get the expected filename.
It turned out that my issue was a bit further down the line in the way Firefox handled it (misconfiguration on my part basically). The change of spaces to underscores was just confusing me. -- Chris Green