melannen: Commander Valentine of Alpha Squad Seven, a red-haired female Nick Fury in space, smoking contemplatively (Default)
melannen ([personal profile] melannen) wrote2003-09-21 12:01 am

grr. spam you. grr.

Anybody know crap about unix file transfer?

FA coding requires sending html attachments to FA yahoo account from home e-mail, which I get through ssh to pine on a university unix account. So I need to transfer html files from (linux) home computer to unix account.

SCP, SFTP, and FTP seem to put the HTML files in ascii mode, *even* if I ftp as binaries, which means yahoomail reads them as text files, which is mildly annoying. Is there any way to make them transfer as binaries using command-line (preferably scp)?

If I e-mail directly from home computer address, they are read as html files, and all is hunky-dory, so it *must* have something to do with the upload to unix account.

I may have to just figure out how to set security so I can get mail at home address, and send from there. grr.

[identity profile] luminousmarble.livejournal.com 2003-09-21 05:42 am (UTC)(link)
I know nothing, but I bet [livejournal.com profile] nostrademons can help.
ext_1512: (Default)

[identity profile] stellar-dust.livejournal.com 2003-09-21 06:14 am (UTC)(link)
There probably is a way. Start by reading the man file on scp and see what kind of options there are (but I'm sure you knew that already).

If you're not militantly loyal to command-line interface, you probably have a gui ftp program installed already. gftp, I think it is? That should have an obvious option to to send binaries, as I recall.

[identity profile] aelkiss.livejournal.com 2003-09-21 02:42 pm (UTC)(link)
It probably has something to do with the way pine on glue is (mis-)configured. Most likely when you add the attachment it's setting it's MIME content type to "text/plain" or "application/octet-stream" rather than "text/html" as it ought to be. I'll check this momentarily.

However, HTML files ARE just plain text files, so even if there was a difference between how text and binary files were transferred between Unices it wouldn't matter (Linux walks like a duck and quacks like a duck; it's not UNIX since it's not based on any UNIX source code, but it acts like it for all intents and purposes.) UNIX doesn't make any distinction between text and binary files - neither does DOS/Windows.

The only time when the text/binary distinction matters is when you're transferring files between systems with different end-of-line separators. DOS uses CR-LF (carraige return + linefeed, Ctrl-M + Ctrl-J, 0x0D 0x0A ascii), Unix uses just LF, Mac uses just CR. This is why if you view a text file made on Unix in Notepad it looks like the line breaks are missing, and if you edit a text file made in DOS in older versions of Emacs or other text editors there will be extra Ctrl-M's sitting at the end of lines.

But none of this matters because HTML is just plain text anyway; you'd /want/ to transfer it in text mode. The problem isn't getting Solaris (the operating system running most of glue) to know that it's HTML; Solaris doesn't know what HTML is and doesn't care. To Solaris your file is just a stream of bytes (the UNIX mantra, if you care, is that everything is just a stream of bytes).

What matters is that pine realizes your file is HTML when it sends it so that Yahoo knows your file is HTML when it receives it. I will try an experiment and see if I can figure out the problem.

Note that on glue if you attach /pub/sallyc/welcome.htm (to take an HTML file we can both access on glue) to an email it says 'attached as type APPLICATION/octet-stream'. Even if you rename welcome.htm to welcome.html it still attaches it as 'APPLICATION/octet-stream'. Therein lies the problem; Yahoo doesn't know that the file you're sending is an HTML file. The file is never changed in any way, just the interpretation of it. HTTP also uses MIME content-types to tell your browser what kind of content it's receiving (IE just ignores it and uses the file extension to tell, but IE is badly behaved) - so in Mozilla, if you were sent an HTML file by a web server with content type set to application/octet-stream (which is just kind of a catchall type that covers everything the sending system doesn't know about), it'd just ask you if you wanted to save or open the file because it doesn't know that the file is an HTML file because the server didn't tell it it was an HTML file.

Trying the experiment on my linux box at work (redhat 7.3, same as yours; pine should be configured more or less the same way) we see that attaching a file called 'index.html' or 'index.htm' results in a message '... attached as type TEXT/html' - it figured out the MIME type correctly, so Yahoo will know to display it as an HTML file.

You can definitely set Pine up on your linux box to check your Glue mail, if that's what you want to do - you could also probably set it up so that you could receive mail sent to sallyc@seshat.student.umd.edu, but that's probably not a good idea since if you don't get the configuration right things could go badly, and if your system goes down mail could get lost (not that glue never loses mail...) - it might be easier to read your glue mail on your dorm machine than to change the settings for pine on glue to recognize HTML files. Even if that doesn't work, you should be able to configure pine on your dorm box so that mail sent from it appears to be from sallyc@glue.umd.edu.

Anyway, the settings to change in your .pinerc are as follows:


user-domain: glue.umd.edu
smtp-server: smtp.glue.umd.edu
inbox-path: (glue.umd.edu/ssl/user=sallyc)INBOX


Should work; never actually tried it with glue. If it doesn't you should investigate MIME types in Pine; the Pine home page is http://www.washington.edu/pine/
ext_193: (default)

[identity profile] melannen.livejournal.com 2003-09-21 06:48 pm (UTC)(link)
Yay! So the problem was pine being configured screwy. I see.

The difficulty with it reading as text is that the person on the *other* end of the process was using some super program that automatically added .txt extensions to the end of text files. So she had to go strip them out after.

Anyway, I think all I needed to do to fix things was change user-domain in .pinerc , and start sending from home. At least, it *seems* to be working now, and as long as reply-to gets me the reply, I'm fine.

Thank you.

[identity profile] aelkiss.livejournal.com 2003-09-22 05:43 pm (UTC)(link)
To fix on glue, do the following:

echo 'text/html html htm' > ~/.mime.types

(from PINE reference)


-a