Empty Mail Trash Folder
User always forget to empty there trash folder. User delete mail from there inbox; but don’t delete those mail from Trash folder. At the end, it eats up a lot of your server disk space. Empty this Trash folder is big headache for the administrator. Shell script can easily rescue the administrator. First create a list for you user. You can create it easily from awk commad. Save it in a file named user. Now create a new bassh file named trash_empty.sh and chown it to 755. Add the following syntex to the trash_empty.sh file
#!/bin/sh
for i in `more user`
do
echo $i
cat /dev/null > $i/mail/Trash
done
[user Trash folder in /home/username/mail/Trash. It may varies depending on your mail server configuration. ]
Now run the file trash_empty.sh WOW all your users Trash folder will be empty
Please take your own responsibility to empty users trash folder
About this entry
You’re currently reading “Empty Mail Trash Folder,” an entry on http://www.fakrul.name
- Published:
- February 23, 2009 / 12:45 pm
- Category:
- My Work
- Tags:
- BASH, linux, Mail Server, Shell Script, Trash Folder
1 Comment
Jump to comment form | comment rss [?] | trackback uri [?]