Author Topic: delete spam mail  (Read 3383 times)

Offline irfan_area47

  • Newbie
  • *
  • Posts: 3
delete spam mail
« 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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
delete spam mail
« Reply #1 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.

Code: [Select]

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ā€¦

Offline irfan_area47

  • Newbie
  • *
  • Posts: 3
delete spam mail
« Reply #2 on: June 10, 2008, 05:59:40 AM »
ok, thank before, it`s work.......
:)