Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a small VPS server that works as web and mail server. It has only 256MB of RAM, and it's sucking 100MB of swap constantly. I've found that one of the culprits is amavis, taking about 30MB of resident memory, and would like to ditch it and use some alternative.

I don't have much mail daily, so it being a bit slower wouldn't be a problem. I'd like to avoid Spamassassin altogether, if possible, because it's quite big even if used in offline mode. I'm already using RBLs and a few small blacklists, and used greylisting for a while but abandoned it because it gave me a few problems (don't remember which; I think it was related to not configuring properly white lists for several big ISPs).

So, is there some alternative to amavis that I could use without much RAM (and if possible, CPU) usage?

Thanks in advance.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can configure amavisd-new to only create one child process so that you would only use 30 MB of RAM. Set $max_servers = 1; in the config file. Also you can set Postfix to only deliver one mail after the other to amavis. This is done in the master.cf and looks something like this [the 1 is important]:

amavis unix - - - - 1 lmtp

This setup is absolutely OK if you receive one message every 20 seconds (or fewer). If you receive way more then you should consider using policyd-weight. This software is awesome and kills between 60-80 percent of Spam before it even arrives at Amavis. This should be OK for up to 1 mail per second. If you receive more Spam per second then you have to activate postscreen in Postfix. If you really receive many mails per seconds then your (RAM) setup is a problem as Postfix consumes much RAM when multiple smtpds are running in parallel.

share|improve this answer
    
Thanks, that's similar to what I have now (only one amavisd child), but those are 30MB that I still want to reclaim :-) I have little mail, so efficiency is not a problem. Anyway, I didn't know about postscreen; I'll have a look to see if I can do something with it. Thanks! –  rsuarez Jun 25 '11 at 10:28

I use Andrew Wood's postprox to basically roll my own filtering wrapper. Detailed instructions are available here: http://ubuntuwiki.net/index.php/Postfix,_Virtual_Domain_Setup#Installing_Content_Filtering_with_Postprox

It's EXTREMELY minimalistic and lightweight. Will probably be just what you want. Note that you may want to elide out the ClamAV section and only use the SpamAssassin section - ClamAV has in my opinion been sucking really badly for a few years now, and I've stopped using it in production (SpamAssassin catches far more actual malware than ClamAV does!). YMMV.

share|improve this answer
    
But this still uses SpamAssassin, which is really what I want to get rid of. Anyway, I didn't know about postprox. Will look into it, thanks for the pointer :-) –  rsuarez Nov 26 '12 at 12:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.