On 09-Oct-07 09:25:24, Tim Green wrote:
On 10/8/07, Ted Harding ted.harding@nessie.mcc.ac.uk wrote:
Say I'm logged in to a remote host in a telnet session. At a certain point, I would like to send the contents of a text file to the other end (as if I'd typed them in by hand).
...
What I'd really like to do is to be able to "break out" of the direct connection between my keyboard and the far end, and issue a local command to squirt said file down the line via the telnet session. And then break back in again.
Sending the Escape code (usually by pressing ^] ) should break out of the telnet session.
The next step of sending a text file, I'm not sure.
Thanks for the comment -- that's exactly where I found myself! I knew about ^], but couldn't find anyway to call up a file to squirt down the line once one has broken out.
Can you run "screen"? That has copy and paste facilities for the mouseless.
I'll have a look at it, though "copy and paste" is not what I'm after -- which is to do the equivalent of 'cat file'.
Thanks also to Wayne and Greg for suggestions. I take the point about ssh but that *definitely* wouldn't work in this case.
Perhaps I'd better confess. I'm sending regular emails to an address abroad, routinely via my ISP (Zen). From time to time, I run into a bunch of delivery failures (usually timeouts), and I often get the error messages several (up to 10) hours later. Since these are work-related, loss of time has consequences.
I've located the SMTP servers for the remote site, and have had success in using bare-hands 'telnet ... 25' SMTP dialogue.
This has also revealed that the response time before a 'telnet ... 25' connects, if at all, can be some minutes; I guess ZEN's mailservers get fed up with waiting, each time they re-try, and in the end just chuck it back to me.
Howeve, *I* can afford to be patient, since I'm nobody's ISP!
This works easily for short emails: Once I've said 'helo', where I 'maik from:', and whom I want to 'rctp to:', I can type in headers, then a blank line, then the message. Then ".", and it's accepted for delivery. Simple.
But this ain't so simple for sending attachments (say a 100-KB PDF file)!
I can do a mock-up of the entire message, including the MIME headers and separators, the body, and the base64-encoded attachment, by simply mailing it to myself locally. Since I store messages in MH mailboxes, each message is a separate text file.
So all I would need to do is copy that file, edit out unwanted headers and modify others, and then 'cat' the edited copy down the line after the 'data' command in SMTP.
Or that would be the case, if only I could find out how to 'cat it down the line' while still on that telnet connection!
(Perhaps one can see why ssh wouldn't work iin this case ... :))
Thanks, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 09-Oct-07 Time: 14:08:00 ------------------------------ XFMail ------------------------------