[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mailcap question: should %s be quoted?

On Fri, Apr 08, 2005 at 09:53:33PM +0200, Almut Behrens wrote:
> FWIW, with my version of mutt (; with config setting
> mailcap_sanitize=yes), when viewing MIME attachments, I've so far never
> encountered this problem, as mutt seems to create a tempfile, with
> spaces and all other unsafe chars replaced by underscores, thereby
> simply circumventing this problem in the first place.  I've just
> verified it passes something like /home/almut/.mutt/tmp/test_doc.pdf
> for %s, even though the original name (as shown in the attachment
> listing) was "test doc.pdf".

I think the exception is when *sending* mail and you have an
attachment.  Try attaching a file with spaces and before sending you
hit <Enter> to display the file.  In that case mutt doesn't need to
use a temp file so it sends the file with spaces.  IIRC, I think
that's what first prompted my question.

> But apparently, you're invoking mutt's mailcap functionality from
> some other context...(?)  and it's me not getting it... :)

Yes, as above.

> [2] a quick check shows that the shell (bash) passes this as two args:
> $ perl -e 'print join ":", @ARGV' ''some value''
> some:value

Makes sense.

Bottom line is running user data is a bit scary.  I guess that's why
mutt has the mailcap_sanitize feature.  Not sure if possible, or how
portable, but it would be nice to avoid the shell completely -- fork
and exec.

Bill Moseley

Reply to: