Horde autologin with cron job


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Horde autologin with cron job
# 8  
Old 06-21-2011
Bug Add all into one line in cron job?

Quote:
Originally Posted by Corona688
Then perhaps:

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

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.
Thanks for the tips.

May I know if I will put all these into one line into cron job?

How about the -O /dev/null ? Where should I add it? Add from the beginning or at the end of the code?

Thanks,
Sean

---------- Post updated 06-21-11 at 02:48 AM ---------- Previous update was 06-20-11 at 11:30 PM ----------

I have successfully setup the code into the cron job.

After the cron log into the email login page, actually there's another login page requires to click on the button "Log in" before can go into the inbox.

Here's the demo email login:
Code:
http://mysoftwaredepot.com:2095/horde/

Username: testemail@mysoftwaredepot.com
Password: pass123

After login, you will see there's another page with a login button.

May I know how to make the cron job push that button to access into the inbox?

Thanks,
Sean
# 9  
Old 06-21-2011
Quote:
Originally Posted by seangtc
How about the -O /dev/null ? Where should I add it? Add from the beginning or at the end of the code?
It doesn't matter. end would be simplest.
Quote:
After the cron log into the email login page, actually there's another login page requires to click on the button "Log in" before can go into the inbox.

Here's the demo email login:
Code:
http://mysoftwaredepot.com:2095/horde/

Username: testemail@mysoftwaredepot.com
Password: pass123

After login, you will see there's another page with a login button.

May I know how to make the cron job push that button to access into the inbox?
I can't tell. I'd need to see the HTML for that too.

[edit] you actually set up a demo email? okay, looking

---------- Post updated at 09:46 AM ---------- Previous update was at 09:25 AM ----------

Okay, this appears to login and select a language. There's enough to it that it'd make sense to save it as a script file and run that, instead of trying to cram it all into one cron job. The --quiet should prevent cron from mailing you every time.
Code:
#!/bin/sh

EMAIL=testemail@mysoftwaredepot.com
PASS=pass123

# move cookiefile somewhere that makes sense for you
COOKIE=/home/tyler/cookiejar

wget -U netscape --referer=http://mysoftwaredepot.com:2095 \
        --post-data="login_theme=cpanel&user=${EMAIL}&pass=${PASS}&goto_uri=/horde/index.php"   \
        --save-cookies ${COOKIE} --keep-session-cookies \
        http://mysoftwaredepot.com:2095/login/
        --quiet -O /dev/null

wget -U netscape --referer=http://mysoftwaredepot.com:2095      \
        --load-cookies ${COOKIE}                                \
        --save-cookies ${COOKIE} --keep-session-cookies         \
        --post-data="url=&horde_user=${EMAIL}&horde_pass=${PASS}&anchor_string=&new_lang=en_us" \
        http://mysoftwaredepot.com:2095/horde/login.php \
        --quiet -O /dev/null

wget -U netscape --referer=http://mysoftwaredepot.com:2095      \
        --load-cookies ${COOKIE}        \
        http://mysoftwaredepot.com:2095/horde/services/portal/sidebar.php      \
        "http://mysoftwaredepot.com:2095/horde/login.php?frameset_loaded=1"    \
        --quiet -O /dev/null

I have no idea if this will enable your email filters or not but worth a shot.
# 10  
Old 06-22-2011
Hi Corona688,

Thanks for your tips again.

I have copied the code you given but I'm not sure what kind of format I should save in my hosting?

I should save the code as .php or .html or ... so I can run as a script?

Thanks,
Sean
# 11  
Old 06-22-2011
Quote:
Originally Posted by seangtc
I have copied the code you given but I'm not sure what kind of format I should save in my hosting? should save the code as .php or .html or ... so I can run as a script?
The file extension isn't important if you're running it from crontab. Just make sure its set executable.
# 12  
Old 06-22-2011
Quote:
Originally Posted by Corona688
The file extension isn't important if you're running it from crontab. Just make sure its set executable.
Hi Corona688,

Sorry, I'm not a technical guy so couldn't really understand how to make it work, even though I have tried hours just to break the code. :-)

Do you offer service to help me make it work? Let me know how much you will charge.

Thanks,
Sean
# 13  
Old 06-27-2011
Hi Corona688,

I'm unable to reply your PM because I do not have enough post in the forum.

Instead of accessing the SHELL, is there any other way to overcome this problem?

Like, create a PHP or any script that work with cron job to autologin to the Horde email inbox?

Thanks,
Sean
 
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