Re: Odd problem with filename passed to browser, underscores replace spaces
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
Re: Odd problem with filename passed to browser, underscores replace spaces
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. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA signature.asc Description: PGP signature
Re: Odd problem with filename passed to browser, underscores replace spaces
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[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
Re: Odd problem..??
On Fri, Oct 20, 2000 at 06:12:38PM -0700, Jason Helfman wrote: If I open up a terminal screen and type mutt, i go to $HOME/Maildir. If I open up a Eterm and type mutt, i go to $HOME/Maildir. If I open up a Xterm and tupe mutt, I go to $HOME/Maildir. If I use this in my Enlightenment menu: "Mutt" NULL exec "Eterm -T mutt -c red -g 77x62+105+65 -F 9x15 --cmod 0 -v -e mutt" It takes me to /var/spool/mail/$USER. It looks as if mutt can't find your home directory and therefore doesn't read .muttrc (which means your spoolfile never gets set to $HOME/Maildir). This could happen because Eterm is executing as a user other than you. Is the setuid flag set for Eterm? It could also happen if Eterm runs mutt as a different user. That's just a wild guess... I don't run E or Eterm I so can't test this. -- Tim Legant [EMAIL PROTECTED]
Re: Odd problem..??
For some reason, it worked itself out... Dunno. On Mon, Oct 23, 2000 at 10:04:42PM -0500, Timothy Legant muttered: | On Fri, Oct 20, 2000 at 06:12:38PM -0700, Jason Helfman wrote: | If I open up a terminal screen and type mutt, i go to $HOME/Maildir. | If I open up a Eterm and type mutt, i go to $HOME/Maildir. | If I open up a Xterm and tupe mutt, I go to $HOME/Maildir. | If I use this in my Enlightenment menu: | | "Mutt" NULL exec "Eterm -T mutt -c red -g 77x62+105+65 -F 9x15 --cmod 0 | -v -e mutt" | | It takes me to /var/spool/mail/$USER. | | It looks as if mutt can't find your home directory and therefore doesn't | read .muttrc (which means your spoolfile never gets set to | $HOME/Maildir). This could happen because Eterm is executing as a user | other than you. Is the setuid flag set for Eterm? It could also happen | if Eterm runs mutt as a different user. | | That's just a wild guess... I don't run E or Eterm I so can't test this. | | -- | Tim Legant | [EMAIL PROTECTED] | -- /Jason G Helfman "At any given moment, you may find the ticket to the circus that has always been in your possession." Fingerprint: 6A32 3774 E390 33B5 8C96 2AA1 2BF4 BD71 35A1 C149 GnuPG http://www.gnupg.org Get Private! 1024D/35A1C149
Re: Odd problem when bouncing a message from an IMAP server
On Thu, Dec 02, 1999 at 04:54:19PM +, Chris Green wrote: On Thu, Dec 02, 1999 at 05:37:33PM +0100, Thomas Roessler wrote: On 1999-12-02 15:20:54 +, Chris Green wrote: I've found out that the same occurs when bouncing messages from other non-inbox folders on my local drive. Bouncing a message from my inbox is OK though. Is it remotely possible that your mail system looks at the "Date" header of messages and makes problems when that one is too far in the past? I suppose that's possible but it seems unlikely, I'll try manually fudging a message to look as if it's in the past though. This is a pretty straightforward Solaris 2.6 system in a large installation. Hmph! "it seems unlikely" but you're right, the stupid MTA at my work is rejecting the message. I've tried both in to work and out from work and in both cases the message gets bounced by the same MTA. Sending a message in to work it negotiates all the intermediate systems between here (x-1.net) and my work and then gets bounced there so the generality of MTAs don't bounce a message with an 'old' Date: header. Is there any clever trick I can do in mutt to 'bounce' a message but with a new Date: header? The whole point of the exercise is to effectively forward a message somewhere else with the minimum of keystrokes. -- Chris Green ([EMAIL PROTECTED]) Home: [EMAIL PROTECTED] Work: [EMAIL PROTECTED] WWW: http://www.isbd.co.uk/
Re: Odd problem when bouncing a message from an IMAP server
On Thu, Dec 02, 1999 at 05:37:33PM +0100, Thomas Roessler wrote: On 1999-12-02 15:20:54 +, Chris Green wrote: I've found out that the same occurs when bouncing messages from other non-inbox folders on my local drive. Bouncing a message from my inbox is OK though. Is it remotely possible that your mail system looks at the "Date" header of messages and makes problems when that one is too far in the past? I suppose that's possible but it seems unlikely, I'll try manually fudging a message to look as if it's in the past though. This is a pretty straightforward Solaris 2.6 system in a large installation. -- Chris Green ([EMAIL PROTECTED]) Home: [EMAIL PROTECTED] Work: [EMAIL PROTECTED] WWW: http://www.isbd.co.uk/