Roundcube Community Forum

 

delete spam mail

Started by irfan_area47, May 21, 2008, 02:15:38 AM

Previous topic - Next topic

irfan_area47

how do we automatically delete spam mails in JUNK folder, if the spam mails have been in Junk folder for 1 week?

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

irfan_area47

ok, thank before, it`s work.......
:)