Rediffmail autologin shell script

| | Comments (3) | TrackBacks (0)

Rediffmail has a 30 day login policy. This means that, if a user does not login at least once over a period of 30 days, email delivery to the account is stopped. Also, if the user does not login over a period of 45 days, all existing emails are deleted. I have access to 5 or 6 rediffmail accounts and I frequently use only 1 or 2 of these. I got the 30-day warning in 2 of my accounts sometime back. Since then, I have made it a point to login to all my accounts at least once in two weeks. This was very inconvenient for me and so I decided to write a script to auto-login into my rediffmail email accounts so that I do not lose my emails due to the 30/45 day login policy.

Download code (3 kb zipped file)

Note: To use this script, you need to have shell access to a Unix/Linux machine.

[1] File 1: login.sh (the shell script)
lynx -dump -post_data http://mail.rediff.com/cgi-bin/login.cgi < /home/maisnam/cron/rediff/myemail1.txt
lynx -dump -post_data http://mail.rediff.com/cgi-bin/login.cgi < /home/maisnam/cron/rediff/myemail2.txt
lynx -dump -post_data http://mail.rediff.com/cgi-bin/login.cgi < /home/maisnam/cron/rediff/myemail3.txt

[2a] File 2a: myemail1.txt
FormName=existing&login=myemail1&passwd=mypassword1

[2b] File 2b: myemail2.txt
FormName=existing&login=myemail2&passwd=mypassword2

[2c] File 2c: myemail3.txt
FormName=existing&login=myemail3&passwd=mypassword3

In the above example, I have 3 email accounts - myemail1@rediffmail.com, myemail2@rediffmail.com and myemail3@rediffmail.com. Their username and password information is stored in 3 files: myemail1.txt, myemail2.txt and myemail3.txt. The shell script reads in the information from each file and passes them to the login script as a POST entry. The output (which is currently pushed to /dev/null) would be the text-only(lynx) view of the inbox screen for each email account.

[3] Add to crontab
The shell script in [1] has to be executed periodically by adding an entry to the crontab file. An example crontab entry would look like this:
0 0 * * 2,4,6 sh /home/maisnam/cron/rediff/login.sh > /dev/null 2>&1

In the above case, the script would be executed at 12 am, 3 times every week on Tuesday, Thursday and Saturday.

A sample file structure is available here.
The code (zipped file) is available here (3 kb).


Useful Links:
- http://www.adminschoice.com/docs/crontab.htm
- http://www.rt.com/man/lynx.1.html
- http://lists.debian.org/debian-devel/1999/08/msg01594.html

Categories


0 TrackBacks

Listed below are links to blogs that reference this entry: Rediffmail autologin shell script.

TrackBack URL for this entry: http://blog.maisnam.com/mt-tb.cgi/153



3 Comments

Jo said:

Hey,

You're amazing Bob! Is there anyway to do this from a Win2000 machine?

Regards,
Jo.

Dhiraj said:

hey buddy, it is nice thing. but do u know anything like this for windows?
I will be thankful to u if u provide so.

anonymous said:

Bobby...i think u need to see the website of the person who has commented above (Dhiraj)...i think u will find the last couple of posts straight out of ur blog....including the script that he supposedly wrote!

Leave a comment

About this Entry

This page contains a single entry by Bobby published on May 15, 2005 6:08 AM.

Finding new 93 number for old Reliance number was the previous entry in this blog.

Star Wars: Episode III - Revenge of the Sith is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0