Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Mail Purge

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


cfaust at doyougot

Jun 24, 2009, 8:50 AM

Post #1 of 2 (262 views)
Permalink
Mail Purge

Folks,

We need to write a script to auto purge mail after x days - we are using Exim 4 with the maildir format.

I want to make sure we handle any directories the user might make on the server via IMAP or webmail but at the same time I don't want to risk deleting something I shouldn't.

Right now on my current install I see 2 directories I should NOT process

courierimapkeywords
tmp

My question is am I safe to just skip these 2 directories or is there a better way? For example is there some way I can process every directory and determine if the file I'm looking at is a mail file (and not something else)?

Or would it be valid to say the only mail directories under a user's account is either called "cur" or starts with a period ".someotherfolder"?

Any advise would be appreciated.

TIA!



--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


wbh at conducive

Jun 24, 2009, 1:28 PM

Post #2 of 2 (231 views)
Permalink
Re: Mail Purge [In reply to]

cfaust-dougot wrote:
> Folks,
>
> We need to write a script to auto purge mail after x days - we are using Exim 4 with the maildir format.
>
> I want to make sure we handle any directories the user might make on the server via IMAP or webmail but at the same time I don't want to risk deleting something I shouldn't.
>
> Right now on my current install I see 2 directories I should NOT process
>
> courierimapkeywords
> tmp
>
> My question is am I safe to just skip these 2 directories or is there a better way? For example is there some way I can process every directory and determine if the file I'm looking at is a mail file (and not something else)?
>
> Or would it be valid to say the only mail directories under a user's account is either called "cur" or starts with a period ".someotherfolder"?
>
> Any advise would be appreciated.
>
> TIA!
>
>
>

A) While a valid 'mailAdmin' question - it has little to do with Exim.

CAVEAT: no doubt there are ways to have Exin do it instead of a cron job .. but ..

:-(

B) IMNSHO, the best way to do it may very well be 'not at all'.

Far better to use large HDD (can one still buy any other kind?), impose
reasonable quotas if appropriate, and encourage end-user's to delete, compress,
or copy to 'local' storage - even tarball - whatever they deem important / not.

C) if you must do this with a Maildir structure, then nearly anything that is a
legitimate target for removal will exist in ~/Maildir/new (most commonly for
cron'ed reports or archives that are NOT actively being read by anyone on a
regular basis), ELSE ~/Maildir/cur (most common for typical ed-users).

Take a close look at *ANY* 'dotfiles' before touching them. Especially if they
are working indices.

CAVEAT: IMAP in particular invites copious on-server folder structure creation.

Depending on which IMAP daemon and how it is configured, the 'Folders' a user is
presented with may be 'real' (dirtree structures), hardlinks, softlinks, or
merely index entries in a DB of sorts.

Have a care and do some experimenting with non-vital data and structures before
going into 'production' with any scripts that touch these, as not all IMAPD are
able to gracefully handle having their 'necessaries' altered by a BFBI external
process.

HTH,

Bill

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.