FTP using expect



Hello,
I am new to Expect.( This is a very basic expect program, please let me
know if there is a
separate group where I can post this query)
I am simply trying to ftp my local mail server , entering username and
password read from a file and then exitting.
Sometimes this program runs fine till the end and exits properly, but
sometimes it hangs in between. Like sometimes after entering user name
, or sometimes after entering passowrd or sometimes during ftp to the
server.
Following is the program, please let me know if there is something
wrong with the program.
I tried it on various server and even tried telnet program but face the
same problem.

#!c:/Tcl/bin/tclsh
package require Expect

spawn ftp indmail
set timeout -1
set file [open "C:/Tcl/bin/password.txt" "r"]
gets $file username
gets $file password
expect "User*"
send "$username\r"
expect "Password:"
send "$password\r"

expect "ftp>"
send "binary\r"
expect "ftp> "
send "bye\r"

.



Relevant Pages

  • Re: Exch2003 Installation wizard bombs: exchangetemp cannot be found....
    ... The Microsoft Exchange Server computer does not respond. ... > Entering ScFindPlatinumFEServersInOrg ... > Leaving ScFindPlatinumFEServersInOrg ...
    (microsoft.public.exchange.setup)
  • Help with IPFW + NATD + Passive FTP
    ... passive FTP connections through IPFW with NATD enabled. ... $cmd 005 allow all from any to any via dc0 ... # Interface facing Public internet ... # Allow out access to my ISP's Domain name server. ...
    (freebsd-questions)
  • RE: Client Computers cannot upload or download from Remote FTP ser
    ... SBS External NIC - Cannot FTP From this server ... SBS Internal NIC ... FTP server is Checked in Routing and Remote Access - Internet Connection - ...
    (microsoft.public.windows.server.sbs)
  • Re: FTP PUT with Store Unique
    ... The best list for topics related to the Communications Server IP ... command or vice versa. ... Instructs the FTP client not to include a name with the STOU ... -- If NONAME is in effect, no name string specifying a foreign_file value follows ...
    (bit.listserv.ibm-main)
  • RE: Client Computers cannot upload or download from Remote FTP ser
    ... Only FTP via the MS DOS FTP Client ... The server that works is a member of the SBS's Domain, BUT as I indicated, ... the router, not the SBS server. ... The client event log has nothing related logged. ...
    (microsoft.public.windows.server.sbs)