Horde autologin with cron job

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Horde autologin with cron job
# 1  
Old 06-18-2011
Java Horde autologin with cron job

I have created a filter in cPanel Horde email account, but the filter only work when someone log into the inbox. May I know if I can setup a cron job so the system able to autologin to my cPanel Horde email account inbox? Anyone can help? Thanks, Sean
# 2  
Old 06-20-2011
Any expert can help me here?
# 3  
Old 06-20-2011
That would seem like a quite dodgy way to run an email filter, especially considering how http logins work; they can time out or expire and such. And even if you do manage to login with a commandline tool, there might be javascript scripts or something required for it to work which a commandline tool would be unable to perform.

If you really want to try it that way I suggest you take a look at wget, see its --post-data, --no-check-certificate, --save-cookie, and --save-session-cookies options. A better way would be to find out why this requires a login and fix it...
# 4  
Old 06-20-2011
HostGator support told me that Horde email filter will only work when login to the account. There's no option to make the filter work without user login.

I'm not expert in coding so not really understand what is "wget". :-)

Maybe can create PHP script to auto login with cron job?
# 5  
Old 06-20-2011
How to login to a website really depends on the website, it could be as simple as wget "http://usernameSmilieassword@host/login.php" or as complicated as something involving cookies and a URL obfuscated in javascript. I can't give you canned code that'll work for anything.

If you can attach the HTML code of your HORDE login page that'd help.
# 6  
Old 06-20-2011
Here's the horde login page:

The HTML code below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="shortcut icon" href="/cPanel_magic_revision_1265411766/unprotected/cpanel/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cPanel&reg; 11</title>
<link rel="stylesheet" href="/cPanel_magic_revision_1265411766/unprotected/cpanel/style_optimized.css" type="text/css" />
<meta name="robots" content="noindex, nofollow" />
<div id="wrap">
        <div id="top-mail"></div>
        <div id="mid">
                <div id="content-wrap" align="center">
<form action="/login/" method="post" >
    <input type="hidden" name="login_theme" value="cpanel" />
    <table width="200px" class="login" cellpadding="0" cellspacing="0">
            <td align="left" colspan="2"><strong>Login</strong></td>
            <td class="login_lines">Email</td>
            <td class="login_lines"><input autofocus="autofocus" type="text" tabindex="1" id="user" name="user" size="16" /></td>
        <tr class="row2">
            <td class="login_lines">Password&nbsp;</td>
            <td class="login_lines"><input type="password" tabindex="2" id="pass" name="pass" size="16" /></td>
            <td colspan="2" style="text-align: center"><input type="submit" tabindex="3" id="login" value="Login" class="input-button" /></td>
    <input type="hidden" name="goto_uri" value="/horde/index.php" />
<script type="text/javascript"> 
/* Must not include external javascript -jnk 06.20.09 */
<div id="bot-mail">
&copy; cPanel, Inc. 2009

After login, we need to click on another button "Login" to access the inbox.

Hope you can help. :-)

# 7  
Old 06-20-2011
Then perhaps:

wget -U netscape --referer=http://mysoftwaredepot.com:2095 \
        --post-data="login_theme=cpanel&user=myusername&pass=mypassword&goto_uri=/horde/index.php" \

username and password should be percent-encoded if they contain any strange characters. I'd suggest not putting it into cron until you have it working. It will save a webpage to disk, which if the login doesn't work may or may not tell you why. Once you have it working, add -O /dev/null to make it not save a file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

4. Shell Programming and Scripting

Cron Job help

I need to write the cron job for the following scenario, Please help me out The CRON job runs sometime at night on Saturday and checks if there are more than eight files in the /PROCESSED folder. Any files over and above eight are deleted based on ascending order of date (eight most recent... (10 Replies)
Discussion started by: sandeep.dwivedi
10 Replies

5. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

6. Linux

cron job

In my var/log/cron file Im getting this error: Mar 6 11:57:01 intranet crond: (tmp.XXXXGHJVjz) ORPHAN (no passwd entry) Mar 6 11:57:01 intranet crond: (root) RELOAD (cron/root) Mar 6 11:57:01 intranet crond: (tmp.XXXXFqiL6E) ORPHAN (no passwd entry) Im not a pro bu I think the cronjob... (4 Replies)
Discussion started by: dannyd
4 Replies

7. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

8. UNIX for Dummies Questions & Answers

Cron Job

Hi I want to execute a script on the last day of every month. I tried using the following line but it failed: 50 23 * * * && cd live/cgi-bin/;perl org_stats_monthly_cron_job.cgi log shows: CMD: Its a Solaris box. Could someone please help me out? Thanks in advance. (3 Replies)
Discussion started by: tom123
3 Replies

9. Shell Programming and Scripting

cron job

I believe that crob invokes command under bash. But most of our work are carried out using c shell. So what do I need to be aware of (or what precautions should I be taking) when I use cron. (1 Reply)
Discussion started by: sharanbr
1 Replies

10. UNIX for Dummies Questions & Answers

Cron job

Regarding Cron job, i want to execute a scriptevery 4 days once irrespective of a week or a month. Is it possible?Any help (2 Replies)
Discussion started by: santho
2 Replies
Login or Register to Ask a Question