.
export JAIL=mail export JAILHOSTNAME=mail export JAILDOMAIN=ahlawat.com export JAILIP=100 export JAILUSER=X export JAILUSERID=1000 export JAILUSERVNC=false /root/FreeBSD/jails/create.sh $JAIL $JAILHOSTNAME $JAILDOMAIN $JAILIP $JAILUSER $JAILUSERID $JAILUSERVNC iocage exec $JAIL "service sendmail stop" iocage exec $JAIL "sysrc sendmail_enable=NONE" iocage exec $JAIL "sysrc sendmail_submit_enable=NO" iocage exec $JAIL "sysrc sendmail_msp_queue_enable=NO" iocage exec $JAIL "cp /mnt/config/periodic.conf /etc" iocage exec $JAIL "mkdir -p /data" iocage fstab -a $JAIL /mnt/ship/email /data nullfs rw 0 0 iocage fstab -l $JAIL iocage exec $JAIL "pkg install -r pkgp121 openldap-sasl-client" iocage exec $JAIL "pkg lock -y openldap-sasl-client" iocage exec $JAIL "pkg install -y postfix dovecot dovecot-pigeonhole rspamd dcc-dccd apache-solr redis" ## need to make postfix dovecot dovecot-pigeonhole rspamd dcc-dccd in pkgp ## https://www.rhyolite.com/dcc/ ## https://www.dcc-servers.net/dcc/FAQ.html iocage exec $JAIL 'echo "root: jail-root@ahlawat.com" >> /etc/mail/aliases' iocage exec $JAIL "ln -s /etc/mail/aliases.db /etc/" iocage exec $JAIL "newaliases" iocage exec $JAIL "sysrc postfix_enable=YES" iocage exec $JAIL "service postfix start" iocage exec $JAIL "sysrc dovecot_enable=YES" iocage exec $JAIL "service dovecot start" iocage exec $JAIL "sysrc solr_enable=YES" iocage exec $JAIL "service solr start" iocage exec $JAIL "sysrc rspamd_enable=YES" iocage exec $JAIL "service rspamd start" iocage exec $JAIL "sysrc redis_enable=YES" iocage exec $JAIL "service redis start" iocage exec $JAIL "sysrc dccifd_enable=YES" iocage exec $JAIL "service dccifd start"
Call service provider to setup reverse dns (PTR record) for IP to map to mail.ahlawat.com and mail-backup.ahlawat.com
##iocage exec $JAIL "mkdir -p /mnt/oldmail" ##iocage fstab -a $JAIL /mnt/ship/mail /mnt/oldmail nullfs rw 0 0 ##iocage exec $JAIL "mkdir -p /mnt/backup" ##iocage fstab -a $JAIL /mnt/data/apps/$JAIL /mnt/backup nullfs rw 0 0 crontab -l #15 2 * * * /usr/local/solr/bin/solr /usr/local/bin/curl -s 'http://localhost:8983/solr/dovecot/update?optimize=true' > /dev/null #*/5 * * * * /usr/local/solr/bin/solr /usr/local/bin/curl -s 'http://localhost:8983/solr/dovecot/update?commit=true' > /dev/null 0 2 * * * /usr/bin/find /usr/local/dcc/log/ -not -newermt '1 days ago' -delete 8 0 * * * /mnt/config/postfix-reload.sh