This repository has been archived by the owner on Mar 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME.md.template
106 lines (82 loc) · 3.74 KB
/
README.md.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# postfix
{{ spec.short_description }}
This container image utilizes [distgen](https://github.com/devexp-db/distgen) for Dockerfile templating.
Please make sure that you have the tool installed before trying to build this image.
## How to build the container
Command for building container:
```
make build
```
To change `BASE` image, add the `DISTRO` argument into the build command, like:
```
make build DISTRO=fedora-28-x86_64
```
## How to use the container over standard 25 port
Command for running postfix docker container:
```
docker run -it -e MYHOSTNAME=localhost \
-p 25:10025\
-v /var/spool/postfix:/var/spool/postfix \
-v /var/spool/mail:/var/spool/mail {{ spec.envvars.name }}
-d {{ spec.image_repository }}
```
## How to use the container over standard TLS
Command for running {{ spec.envvars.name }} docker container:
```
docker run -it -e ENABLE_TLS -e DEBUG_MODE -e MYHOSTNAME=localhost \
-p 25:10025 \
{{ spec.envvars.name }} -d {{ spec.image_repository }}
```
Environment variable DEBUG_MODE is used for debugging purposes
from {{ spec.envvars.name }} point of view.
## How to use the container with IMAP.
Command for running {{ spec.envvars.name }} docker container:
```
POSTFIX_CERTS_PATH=/etc/postfix/certs
docker run -it -e ENABLE_IMAP -e MYHOSTNAME=localhost
-e DEBUG_MODE \
-p 587:10587 \
-v ${POSTFIX_CERTS_PATH}:/etc/postfix/certs \
{{ spec.envvars.name }} -d {{ spec.image_repository }}
```
POSTFIX_CERTS_PATH contains certificates used by {{ spec.envvars.name }}, like self signed certificate, keys, etc.
The example tree generated for localhost certificate can look like:
```bash
$ tree /etc/postfix/certs/
/etc/postfix/certs/
├── localhost.crt
├── localhost.csr
└── localhost.key
```
Environment variable DEBUG_MODE is used for debugging purposes from {{ spec.envvars.name }}.
# How to generate self signed SSL certificate for {{ spec.envvars.name }}
In case, you enable TLS support for {{ spec.envvars.name }}, you need to have certificates for {{ spec.envvars.name }} service.
For more information about Postfix TLS support see `http://www.postfix.org/TLS_README.html`
The page [POSTFIX_CERTS_GENERATION.md](/POSTFIX_CERTS_GENERATION.md) will help you with generation self signed certificate used by {{ spec.envvars.name }}.
## S2I extensibility
You can configure this container to adhere your needs using [Source-to-Image](https://github.com/openshift/source-to-image) and shell scripts. To create a new Docker image named `postfix-app`, that will be configured by your needs, just setup this directory: `./app-name/postfix-pre-init` that will contain `*.sh` scripts that will be executed right before postfix will start, so you can use `postconf` and other tools to configure postfix. Then just excute the s2i build:
```
s2i build file://path/to/app-name {{ spec.image_repository }} postfix-app
```
You can execute such image as you would non-s2i one:
```
docker run -it -e MYHOSTNAME=localhost \
-p 25:10025\
-v /var/spool/postfix:/var/spool/postfix \
-v /var/spool/mail:/var/spool/mail \
-d postfix-app
```
In this repo you can find an example for you to try this out. It implements an example of a null client configuration, as described [here](http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client). All it does is display the configuration, change it according to example and display it again. Assuming your working directory is this repository, just run:
```
s2i build file://$(pwd)/example {{ spec.image_repository }} postfix-example
```
And then run it:
```
docker run -it \
-p 25:10025\
-v /var/spool/postfix:/var/spool/postfix \
-v /var/spool/mail:/var/spool/mail \
-d postfix-example
```
## How to test the postfix mail server
See `help/help.md` file.