:DEFAULT:CLAMAV=1:Configure Clamav
:DEFAULT:AMAVIS=1:Configure Amavis
:DEFAULT:OS=FREEBSD:Operation system
main.cf            > [/usr/local/etc/postfix]/main.cf
sql/aliases.cf         > [/usr/local/etc/postfix]/sql/aliases.cf
sql/access.cf          > [/usr/local/etc/postfix]/sql/access.cf    
sql/virtual_domains.cf > [/usr/local/etc/postfix]/sql/virtual_domains.cf
sql/relay_domains.cf   > [/usr/local/etc/postfix]/sql/relay_domains.cf
sql/transport.cf       > [/usr/local/etc/postfix]/sql/transport.cf            
sql/virtual_mailbox.cf > [/usr/local/etc/postfix]/sql/virtual_mailbox.cf
sql/virtual_mailbox_limits.cf > [/usr/local/etc/postfix]/sql/virtual_mailbox_limits.cf
#add maildrop
:OS=FREEBSD:maildrop  unix  -       n       n       -       -       pipe\n  flags=Rhu user=vmail argv=/usr/local/bin/maildrop -w 90 -d ${recipient}  >> [/usr/local/etc/postfix]/master.cf
:OS=FREEBSD:exec:exec /usr/abills/misc/postfix/install.sh ADD_VMAIL_USER %OS%
.mailfilter        > [/var/spool/virtual]/.mailfilter
:OS=FREEBSD:exec:chown -Rf vmail:vmail /var/spool/virtual/
:OS=FREEBSD:exec:chmod 600 /var/spool/virtual/.mailfilter
:OS=FREEBSD:exec:chown vmail:vmail /var/spool/virtual/.mailfilter
:OS=FREEBSD:exec:mkdir -m 700 /var/spool/virtual/.mailfilters
:OS=FREEBSD:exec:chown vmail:vmail /var/spool/virtual/.mailfilters

# Sasl section
authmysqlrc        > [/usr/local/etc/authlib/]/authmysqlrc
authdaemonrc       > [/usr/local/etc/authlib/]/authdaemonrc
:OS=FREEBSD:exec:chown vmail:vmail /var/run/authdaemond/
:OS=FREEBSD:saslauthd_enable="YES" >> [/etc]/rc.conf
smtpd.conf         > [/usr/local/lib/sasl2]/smtpd.conf
:OS=FREEBSD:exec:chmod 750 /usr/local/lib/sasl2 
:OS=FREEBSD:exec:chgrp mail /usr/local/lib/sasl2

#SpamAssassin
local.cf           > [/usr/local/etc/mail/spamassassin]/local.cf
#Autostart postfix
:OS=FREEBSD:# Don't start sendmail\nsendmail_enable="NONE"\nmta_start_script=""\nsendmail_outbound_enable="NO"\nsendmail_submit_enable="NO"\nsendmail_msp_queue_enable="NO"\n# Startup postfix\npostfix_enable="YES" >> [/etc]/rc.conf


#Make startup for courier_imap
#:OS=FREEBSD,IMAP_SSL:exec:/usr/local/share/courier-imap/mkimapdcert
:OS=FREEBSD:courier_authdaemond_enable="YES"\ncourier_imap_imapd_enable="YES"\ncourier_imap_pop3d_enable="YES"  >> [/etc]/rc.conf

:OS=FREEBSD:exec:/usr/local/etc/rc.d/postfix restart
:OS=FREEBSD:exec:/usr/local/etc/rc.d/courier-authdaemond restart
:OS=FREEBSD:exec:/usr/local/etc/rc.d/courier-imap-imapd.sh restart
:OS=FREEBSD:exec:/usr/local/etc/rc.d/courier-imap-pop3d.sh restart

#AMaViS config

:AMAVIS=1:FILE=amavisd.conf       > [/usr/local/etc]/amavisd.conf
:AMAVIS=1:FILE=amavis_main.cf     >> [/usr/local/etc/postfix]/main.cf
:AMAVIS=1:FILE=amavis_master.cf   >> [/usr/local/etc/postfix]/master.cf
:OS=FREEBSD,AMAVIS=1:amavisd_enable="YES"\namavisd_ram="512m" >> [/etc]/rc.conf
:OS=FREEBSD,CLAMAV=1:clamav_clamd_enable="YES"\nclamav_freshclam_enable="YES" >> [/etc]/rc.conf

:OS=FREEBSD,CLAMAV=1:exec:a=`grep vscan:*:110:clamav /etc/group` ; if [ w$a != w ]; then cp /etc/group /etc/group_back && /bin/cat /etc/group_back | /usr/bin/sed 's/vscan:\*:110:/vscan:\*:110:clamav/' > /etc/group; fi; > [/dev]/null

:OS=FREEBSD:exec:/usr/local/etc/rc.d/clamav-clamd restart
:OS=FREEBSD:exec:/usr/local/etc/rc.d/amavisd restart
