bash scripting auth check for pop3
I need to make a bash scripting, based on a password and a user, that connect to pop3 server and see if it login,if you can,return ok, otherwise return ERR .
if someone can help me i will appreciate it... thx. |
Generally we don't write scripts outright for people, but we'll be happy to help you with your script. I would suggest that perl (or language of your choice) or expect are better suited to this task than bash overall.
Also keep in mind pop3/imap are insecure protocols... you really should be using imaps or pop3s instead. |
I know they are insecure, but i need only for checking pop3 connection (telnet localhost 110 , then echo username - echo pass), if will give me -ERR or +OK, and send me email if pop3 give -ERR or +OK... theat's all.
I am new in the world of linux, and i like it verry much to work on it :P. 3Mouth The scrept i want to be in bash, it is simply. THX. (SRY FOR THE DELAY) |
how far i worked at it :)...
(sleep 3; echo user email account ex: linux@questions.org; sleep 3; echo pass email password; sleep 3; echo "quit") | telnet hostname 110 |
Quote:
|
It working but now i have to find a way how to send mail.
When he give -ERR (he can't connect) send me email, when can connect to give me email with +OK. |
Quote:
Have a look at the command line mail clients "mail" and "mailx". Presuming you want to send mail via a remote mail server you will also need a local mail server to send the locally-created mail to the remote server. This will probably be an SMTP mail server like sendmail or postfix -- or hopefully someone will suggest a simple one! |
Better than mail would be mutt or pine also... they're fairly full featured.
|
For now it done :), i add a cronjob. It ok for now, THX for the info and help :P.
(sleep 3; echo user email account ex: linux@questions.org; sleep 3; echo pass email password; sleep 3; echo "STAT" sleep 3; echo "quit") | telnet hostname 110 |
Quote:
|
yes, but i put in cronjob to give me at 10 hours email. I know it not a right way... he give all the information.
now i work on samba, i will focus later on it :P. i will try with mailx, to send me email if he can "read -u 3;". |
All times are GMT -5. The time now is 12:06 PM. |