Command Line Login script to GroupWise WebAccess

Posted on 2008-11-18
Last Modified: 2013-12-21
I am working on a command line batch script for linux, that is aimed at logging in to a GroupWise WebAccess server.

I want todo this to verify the status of the Agent that reports it being up/ok, while it does not always neccesarily mean just that when its through the WebAccess portion of our mail system.

I've already made a script thats able to DL and check for the proper front page, however, I am unable to log in to WebAccess this way. I've tried using both WGET and CURL to DL the cookies, they still end up blank.
# These are the code snippets I've used while trying to DL the cookie:


wget \

    --no-check-certificate \

    --save-cookies ~/webmailcookie \

    --post-data "******&User.password=*******" \

    -O - \

    https://webmail/gw/webaccess \

    > /dev/null




curl \

    -k \

    --cookie-jar ~/webmailcookie \

    --data "****&User.password=*******" \

    https://webmail/gw/webaccess \

    > /dev/null

Open in new window

Question by:TheFlyingCorpse
    LVL 3

    Accepted Solution


    You may try this:

    #!/usr/local/bin/perl -w
    #use LWP::Debug qw(+);  (Uncomment this if you want to see more debugging)
    use WWW::Mechanize;
    use WWW::Mechanize::DecodedContent;
    $url = 'https://<WEB ADDRESS>';
    $m = WWW::Mechanize->new();

    $m->form_name("<FORM NAME>");
    $m->set_fields(<Username Text Field Name on webpage> => $user, <PASSWORD TEXT Field Name on Webpage> => $pass);

    print $m->content();
    This will display the contents once you are logged into the webpage using given credentials.

    LVL 2

    Author Comment

    haha, this is too good to be true, it works(slight modification to the set fiels, had to enclose the fields with '' to make it understand it correctly.

    Thank you a bunch!
    LVL 2

    Author Closing Comment

    The expert who answered had good knowledge of coding and it was easy to understand his sollution.

    The only thing I had todo was install the extra PERL modules, and it was flying away with the solution I asked for!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now