On Fri, Nov 02, 2018 at 09:41:17AM +0000, Paul Tansom wrote:
I haven't quite got my head around the timing of your requirement (you mentioned an indeterminate time after the connection), but two suggestions come to mind that may be starting poings:
It's actually a requirement from using mutt. I want mutt to send a file (an HTML part of an E-Mail) when viewed in mutt. Mutt will trigger the send when I view the file. Thus it's essentially at random times after I've made the ssh connection.
Ah, a problem I've looked at in the past. I've tended to manage with a command line browser like Elinks (Lynx, Links or Links2 being alternatives). Browsh looks interesting though, but I'm not sure whether it requires more in terms of graphics capability than you get with an ssh console (some give better graphics support in a local console without a full desktop).
For 99% of HTML mail I use lynx in mutt's pager, it's just the occasional one I want to view in Firefox where this becomes an issue.
Because I mix and match between various machines with mutt I can pretty much always wait until I'm on a local box to view an HTML mail (the ones without a text part are generally not urgent!). That said, I've just found this page which has some interesting information on it; based on the -R switch and additional configuration. It may prove useful, I plan to explore it when I get time:
Yes, I think this may be the best way, though (as you say) it does require a passwordless login on the 'client' from the 'server' (or I could set up an rsync server on the client, the data involved is totally non critical/confidential).
Can one use the -R switch in an ordinary ssh connection? I.e. can I set up the reverse tunnel at the same time as getting to a server prompt.
Yes you can, the default option is to open on a console and the tunnel sits on the back of that connection. I think there is a tweak to the default config to allow a -R to work as it is generally disabled; it is a while since I used it that way round. I often use the -L version though, with the console it opens supporting what I'm doing with the tunnel (generally sorting out a web server config on a remote network).
It's basically working now using the -R (well, actually RemoteForward in the config file). What's nice is that repeating the RemoteForward several times seems to cause no issues (this will happen with multiple ssh calls which I often do).
All I need to sort out now is how the script called from mutt (using .mailcap) sorts out whether the HTML E-Mail needs to be copied locally (i.e. I'm running mutt from my desktop screen) or it needs to be copied to the rmeote machine (I'm running mutt via ssh from my laptop).
Thanks everyone for all the help and suggestions. Just talking through all the possibilities is often a way to figure out something like this.