Backgound

 I had to change from qmail to postfix. Under qmail I used odeiavir 
 for virus checks and spamc (with spamd) for spam checks.
 
 Postfix uses mainly Amavis to do the job. Sorry guys, but IMHO
 Amavis sucks big time in performance, so I took odeiavir source
 and modified it little bit to accommodate my needs. Change in 
 performance (for me) was 400..500%.

 Sorry for the bad code, I am NOT C programmer.
 
Status

 Beta, most of stuff is working, some features not working as planned,
 unfortunately I have no time to debug them right now. 

Dependencies

 * ripmime (http://www.pldaniels.com/ripmime/)
 * msmtp (http://msmtp.sourceforge.net/)
 o clamd if you choose to use it (http://www.clamav.net/)
 o spamassassin if you choose to use it (http://spamassassin.apache.org/)

HowTo

 1. install dependencies
 2a. get odeiavir source, odeiavir-0.5.0pre5 is the one I used
 2b. get this patch (http://sourceforge.net/project/showfiles.php?group_id=160827)
 3a. patch the source with this patch
 3b. check and modify file locations if needed. 
     Currently hardcoded /usr/bin/msmtp and /usr/bin/spamc  
 4. make && make install
 5. configure postfix

 In master.cf:
 
 smtp-odeiavir   unix    -       n       n       -       35       pipe
  user=vscan argv=/usr/bin/odeiavir -sender ${sender} -recipient ${recipient} -postfix -spamc

 /* Note - vscan user is required if not exists */

 127.0.0.1:10025 inet n        -       n     -       -  smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/8
  -o strict_rfc821_envelopes=yes
  -o smtpd_error_sleep_time=0
  -o smtpd_soft_error_limit=1001
  -o smtpd_hard_error_limit=1000

 /* ... as in standard amavis installation */

 In main.cf:
 
 content_filter = smtp-odeiavir:
 
 6. check odeiavir config in /etc/odeiavir/config
  
 I have 
	use_syslog      yes 
 and 
	antivirus       8
 there.

 7. if using clamdscan, please verify that in config file there is:
   	
   	User vscan
   	
 If you choose to use any other user in master.cf then change it here also!

 7. Cross your fingers and inject your test email.
 8. Check logs ...

 I have to remind, it is beta, it worked for me and if I forgot something out from this howto
 please let me know. Use tarmo . randel ( at ) mail . ee  

History 

 25 Aug 2007 		started project
 01 Sept 2007 		Beta