Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I look after a few CentOS servers, and since I am not a Linux guru some things get out of hand eventually. One of the things that has been bothering me for quite some time is mail queue.
On any average day I see around a hundred messages sitting in the queue, 99.99% of them are spam or bounces (mailbox doesn't exist, mailbox full, etc.) Some of these e-mails are sitting there for as long as few days (don't know if it affects the server, but it annoys the hell out of me). What I am looking for is either a setting or help on a bash script to rid of anything that sits there for longer then 48 hours. So far I have found that sendmail -bp lists all the e-mails in the queue but I don't really know how to parse it using bash.
Next part is /var/spool/exim/scan folder. I assume it's a part of the queue, therefore I am making it a part of the question. I see a bunch of files and folders going all the way back to 2007 (which is when the server was built). From the name I guess it's a temp folder for scanning incoming and outgoing e-mails so it has to get cleared once the scanning complete. Since it doesn't happen I would also appreciate a setting or help with a script that clears that out. Since the structure of this folder is pretty weird to me (it goes by numbers and letters of the alphabet in both cases, that in turn contain eml files) I am reluctant to just delete them since I suspect there's a database somewhere that keeps track of these things.
If you have an answer to any of these feel free to elaborate as much as possible - I'd rather read again something I already know than miss something I have no clue about.
Try looking into assassin this should help with your spam issue. You may also want to look into another product like barracuda which can help with spam also.
Try looking into assassin this should help with your spam issue. You may also want to look into another product like barracuda which can help with spam also.
Hope you will not get offended if I point that your answer has nothing in common with what I was asking about. I do have SA running and it does its job well enough (although the strain on server gets so heavy that I am thinking about turning it off at least for some of the accounts.
My question(s) are mostly about settings and shell scripting, not about spam issues.
Hope you will not get offended if I point that your answer has nothing in common with what I was asking about. I do have SA running and it does its job well enough (although the strain on server gets so heavy that I am thinking about turning it off at least for some of the accounts.
My question(s) are mostly about settings and shell scripting, not about spam issues.
Thank you for understanding.
None takin. I offered those as suggestions as to a solution that would stop spam before it even got to your server.
However yes you can use a shell script with cron and clean the folder up. I will try to cook something up and post back when I have something that works. Unless some one beats me.
Ok so I did find a starting point. if you used the command
Code:
find /var/log/mail -atime -2
it would search the /var/log/mail directory for anything older than two days. it will also go below any directory in mail so you may want to look here to stop going down the folder level.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.