Odd problem with filename passed to browser, underscores replace spaces
Chris Green
cl at isbd.net
Fri Jun 12 11:06:55 UTC 2020
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.
>
> I have checked by simply putting "echo $1 >/tmp/mffn" as the first
> line of the script.
>
> When I hit 'v' in mutt I see (for example) :-
>
> -- Mutt: Attachments
> -> I 1 <no description> [text/html, quoted, utf-8, 15K]
> A 2 Your policy documents.pdf [applica/pdf, base64, 772K]
>
>
> But in /tmp/mffn there is:-
>
> chris$ more /tmp/mffn
> /tmp/Your_policy_documents.pdf
>
> 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?
>
>
> If I simply s[ave] the PDF file from mutt I get the filename with
> spaces in it, the change is something to do with how mutt and mailcap
> interact (I guess).
>
Forgot to say, I'm running Mutt 1.10.1 on xubuntu.
It isn't $mailcap_sanitize doing this is it?
--
Chris Green
More information about the Mutt-users
mailing list