Setup Email Server From Scratch On FreeBSD - 25 IMAPSYNC
09 Blocking Spam <- Intro -> 99 FreeBSD NAT64 Router
This tutorial is partially complete 2025-05-14
Postfix, Dovecot, & PostfixAdmin work with MySQL and virtual accounts
can be created with PostfixAdmin and used with an email client. SPF, OpenDKIM,
and DMARC milters, Roundcube with sieve filters and password plugins all work.
Roundcube kolab calendar works (2025-05-20)
Updated on 2025-04-29
A good way to move email from one system to another is to use imapsync.
On FreeBSD it is included as a standard package and can be installed with ...
pkg update
pkg upgrade
pkg install imapsync
To use imap sync with goole or microsoft aka gmail, outlook, live, or hotmail
you may need to set an app specific password or turn off two factor authentication.
I got my email off these services with an app specific password before they got
too sticky but was unable to do it later, so mileage may vary.
To use imapsync here are some examples ...
# Google To Mail Stack
./imapsync --nosyncacls --subscribe --syncinternaldates --addheader --host1 \
imap.gmail.com --user1 user1@gmail.com --password1 oldappspecificpassword --ssl1 \
--host2 mx.domain2.com -user2 user2@domain2.com -password2 mynewemailpassword --ssl2
# Hotmail To Mail Stack
./imapsync --nosyncacls --subscribe --syncinternaldates --addheader --host1 \
outlook.office365.com --user1 user1@hotmail.com --password1 hotmailappspecificpassword --ssl1 \
--host2 mx.domain2.com -user2 user2@domain2.com -password2 mynewmailpassword --ssl2
I recently moved my email from a zimbra email service to a new one installed on Debian
using the tutorial from linuxbabe. This tutorial is out of date but is an excellent
roadmap to install and tune a mail stack from scratch.
# Zimbra To Mail Stack
./imapsync --nosyncacls --subscribe --syncinternaldates --addheader --host1 \
192.168.100.1 --user1 user1@domain1.net --password1 oldemailpassword --ssl1 --host2 \
10.55.55.35 -user2 user1@domain2.com -password2 newmailpassword --ssl2