Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: irfan_area47 on May 21, 2008, 02:15:38 AM

Title: delete spam mail
Post by: irfan_area47 on May 21, 2008, 02:15:38 AM
how do we automatically delete spam mails in JUNK folder, if the spam mails have been in Junk folder for 1 week?
Title: delete spam mail
Post by: JohnDoh on May 21, 2008, 06:28:44 AM
This should be done on the server rather than the webmail client. Make a script to delete old files and then call it via cron at regular intervals.

The bash command will do it. Note: the `;` at the end is important.


find /path/to/user/dir -mtime +7 -path '/path/to/JUNK/folder/*' -exec rm -f {} \;


That will delete everything it finds that is older than 7 days so test it carefully before use. If you remove the `-exec rm -f {} \;` it will display a list of everything it found so you can check it.
Title: delete spam mail
Post by: irfan_area47 on June 10, 2008, 05:59:40 AM
ok, thank before, it`s work.......
:)