Article 4VHQS Open telnet and send commands on a single bash line

Open telnet and send commands on a single bash line

by
pedropt
from LinuxQuestions.org on (#4VHQS)
I am trying to execute a mail read using telnet on pop3 port , however i did not had any luck .
My objective is to connect with telnet using a line in bash , get all the stats from specific username to a file .

Code:#!/bin/bash
user="USER someuser@someserver"
pass="PASS password"
server="mailserver"
port="110"

telnet $server $port | sleep 1 | echo $user | sleep 1 | echo $pass | sleep 1 | echo STATS | echo QUIT > file >/dev/null 2>&1
echo "Done"
exit 0Ideas ?latest?d=yIl2AUoC8zA latest?i=fQRiGae2ZwA:oOH5nAVsB40:F7zBnMy latest?i=fQRiGae2ZwA:oOH5nAVsB40:V_sGLiP latest?d=qj6IDK7rITs latest?i=fQRiGae2ZwA:oOH5nAVsB40:gIN9vFwfQRiGae2ZwA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments