|
|
|
|
|
|
| Author |
Message |
Christian Schmidt *nix forums Guru Wannabe
Joined: 06 Feb 2005
Posts: 177
|
Posted: Thu Jul 20, 2006 9:22 pm Post subject:
Re: Automatic /var/spool/mail cleaning
|
|
|
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
|
Posted: Thu Jul 20, 2006 11:31 am Post subject:
Re: Automatic /var/spool/mail cleaning
|
|
|
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
|
Posted: Thu Jul 20, 2006 9:19 am Post subject:
Re: Automatic /var/spool/mail cleaning
|
|
|
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
|
Posted: Thu Jul 20, 2006 9:11 am Post subject:
Re: Automatic /var/spool/mail cleaning
|
|
|
| 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
|
Posted: Thu Jul 20, 2006 9:04 am Post subject:
Re: Automatic /var/spool/mail cleaning
|
|
|
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
|
Posted: Thu Jul 20, 2006 8:31 am Post subject:
Automatic /var/spool/mail cleaning
|
|
|
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 |
|
 |
|
|
The time now is Thu Dec 04, 2008 4:38 am | All times are GMT
|
|
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
|
|