Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: jfarschman on July 06, 2006, 10:43:15 PM

Title: Expire old emails - [SOLVED]
Post by: jfarschman on July 06, 2006, 10:43:15 PM
Hello,

  Is there a way to expire email older than (say) 30 days from a mailbox on the SME server?

  On systems that use the old mbox method there is a perl script called expiremail that can do this.  Any ideas how to do this on SME?
Title: Expire old emails - [SOLVED]
Post by: byte on July 06, 2006, 10:57:17 PM
Hi,

Do you mean junkmail? here's what's in the FAQ...

How to set spamassassin for automatically deleting junkmail.
You can change the "days" that spamassassin sets to automatically delete junkmail, to do this just type at command line...

db configuration setprop spamassassin MessageRetentionTime 60Where 60 is the value you want, then do...

signal-event email-update
Title: Expire old emails - [SOLVED]
Post by: jfarschman on July 06, 2006, 11:29:16 PM
Byte,

  Actually I don't mean the junkmail folder.  I should have mentioned that.

  We want the inbox to not get overfilled even when a user neglects it.

  Does that make sense?
Title: Expire old emails - [SOLVED]
Post by: byte on July 07, 2006, 12:04:50 AM
Ok, how about looking at the settings for the Junkmail and see if you can modify something to work for your situation?

I've not got a machine in front of me to see where the templates/script are.

Does that make sense?

PS. You may want to raise a NFR, as I'm sure others would maybe need something like this.
Title: Expire old emails - [SOLVED]
Post by: MSmith on July 07, 2006, 05:03:26 AM
Would it work to set a quota on each user?
Title: Expire old emails - [SOLVED]
Post by: Tib on July 07, 2006, 05:30:51 AM
I have setup a quota on each user ... that way it forces them to do a bit of maintenance ... does them good let me tell you.  :hammer:

Regards,

Tib
Title: Expire old emails - [SOLVED]
Post by: jfarschman on August 17, 2006, 05:48:18 PM
Okay... it took me awhile, but you can create a job in /etc/cron.daily that will run daily against the email directory you choose.  Saw this on a CharlieBrady post.

Code: [Select]

### 6.x  where emails end in .mail
find /home/e-smith/files/users/maillog/Maildir -type f -mtime +21 -name \*mail\* | xargs rm -f

### 7.x where a capital "R" denotes a READ message
find /home/e-smith/files/users/maillog/Maildir -type f -mtime +21 -name \*R\* | xargs rm -f