Migrating from Mavericks >>>
Preserving the Email Settings and Data
Email is a little trickier to prepare prior to rebuilding the server.
You should know what your setting are so it shouldn’t be too hard to re-enter all of the necessary details, and if you are using an ISP Relay I have already documented how to set that up here, but the challenge is in saving you existing data.
As I only have four EMail accounts to protect I cheated and simply copied all of the folders, for all of the users, to iCloud which allowed me to maintain all of the directories and data
But if you want to work out the “correct” way to do it, the following shows the Email architecture that is used by Apple in their server software and is reproduced from the Apple Support Pages
Yosemite Server Admin: Mail service architecture
Mail service allows network users to send and receive mail over your network or across the Internet.
Mail service sends and receives mail using the following standard Internet mail protocols:
- Simple Mail Transfer Protocol (SMTP)
- Internet Message Access Protocol (IMAP)
- Post Office Protocol (POP)
A standard mail client setup uses SMTP to send outgoing mail and POP and IMAP to receive incoming mail. Mail service includes an SMTP service and a combined POP and IMAP service.
Mail service also uses a Domain Name System (DNS) service to determine the destination IP address of outgoing mail.
The following figure gives an overview of how the components of Mail service interact:

Mail Transfer Agent (MTA)
Mail is transferred from incoming mail storage to the mail recipient’s inbox by a local delivery agent (LDA). The LDA handles local delivery, making mail accessible by the user’s mail application.
OS X Mavericks uses Postfix as its Mail Transfer Agent (MTA). Postfix fully supports SMTP. Your mail users set their mail application’s outgoing mail server to your mail server running Postfix.
Internet Message Access Protocol (IMAP)
IMAP is the solution for people who use more than one computer to receive mail. IMAP is a client-server mail protocol that allows users to access mail from anywhere on the Internet and is the protocol that I have deployed on all the servers at home.
With IMAP, a user’s mail is delivered to the server and stored in a remote mailbox on the server. To users, mail appears as if it were on the local computer.
A key difference between IMAP and POP is that with IMAP the mail isn’t removed from the server until the user deletes it.
The IMAP user’s computer can ask the server for message headers, ask for the bodies of specified messages, or search for messages that meet certain criteria. These messages are downloaded as the user opens them.
IMAP connections are persistent and remain open, maintaining a load on the server and possibly the network as well.
This means that I you should be able to backup all of the users Email from the server mail directory shown below
/Library/Server/Mail/Data/mail/users