Skip to content

Commit fe55350

Browse files
committed
Cleaned code after live testing and improved documentation
1 parent e5719ce commit fe55350

5 files changed

+42
-30
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
docker-compose.yml
33
postfix/ssl/*
44
assert.sh*
5-
letsencrypt/
5+
letsencrypt/

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ Volumes allow to:
7070

7171
# client configuration
7272

73-
# imap
74-
username: <[email protected]>
75-
password: <username1password>
76-
server: <your-server-ip-or-hostname>
77-
imap port: 143 or 993 with ssl (recommended)
78-
imap path prefix: INBOX
79-
auth method: md5 challenge-response
80-
81-
# smtp
82-
smtp port: 25 or 587 with ssl (recommended)
83-
username: <[email protected]>
84-
password: <username1password>
85-
auth method: md5 challenge-response
73+
# imap
74+
username: <[email protected]>
75+
password: <username1password>
76+
server: <your-server-ip-or-hostname>
77+
imap port: 143 or 993 with ssl (recommended)
78+
imap path prefix: INBOX
79+
auth method: md5 challenge-response
80+
81+
# smtp
82+
smtp port: 25 or 587 with ssl (recommended)
83+
username: <[email protected]>
84+
password: <username1password>
85+
auth method: md5 challenge-response
8686

8787
# todo
8888

SSL.md

+24-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,30 @@ There are multiple options to enable SSL:
77

88
## let's encrypt
99

10-
To enable Let's Encrypt on your mail server, you have to add en environment variable `DMS_SSL` with value `letsencrypt`.
11-
You also have to mount your `letsencrypt` folder to `/etc/letsencrypt`.
12-
13-
14-
15-
TO BE FINISHED WHEN IT WILL BE TESTED
16-
17-
10+
To enable Let's Encrypt on your mail server, you have to add en environment variable `DMS_SSL` with value `letsencrypt` (see `docker-compose.yml.dist`)
11+
You also have to mount your `letsencrypt` folder to `/etc/letsencrypt` and it should look like that:
12+
13+
├── etc
14+
│   └── letsencrypt
15+
│   ├── accounts
16+
│   ├── archive
17+
│   │   └── mail.domain.com
18+
│   │   ├── cert1.pem
19+
│   │   ├── chain1.pem
20+
│   │   ├── fullchain1.pem
21+
│   │   └── privkey1.pem
22+
│   ├── csr
23+
│   ├── keys
24+
│   ├── live
25+
│   │   └── mail.domain.com
26+
│   │   ├── cert.pem -> ../../archive/mail.domain.com/cert1.pem
27+
│   │   ├── chain.pem -> ../../archive/mail.domain.com/chain1.pem
28+
│   │   ├── combined.pem
29+
│   │   ├── fullchain.pem -> ../../archive/mail.domain.com/fullchain1.pem
30+
│   │   └── privkey.pem -> ../../archive/mail.domain.com/privkey1.pem
31+
│   └── renewal
32+
33+
You don't have anything else to do.
1834

1935
## self signed certificates
2036

docker-compose.yml.dist

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mail:
22
# image: tvial/docker-mailserver
33
build: .
44
hostname: mail
5-
domainname: my-domain.com
5+
domainname: domain.com
66
ports:
77
- "25:25"
88
- "143:143"
@@ -11,3 +11,6 @@ mail:
1111
volumes:
1212
- ./spamassassin:/tmp/spamassassin/
1313
- ./postfix:/tmp/postfix/
14+
- ./letsencrypt/etc:/etc/letsencrypt
15+
environment:
16+
- DMS_SSL=letsencrypt

start-mailserver.sh

-7
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ case $DMS_SSL in
5959
"letsencrypt" )
6060
# letsencrypt folders and files mounted in /etc/letsencrypt
6161

62-
# Adding certificates from Letsencrypt and IdenTrust
63-
# curl https://letsencrypt.org/certs/isrgrootx1.pem -so /etc/ssl/certs/isrgrootx1.pem
64-
# curl https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem -so /etc/ssl/certs/lets-encrypt-x1-cross-signed.pem
65-
# curl https://letsencrypt.org/certs/lets-encrypt-x2-cross-signed.pem -so /etc/ssl/certs/lets-encrypt-x2-cross-signed.pem
66-
# curl https://letsencrypt.org/certs/letsencryptauthorityx1.pem -so /etc/ssl/certs/letsencryptauthorityx1.pem
67-
# curl https://letsencrypt.org/certs/letsencryptauthorityx2.pem -so /etc/ssl/certs/letsencryptauthorityx2.pem
68-
6962
# Postfix configuration
7063
sed -i -r 's/smtpd_tls_cert_file=\/etc\/ssl\/certs\/ssl-cert-snakeoil.pem/smtpd_tls_cert_file=\/etc\/letsencrypt\/live\/'$(hostname)'\/fullchain.pem/g' /etc/postfix/main.cf
7164
sed -i -r 's/smtpd_tls_key_file=\/etc\/ssl\/private\/ssl-cert-snakeoil.key/smtpd_tls_key_file=\/etc\/letsencrypt\/live\/'$(hostname)'\/privkey.pem/g' /etc/postfix/main.cf

0 commit comments

Comments
 (0)