niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Exim
Automatic /var/spool/mail cleaning
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Christian Schmidt
*nix forums Guru Wannabe


Joined: 06 Feb 2005
Posts: 177

PostPosted: Thu Jul 20, 2006 9:22 pm    Post subject: Re: Automatic /var/spool/mail cleaning Reply with quote

Hello Craig,

Craig Whitmore, 20.07.2006 (d.m.y):

Quote:
find /var/spool/mail/ -type f -ctime 3 -exec rm {} \;

but man find before you do this

And beware that you are using maildir format! Otherwise, all mailboxes
matching your "find" command will be deleted _completely_!

Regards,
Christian Schmidt

--
Junggeselle ein Pfau, verlobt ein Löwe, verheiratet ein Esel.
-- Spanisches Sprichwort

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Cédric MARCOUX
*nix forums beginner


Joined: 11 Feb 2005
Posts: 10

PostPosted: Thu Jul 20, 2006 11:31 am    Post subject: Re: Automatic /var/spool/mail cleaning Reply with quote

Finally found a great tools:
http://adc-archmbox.sourceforge.net/

Using command like this work like a charm:
archmbox -k -o 15 /var/spool/mail/*

Regards,


Chris Lightfoot a écrit :
Quote:
On Thu, Jul 20, 2006 at 10:31:55AM +0200, "Cédric MARCOUX (sprimont)" wrote:
Hi!
I have set a new router to deliver a copy of my mails to an exchange
server using this settings:

exchange2003:
driver = manualroute
domains = +local_domains
transport = remote_smtp
route_list = * 192.168.123.254
unseen = true

With this settings, I keep the mail on my Linux server, this is a good
thing since I have a little backup on my linux.

But I would like to know if there is a procedure to cleanup
/var/spool/mail/%users% by deleting mail older then 3 month for exemple

Hope someone got a solution,

if you're delivering to maildirs, then Craig Whitmore's
solution is about right. If you're delivering to
mailspools, then this tool:
http://www.mythic-beasts.com/downloads/trimfolder-20041010.tar.gz
will do sort of what you want (but it trims to constant
size, rather than constant age of oldest message). Another
possibility would be to deliver mail to mailspools whose
name changes daily (e.g. /var/spool/mail/chris/20060720)
and then use a find command to nuke the old ones.



--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Chris Lightfoot
*nix forums addict


Joined: 22 Mar 2005
Posts: 62

PostPosted: Thu Jul 20, 2006 9:19 am    Post subject: Re: Automatic /var/spool/mail cleaning Reply with quote

On Thu, Jul 20, 2006 at 10:31:55AM +0200, "Cédric MARCOUX (sprimont)" wrote:
Quote:
Hi!
I have set a new router to deliver a copy of my mails to an exchange
server using this settings:

exchange2003:
driver = manualroute
domains = +local_domains
transport = remote_smtp
route_list = * 192.168.123.254
unseen = true

With this settings, I keep the mail on my Linux server, this is a good
thing since I have a little backup on my linux.

But I would like to know if there is a procedure to cleanup
/var/spool/mail/%users% by deleting mail older then 3 month for exemple

Hope someone got a solution,

if you're delivering to maildirs, then Craig Whitmore's
solution is about right. If you're delivering to
mailspools, then this tool:
http://www.mythic-beasts.com/downloads/trimfolder-20041010.tar.gz
will do sort of what you want (but it trims to constant
size, rather than constant age of oldest message). Another
possibility would be to deliver mail to mailspools whose
name changes daily (e.g. /var/spool/mail/chris/20060720)
and then use a find command to nuke the old ones.

--
``Sure, we humans pulled the levers and poked the chads, but in the
end the machines did the counting and elected one of their own.''
(Scott Adams, on Dick Cheney)

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Craig Whitmore
*nix forums beginner


Joined: 21 Aug 2005
Posts: 21

PostPosted: Thu Jul 20, 2006 9:11 am    Post subject: Re: Automatic /var/spool/mail cleaning Reply with quote

Quote:
But I would like to know if there is a procedure to cleanup
/var/spool/mail/%users% by deleting mail older then 3 month for exemple

Hope someone got a solution,


find /var/spool/mail/ -type f -ctime 3 -exec rm {} \;

but man find before you do this

Thanks
Craig


--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Heiko Schlittermann
*nix forums Guru Wannabe


Joined: 16 Feb 2005
Posts: 102

PostPosted: Thu Jul 20, 2006 9:04 am    Post subject: Re: Automatic /var/spool/mail cleaning Reply with quote

Hello Cédric,

you can write some script for scanning the mailbox content. Probably
something like this already exists: I found e.g. chewmail. BUT I didn't
use it. So I do not know if it is sufficient. But its description reads good.

--
Heiko
Back to top
Cédric MARCOUX
*nix forums beginner


Joined: 11 Feb 2005
Posts: 10

PostPosted: Thu Jul 20, 2006 8:31 am    Post subject: Automatic /var/spool/mail cleaning Reply with quote

Hi!
I have set a new router to deliver a copy of my mails to an exchange
server using this settings:

exchange2003:
driver = manualroute
domains = +local_domains
transport = remote_smtp
route_list = * 192.168.123.254
unseen = true

With this settings, I keep the mail on my Linux server, this is a good
thing since I have a little backup on my linux.

But I would like to know if there is a procedure to cleanup
/var/spool/mail/%users% by deleting mail older then 3 month for exemple

Hope someone got a solution,

regards


--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 4:38 am | All times are GMT
navigation Forum index » Apps » Exim
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Restricting postfix mail incoming only from Barracuda firewa gnewak Postfix 0 Thu Jul 03, 2008 12:57 am
No new posts Filtering internal mail and forwarding to another domain fmaa1 Postfix 0 Wed Apr 30, 2008 12:50 pm
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts mail delivery to cyrus fails embedded Postfix 0 Mon Mar 03, 2008 2:43 pm
No new posts mail forwarding loop killersushi Postfix 0 Tue Jan 23, 2007 3:43 am

Internet Businesses Online Articles | Stag Weekend Nottingham | Knitting Instructions | Free Mmorpg | Project cars for sale
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2063s ][ Queries: 20 (0.1168s) ][ GZIP on - Debug on ]