Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st October 2010, 18:51
Turbanator Turbanator is online now
Senior Member
 
Join Date: Jun 2008
Posts: 218
Thanks: 22
Thanked 16 Times in 16 Posts
Default auto delete spam/junk webmail folder

Does anybody already have a script that will auto go through each users webmail folders (roundcube, not that it matters) and delete old mail from spcified folders (spam and junk)? I'm using ISPC3 but that also shouldn't matter.

The easiest way is to delete all automatically but I'd rather have it look for email older than X days.
Reply With Quote
Sponsored Links
  #2  
Old 2nd October 2010, 13:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

You can do this with the find command. There's a script on http://www.howtoforge.com/back_up_my..._interruptions that should give you the idea how to do this.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 4th October 2010, 20:52
Turbanator Turbanator is online now
Senior Member
 
Join Date: Jun 2008
Posts: 218
Thanks: 22
Thanked 16 Times in 16 Posts
Default

I found this on the net, so I'll try to understand what it does and tweak it.

Code:
...
So i found a little script on the net, and modified it a bit for use with ISPConfig.
It will remove Messages older than 14 days from users .Junk folder.
I run it daily via cron.

cat /etc/cron.daily/purge.junk

#!/bin/sh

HOURS=$((2 * 24 * 7))

for domain in /var/www/*
do
if [ -d "$domain"/user ]
then
cd $domain/user
for user in *
do
if [ -d "$user/Maildir/.Junk" ]
then
tmpwatch -m $HOURS $user/Maildir/.Junk/{cur,new}
fi
done
cd /var/www
fi
done


Edit(11 Jan 2008):

You might want to add :
/etc/init.d/dovecot restart
to the script, to make dovecot rebuild message indexes.
Reply With Quote
  #4  
Old 5th October 2010, 02:00
Turbanator Turbanator is online now
Senior Member
 
Join Date: Jun 2008
Posts: 218
Thanks: 22
Thanked 16 Times in 16 Posts
Default

For anybody else who is blind like me....there is a HOW TO on this already done for ISPC2 and ISPC3.

http://www.howtoforge.com/automatic-...eaper-tmpwatch
Reply With Quote
The Following User Says Thank You to Turbanator For This Useful Post:
falko (5th October 2010)
Reply

Bookmarks

Tags
delete, webmail

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail -Ubuntu 8.04 c4rdinal HOWTO-Related Questions 112 23rd August 2011 10:49
webmail in clients web folder uvbnserved Server Operation 4 10th August 2009 08:30
ISPConfig: Delete a folder in the treeview vaio1 General 18 17th November 2008 17:46
how to delete an imap folder on the commandline Ovidiu Server Operation 10 12th January 2007 18:09
don't allow delete /web folder Salvis General 12 7th June 2006 14:59


All times are GMT +2. The time now is 18:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.