Setup Email Server From Scratch On FreeBSD #2 - 25 IMAPSYNC

13 Postscreen <- Intro -> 80 Bind DNS

We believe in data independence, and support others who want data independence.
This tutorial is complete 2025-08-14 except there is no page for setting up postscreen.

This is version 2 and everthing works.


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 google 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

13 Postscreen <- Intro -> 80 Bind DNS