Cron job to delete email

Discuss webmail and the different webmail clients; Horde and SquirrelMail.

Moderators: Ilbin, Chuck, Vanessa

Cron job to delete email

Postby gtjr on Mon Aug 29, 2011 9:34 pm

Hi,

I tried the following Cron job:

/usr/bin/archivemail [parameters] [path to email inbox]

to delete old email from a specific account, but received an error message:

/bin/sh: /usr/bin/archivemail: No such file or directory



what command should I be using?

Sorry, don't fully understand unix commands.

thanks,
george
gtjr
Forum User
 
Posts: 4
Joined: Mon Aug 15, 2011 11:00 pm

Re: Cron job to delete email

Postby bradm on Mon Aug 29, 2011 11:37 pm

Hi George,

/bin/sh: /usr/bin/archivemail: No such file or directory


Based upon the error message you are receiving, archivemail is not installed on the server. I just checked on my VPS server, and I don't see it installed there either.

http://archivemail.sourceforge.net/

It looks like archivemail uses python, which is supported, so you should be able to set it up within your cgi-bin folder. I've never used it before, but let me know if you need any assistance getting it setup, and I'll be more than happy to take a look into this for you.

Thanks!
- Brad
bradm
InMotion Staff
 
Posts: 357
Joined: Wed Jan 16, 2008 9:29 pm

Re: Cron job to delete email

Postby gtjr on Tue Aug 30, 2011 5:28 pm

Hi Brad,

It looks like archivemail uses python, which is supported, so you should be able to set it up within your cgi-bin folder. I've never used it before, but let me know if you need any assistance getting it setup, and I'll be more than happy to take a look into this for you.



I downloaded archivemail but have no clue how to install it. Do I just copy the .tar file into a specific directory?

Cheers,
George
gtjr
Forum User
 
Posts: 4
Joined: Mon Aug 15, 2011 11:00 pm

Re: Cron job to delete email

Postby bradm on Tue Aug 30, 2011 8:43 pm

Hi George,

I'm working with archivemail now as the root user, and everything seems to be working just fine. Let me test now as a regular shared user, and hopefully I'll have a quick guide for you shortly.

Thanks,

- Brad
bradm
InMotion Staff
 
Posts: 357
Joined: Wed Jan 16, 2008 9:29 pm

Re: Cron job to delete email

Postby bradm on Wed Aug 31, 2011 11:21 am

Hi George,

I was able to get archivemail working. I created some documentation to help you in getting started, which you can find here:

https://support.inmotionhosting.com/cgi-bin/kb.cgi?do=read&id=177

I hope this helps! Be sure to let me know if you have any further questions.

Thanks,
- Brad
bradm
InMotion Staff
 
Posts: 357
Joined: Wed Jan 16, 2008 9:29 pm

Re: Cron job to delete email

Postby gtjr on Wed Aug 31, 2011 6:10 pm

Thanks, Brad, works like a charm.

So if I also wanted to delete mail from a specific folder, like spam, the query would end:

"... /inmotiontesting.com/brad/spam"

and would that command need a trailing "/"?

Thanks,
George
gtjr
Forum User
 
Posts: 4
Joined: Mon Aug 15, 2011 11:00 pm

Re: Cron job to delete email

Postby bradm on Wed Aug 31, 2011 6:49 pm

Hi George,

The other commands that I tested didn't have a trailing slash, so first try not using a trailing slash.

I have a folder named "spam", and I have another test folder named "John Smith".
When I look at these folders via the command line, they're actually named:

Code: Select all
.John\ Smith
.spam


You should be able to see the folder name from within your file manager if you navigate to your mail folder (outside of your public_html folder).

The command would need to be updated to look similar to:
Code: Select all
brad/.spam
brad/.John\ Smith


I just tested, and that worked for me.

Hope this helps!

Thanks,
-Brad
bradm
InMotion Staff
 
Posts: 357
Joined: Wed Jan 16, 2008 9:29 pm


Return to Webmail

Who is online

Users browsing this forum: No registered users and 2 guests