Skip to content

Server-Factory/Mail-Server-Factory

 
 

Repository files navigation

Mail Server Factory

Version information:

About the project

The purpose of the Mail Server Factory project is to provide a simple way for the end-user to easily set up and run its mail server. The end-user writes the configuration as a simple JSON which is then interpreted and understood by the Mail Server Factory. Mail Server Factory performs various installations and initializations based on this JSON on the target operating system. Mail server stack that is deployed on the target operating system runs on Docker. Each stack component is loosely coupled which creates a solid base for further / future scalability.

System requirements

To be able to run Mail Server Factory the following system requirements must meet:

  • Modern computer (or server) as a hardware
  • OpenJDK
  • Gradle build system

Compatibility

Mail Server Factory supports the following target operating systems:

  • CentOS Server 7 and 8
  • Fedora Server versions: 30 to 34
  • Fedora Workstation versions: 30 to 34
  • Ubuntu Desktop 20 and 21

Note: Many other operating systems will be supported in upcoming releases.

SeLinux

The current version of Mail Server Factory does not support SELinux enforcing.

Specifications

Installed mail server will be delivered with the following technology stack:

Note: The mail server will use self-signed certificates for encrypting the communication. For this purpose proper CA will be configured on the server.

Web setup

Simply execute the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Server-Factory/Utils/master/web_installer.sh)"

Mail Server Factory will be downloaded and installed.

Hot to use

Examples directory contains examples of JSON configuration(s) for Mail Server Factory deployment(s). Detailed explanations for every configuration variable will be provided in upcoming releases.

To be able to try and run examples it is required to follow instructions from Includes Readme file.

To run Mail Server Factory simply execute the program and pass to it path to the configuration JSON file. For Instance:

mail_factory Examples/Centos_8.json

or (if you are using Java .jar):

java -jar Application/build/libs/Application.jar Examples/Centos_8.json

The current version of Mail Server Factory performs SSH access to target hosts using keys. For enabling SSH access using keys the following bash script can be used.

Example of init_ssh_access.sh script use:

sh Core/Utils/init_ssh_access.sh centos7.local

A detailed explanation of the script can be found here under "SSH login without password" section.

Note: We strongly recommend the clean installation of the server operating system to be used with Mail Server Factory so there is no conflict of any kind with existing software or services.

Using installed mail server

After the mail server is installed execute the following command on your server to see the list of running Docker containers:

docker ps -a

The list will contain the following services:

  • postmaster_receive, ports: 3993/tcp, 0.0.0.0:3993->993/tcp
  • postmaster_send, ports: 0.0.0.0:465->465/tcp
  • postmaster_antispam, 11332-11333/tcp, 127.0.0.1:11334->11334/tcp
  • postmaster_antivirus, no ports
  • postmaster_mem_db, ports: 127.0.0.1:36379->6379/tcp
  • postmaster_db, 127.0.0.1:35432->5432/tcp

Example configuration for one of the installed email accounts on the Mozilla Thunderbird client:

Note: Pay attention to custom port number.

Once configuration is filled in the form, you must accept TLS certificate:

Mail Server Factory in action

Tbd. (YouTube video)

Cloning the project

To be able to read project source code or contribute it is required to clone the Git repository. The following command clones the project and initializes all Git submodules:

mkdir Factory && cd Factory
git clone --recurse-submodules git@github.com:Server-Factory/Mail-Server-Factory.git .

Building the project

To build the project cd into the directory where you have cloned the code and execute:

gradle wrapper
./gradlew assemble

Note: To be able to execute Gradle commands, Gradle must be installed on your system.

Running tests

To execute project tests cd into the directory where you have cloned the code and execute:

./gradlew test

Note: To be able to pass tests Docker must be installed on your system.

Git submodules

A complete list of Git submodules used by the project can be found here.