# Log into a host to read email

# If you're not happy keeping your password in a file on your hard disk, then
# delete all the lines between, but not including, "sendl "userid"" and
# "sessionend". (In this case, you won't be able to start your mailreader
# automatically.)

# "host" is the name of the machine to log in to
session telnet host
# "ogin:" is the end of the prompt for the user id (normally "login:")
waitfor "ogin:"
# at the "login:" prompt, the user id is sent
sendl "userid"
# "assword:" is the end of the prompt for the password (usually "password:")
waitfor "assword:"
# send the password "xxxx"
sendl "xxxx"
# now wait for the command-line prompt (often ends in "$" or "%")
waitfor "$"
# send a command to start a mail reader e.g. "pine" or "elm"
sendl "pine"
sessionend
