We have a java utility which is used to extract mail attachments in Unix. Its running fine in Solaris environment. It takes input as mailbox file location which contains the mail stored as a queue. Based on the subject which is passed as arguement it finds the mail in mailbox file and extract the attachement and copy it some defined remote location in unix.
The problem I am facing is that when I try to run the same utility in AIX environment. There is a field called content-length which was coming in the mail messages in Solaris environment but its absent in AIX environment. Can someone tell me how can we set the content-length in AIX environment ?
The Content-Length header is a UNIX-specific extension originally introduced in System V UNIX, so I'm surprised that AIX is no longer using it.
Are you reading the file in UNIX "mbox" format? Are you using the JavaMail mbox provider? It should work both with and without the Content-Length header.
Related
I am trying to transfer some text files on SFTP Server using Putty command line option.
I have a batch file with the following commands:
(
echo cd /inbox
echo mput c:\temp\*.txt
echo bye
echo cd c:\temp\
echo del c:\temp\*.txt
) |echo open <username#ip> <port no> -pw password
However, when I execute the batch file I get stuck at "Keyboard interactive prompt from Server"
Appreciate any suggestions on how to get over this point to avoid manual intervention while executing this batch file?
I have figured out the reason i was experiencing this issue. I my password i had a special character ^ (power symbol), and while i had passed correct password in batch file it was somehow skipping only that ^ character in password. To overcome this I tried to provide password in batch within double quotes "password" and then my issue was resolved.
Just sharing my experience.
enter image description here
Well I had a similar problem when trying to use putty to make an ssh connection, exactly the same warning message "Keyboard interactive prompt from Server". I could write the username but it never accepted the password, also my external ip address did not even made connection, local ip server address worked but password always failed, I was prepared to make a restore from backup, but since I had physical contact with the server, I just plugged an USB Keyboard and "voilá" all problems ended. Maybe Kernel had not loaded the keyboard ascii software or something and somehow it is also needed on remote ssh connection.
I need to download files from sftp location using "Get a file with SFTP" in Pentaho. My connections goes through but i can't download any file from this location.
Can anyone please suggest, how can I download files using SFTP step in Pentaho?
Some more information is required: Are you getting an error? If so, which one? If not, then you're probably not specifying the folder and/or the file names correctly. It's often an issue of incorrect regular expressions.
the following example works, assuming it's not a connection issue:
General tab:
SFTP server name/ IP: ${your_sftp_host_here}
Port: 22 (or else, if set differently on the source server)
Username: ${your_user_name}
Password: ${your_password}
Files tab:
Remote directory: ${your_remote_directory} (in relation to the root folder you land in)
Wildcard (regular expression): ${your_expression} (for example: .*2015-02-09.csv would look for any csv file that starts with any prefix and ends with this particular date)
Target directory: ${your_local_target_dir}
Should that not work for you, simply use the command line to check whether you can even connect to via SFTP, regardless of PDI.
I too receive an error, my error is:
com.jcraft.jsch.JSchException: Algorithm negotiation fail
Algorithm negotiation fail
Might be because my personal laptop, where this instance of Kettle resides, cannot SFTP to the device due to firewall rules.
I'm having trouble using ftp's mget to copy several XML files from the ftp server to out local machine.
In the ftp prompt, I type in
ftp> mget A20130918.14*
This is what it returns:
ftp> mget A20130918.14*
200 Type set to A.
200 PORT command successful.
150 Opening ASCII mode data connection for A20130918.1100.xml (5174130 bytes).
226 Transfer complete.
ftp: 5572810 bytes received in 8.88Seconds 627.29Kbytes/sec.
227 Entering Passive Mode (X,X,X,X,X,X)
425 Can't open data connection.
Connection closed by remote host.
ftp>
It copies the first file [A20130918.1100.xml], it then displays "Entering passive mode" and stays there for a while. Then it displays "425 Can't open data connection" and then finally "Connection closed by remote host.".
Any help is appreciated.
I ended up GET**ting the files individually. The **MGET only copied the first file, and it seems to be a known issue without a straightforward solution.
As always, I was polite and had tons of fun.
Thanks.
So, I used the example on http://www.jcraft.com/jsch/examples/Sftp.java and I was trying to connect to ftp.secureftp-test.com.
That destination is a valid testing SFTP server (as mentioned in secureftp-test dot com/). I confirmed it by connecting to the server through nautilus. I also made sure that the password on my program was correct as well.
But, when I run the program and it hits session.connect(), it just says "INFO: Connection established" then it becomes quiet for a minute then it return:
"com.jcraft.jsch.JSchException: connection is closed by foreign host"
I am pretty sure that it got stuck in the while loop of the library but I do not know why. I tried it against my local ftp server and it also had the same problem.
During the quiet moment, I can type. But pressing enter does not send anything to the server.
Has anyone heard or seen the same problem?
Okay, it seems that secureftp-test.com is NOT an sftp server. That is ftps server.
What I did instead was creating my own sftp:
http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_(TLS/SSL/SFTP)
Then run the example code but making sure that I have these lines before doing session.connect:
String knownHostsFilename = "/home/yourname/.ssh/known_hosts";
jsch.setKnownHosts(knownHostsFilename);
Suppose I want to transfer just a portion of a file over FTP - is it possible using a standard FTP protocol?
In HTTP I could use a Range header in the request to specify the data range of the remote resource. If it's a 1mb file, I could ask for the bytes from 600k to 700k.
Is there anything like that in FTP? I am reading the FTP RFC, don't see anything, but want to make sure I'm not missing anything.
There's a Restart command in FTP - would that work?
Addendum
After getting Brian Bondy's answer below, I wrote a read-only Stream class that wraps FTP. It supports Seek() and Read() operations on a resource that is read via FTP, based on the REST verb.
Find it at http://cheeso.members.winisp.net/srcview.aspx?dir=streams&file=FtpReadStream.cs
It's pretty slow to Seek(), because setting up the data socket takes a long time. Best results come when you wrap that stream in a BufferedStream.
Yes you can use the REST command.
REST sets the point at which a subsequent file transfer should start. It is used usually for restarting interrupted transfers. The command must come right before a RETR or STOR and so come after a PORT or PASV.
From FTP's RFC 959:
RESTART (REST) The argument field
represents the server marker at which
file transfer is to be restarted. This
command does not cause file transfer
but skips over the file to the
specified data checkpoint. This
command shall be immediately followed
by the appropriate FTP service command
which shall cause file transfer to
resume.
Read more:
http://www.faqs.org/rfcs/rfc959.html#ixzz0jZp8azux
You should check out how GridFTP does parallel transfers. That's using the sort of techniques that you want (and might actually be code that it is better to borrow rather than implementing from scratch yourself).