Re: lug-bg: pop3 client
- Subject: Re: lug-bg: pop3 client
- From: Boris Jordanov / Борис Йорданов <boris.jordanov@xxxxxxxxx>
- Date: Tue, 18 Oct 2005 17:32:15 +0300
- Delivered-to: lug-bg-list@xxxxxxxxxxxxxxxxxx
- Delivered-to: lug-bg@xxxxxxxxxxxxxxxxxx
Peter Pentchev wrote:
...
> взема да направя нещо такова довечера или утре сутринта, ако намеря
> време, и ако никой не демонстрира някое вече изобретено колело :)))
>
> Поздрави,
> Петър
>
!/bin/bash
# Wed Jun 16 16:04:19 EDT 2004
# NAME: p1
# Copyright 2004, Chris F.A. Johnson
# Released under the terms of the GNU General Public License
CR=$'\r' ## carriage return; for removal of
## connect to POP3 server on local machine, port 110
exec 3<>/dev/tcp/127.0.0.1/110
## get response from server
read ok line <&3
## check that it succeeded
[ "${ok%$CR}" != "+OK" ] && exit 5
## send user name, get response and check that it succeeded
echo user poppy >&3
read ok line <&3
[ "${ok%$CR}" != "+OK" ] && exit 5
## send password, get response and check that it succeeded
echo pass pop3test >&3
read ok line <&3
[ "${ok%$CR}" != "+OK" ] && exit 5
## get number of messages
echo stat >&3
read ok num x <&3
## display number of messages
echo $num messages
## close connection
echo quit >>&3
Това ми стопли сърцето :)) Мъъничко дописване и е в играта :)
Ето и източника:
http://www.unixreview.com/documents/s=1344/ur0407a/
|