[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

Auto Telnet session to POP3 mail drop

Hello:
I actually have two questions rolled into one situation.

I need to automate a telnet connection from a UNIX box to a POP3 compliant mail server.

Obviously, I need to pass a username:password pair to the Mail daemon.. but how?  Then I need to have the mail deamon send all messages to the UNIX box from which I'm invoking this capability.

I was hoping a meta-character coupled with the RETR command would work (RETR *)... but it does not. <duh>

Can anyone offer assistance?

Thanks.

0
xtian120897
Asked:
xtian120897
  • 2
1 Solution
 
seedyCommented:
There is no straight forward shell script based solution
for this - atleast in my opinion.    The reason being
you cannot redirect input to commands like telent from normal
files are pipes - they do a lot of ioctl calls that fail on the
normal files.

You could write a small 'c' program that
  1. open pty (read man pages for more details)
  2. fork and exec telnet
  3. communicate to the telnet thru the pty
  4. send USER, PASS commands to the authenticate
  5. send RETR command to retrieve.

One more point, you cannot use RETR *.  You must sepcify
a message/mail number.  You normally would use LIST and then
RETR for the messages 'listed'.
Hope this helps.
-Seedy-
 
0
 
seedyCommented:
Sorry, I lost the big picture here.  Your intention is to get
all the mails down to your UNIX box.  It is rather
easily done through making a socket connection than
through the 'pty' and telnet.
Cheers,
-Chellah-
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now