in reply to WebMail authentication

To find the correct URL to pass your login parameters, you could go look at the page you use to login to your webmail. Then either watch the headers go by or parse the source, your call.

Personally, I'd use WWW::Mechanize to handle this all automatically.

Quick plan:

  1. get the url of the page you eventually want within your webmail setup.
  2. logout of webmail, and try opening that page. Do you get sent to a login form? Good. What does the login form look like? A form with the words "LOGIN" or somesuch?
  3. login to the form. Does it take you back to the page your requested? Yes is good. No is ok too.
  4. Now do it again via WWW::Mechanize
  5. ...
  6. profit
#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $target_url = "https://webmail.com/the/page/I/want"; my $user = "myusername"; my $pass = "<=6chars"; my $ua = WWW::Mechanize->new(); my $resp = $ua->get( $target_url ); #Dear student, check here that resp is valid... #check if page looks like the login page, by looking for a field named + "login" if ( $ua->form_name("login") ) { $ua->field( "username", $user ); #look for a field named "username" $ua->field( "password", $pass ); #look for a field named "password" $ua->submit(); #submit the form } #$ua should now have the comment you were hoping for.