Skip to content

Commit aae42fa

Browse files
authored
ci(fix): Normalize for .gitattributes + improve eclint coverage (docker-mailserver#3566)
1 parent bd96c11 commit aae42fa

File tree

27 files changed

+122
-301
lines changed

27 files changed

+122
-301
lines changed

.editorconfig

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ root = true
88
[*]
99
charset = utf-8
1010
end_of_line = lf
11+
indent_size = 2
1112
indent_style = space
1213
insert_final_newline = true
1314
trim_trailing_whitespace = true
@@ -16,21 +17,9 @@ trim_trailing_whitespace = true
1617
# --- Specific ----------------------------------
1718
# -----------------------------------------------
1819

19-
[*.{yaml,yml,sh,bats}]
20-
indent_size = 2
21-
22-
[Makefile]
20+
[{Makefile,.gitmodules}]
2321
indent_style = tab
2422
indent_size = 4
2523

2624
[*.md]
2725
trim_trailing_whitespace = false
28-
29-
# -----------------------------------------------
30-
# --- Git Submodules ----------------------------
31-
# -----------------------------------------------
32-
33-
[{test/bats/**,test/test_helper/**}]
34-
indent_style = none
35-
indent_size = none
36-
end_of_line = none

.github/pull_request_template.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Description
22

3-
<!-- Include a summary of the change.
4-
Please also include relevant motivation and context. -->
3+
<!--
4+
Include a summary of the change.
5+
Please also include relevant motivation and context.
6+
-->
57

68
<!-- Link the issue which will be fixed (if any) here: -->
79
Fixes #

CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ In this release the relay-host support saw [significant internal refactoring](ht
311311

312312
1. **Many** minor improvements were made (cleanup & refactoring). Please refer to the section below to get an overview over all improvements. Moreover, there was a lot of cleanup in the scripts and in the tests. The documentation was adjusted accordingly.
313313
2. New environment variables were added:
314-
1. [`CLAMAV_MESSAGE_SIZE_LIMIT`](https://docker-mailserver.github.io/docker-mailserver/v11.0/config/environment/#clamav_message_size_limit)
315-
2. [`TZ`](https://docker-mailserver.github.io/docker-mailserver/v11.0/config/environment/#tz)
314+
1. [`CLAMAV_MESSAGE_SIZE_LIMIT`](https://docker-mailserver.github.io/docker-mailserver/v11.0/config/environment/#clamav_message_size_limit)
315+
2. [`TZ`](https://docker-mailserver.github.io/docker-mailserver/v11.0/config/environment/#tz)
316316
3. SpamAssassin KAM was added with [`ENABLE_SPAMASSASSIN_KAM`](https://docker-mailserver.github.io/docker-mailserver/v11.0/config/environment/#enable_spamassassin_kam).
317317
4. The `fail2ban` command was reworked and can now ban IP addresses as well.
318318
5. There were a few small fixes, especially when it comes to bugs in scripts and service restart loops (no functionality changes, only fixes of existing functionality). When building an image from the Dockerfile - Installation of Postfix on modern Linux distributions should now always succeed.
@@ -368,8 +368,7 @@ In this release the relay-host support saw [significant internal refactoring](ht
368368

369369
### Critical Changes
370370

371-
1. This release fixes a critical issue for LDAP users, installing a needed package on Debian 11
372-
on build-time. Moreover, a race-condition was eliminated ([#2341](https://github.com/docker-mailserver/docker-mailserver/pull/2341)).
371+
1. This release fixes a critical issue for LDAP users, installing a needed package on Debian 11 on build-time. Moreover, a race-condition was eliminated ([#2341](https://github.com/docker-mailserver/docker-mailserver/pull/2341)).
373372
2. A resource leak in `check-for-changes.sh` was fixed ([#2401](https://github.com/docker-mailserver/docker-mailserver/pull/2401))
374373

375374
### Other Minor Changes

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ EOF
134134

135135
COPY target/postsrsd/postsrsd /etc/default/postsrsd
136136
COPY target/postgrey/postgrey /etc/default/postgrey
137-
COPY target/postgrey/postgrey.init /etc/init.d/postgrey
138137
RUN <<EOF
139-
chmod 755 /etc/init.d/postgrey
140138
mkdir /var/run/postgrey
141139
chown postgrey:postgrey /var/run/postgrey
142140
curl -Lsfo /etc/postgrey/whitelist_clients https://postgrey.schweikert.ch/pub/postgrey_whitelist_clients

docs/content/config/advanced/dovecot-master-accounts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Once a master account is configured, it is possible to connect to any users mail
1818

1919
Username: `<EMAIL ADDRESS>*<MASTER ACCOUNT NAME>`
2020

21-
Password: `<MASTER ACCOUNT PASSWORD>`
21+
Password: `<MASTER ACCOUNT PASSWORD>`

docs/content/config/advanced/ipv6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Next, configure a network with an IPv6 subnet for your container with any of the
132132

133133
!!! warning "This approach is discouraged"
134134

135-
The [`bridge` network is considered legacy][docker-docs-network-bridge-legacy].
135+
The [`bridge` network is considered legacy][docker-docs-network-bridge-legacy].
136136

137137
Add these two extra IPv6 settings to your daemon config. They only apply to the [default `bridge` docker network][docker-docs-ipv6-create-default] aka `docker0` (_which containers are attached to by default when using `docker run`_).
138138

docs/content/config/advanced/mail-sieve.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ It is possible to sort subaddresses such as `[email protected]` int
6969
require ["envelope", "fileinto", "mailbox", "subaddress", "variables"];
7070
7171
if envelope :detail :matches "to" "*" {
72-
set :lower :upperfirst "tag" "${1}";
73-
if mailboxexists "INBOX.${1}" {
74-
fileinto "INBOX.${1}";
75-
} else {
76-
fileinto :create "INBOX.${tag}";
77-
}
72+
set :lower :upperfirst "tag" "${1}";
73+
if mailboxexists "INBOX.${1}" {
74+
fileinto "INBOX.${1}";
75+
} else {
76+
fileinto :create "INBOX.${tag}";
77+
}
7878
}
7979
```
8080

docs/content/config/security/ssl.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ Obtain a Cloudflare API token:
161161
dns_cloudflare_api_token = YOUR_CLOUDFLARE_TOKEN_HERE
162162
```
163163

164-
- As this is sensitive data, you should restrict access to it with `chmod 600` and `chown 0:0`.
165-
- Store the file in a folder if you like, such as `docker-data/certbot/secrets/`.
164+
- As this is sensitive data, you should restrict access to it with `chmod 600` and `chown 0:0`.
165+
- Store the file in a folder if you like, such as `docker-data/certbot/secrets/`.
166+
166167
5. Your `compose.yaml` should include the following:
167168

168169
```yaml
@@ -594,7 +595,7 @@ This setup only comes with one caveat: The domain has to be configured on anothe
594595
container_name: mailserver
595596
hostname: mail.example.com
596597
volumes:
597-
- ./docker-data/traefik/acme.json:/etc/letsencrypt/acme.json:ro
598+
- ./docker-data/traefik/acme.json:/etc/letsencrypt/acme.json:ro
598599
environment:
599600
SSL_TYPE: letsencrypt
600601
SSL_DOMAIN: mail.example.com
@@ -605,26 +606,26 @@ This setup only comes with one caveat: The domain has to be configured on anothe
605606
image: docker.io/traefik:latest #v2.5
606607
container_name: docker-traefik
607608
ports:
608-
- "80:80"
609-
- "443:443"
609+
- "80:80"
610+
- "443:443"
610611
command:
611-
- --providers.docker
612-
- --entrypoints.http.address=:80
613-
- --entrypoints.http.http.redirections.entryPoint.to=https
614-
- --entrypoints.http.http.redirections.entryPoint.scheme=https
615-
- --entrypoints.https.address=:443
616-
- --entrypoints.https.http.tls.certResolver=letsencrypt
617-
618-
- --certificatesresolvers.letsencrypt.acme.storage=/acme.json
619-
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http
612+
- --providers.docker
613+
- --entrypoints.http.address=:80
614+
- --entrypoints.http.http.redirections.entryPoint.to=https
615+
- --entrypoints.http.http.redirections.entryPoint.scheme=https
616+
- --entrypoints.https.address=:443
617+
- --entrypoints.https.http.tls.certResolver=letsencrypt
618+
619+
- --certificatesresolvers.letsencrypt.acme.storage=/acme.json
620+
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http
620621
volumes:
621-
- ./docker-data/traefik/acme.json:/acme.json
622-
- /var/run/docker.sock:/var/run/docker.sock:ro
622+
- ./docker-data/traefik/acme.json:/acme.json
623+
- /var/run/docker.sock:/var/run/docker.sock:ro
623624
624625
whoami:
625626
image: docker.io/traefik/whoami:latest
626627
labels:
627-
- "traefik.http.routers.whoami.rule=Host(`mail.example.com`)"
628+
- "traefik.http.routers.whoami.rule=Host(`mail.example.com`)"
628629
```
629630
630631
### Self-Signed Certificates

docs/content/contributing/tests.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,49 +85,51 @@ In this example, you've made a change to the Rspamd feature support (_or adjuste
8585
```console
8686
$ make clean generate-accounts test/rspamd
8787
rspamd.bats
88-
✓ [Rspamd] Postfix's main.cf was adjusted [12]
89-
✓ [Rspamd] normal mail passes fine [44]
90-
✓ [Rspamd] detects and rejects spam [122]
91-
✓ [Rspamd] detects and rejects virus [189]
88+
✓ [Rspamd] Postfix's main.cf was adjusted [12]
89+
✓ [Rspamd] normal mail passes fine [44]
90+
✓ [Rspamd] detects and rejects spam [122]
91+
✓ [Rspamd] detects and rejects virus [189]
9292
```
9393

9494
As your feature work progresses your change for Rspamd also affects ClamAV. As your change now spans more than just the Rspamd test file, you could run multiple test files serially:
9595

9696
```console
9797
$ make clean generate-accounts test/rspamd,clamav
9898
rspamd.bats
99-
✓ [Rspamd] Postfix's main.cf was adjusted [12]
100-
✓ [Rspamd] normal mail passes fine [44]
101-
✓ [Rspamd] detects and rejects spam [122]
102-
✓ [Rspamd] detects and rejects virus [189]
99+
✓ [Rspamd] Postfix's main.cf was adjusted [12]
100+
✓ [Rspamd] normal mail passes fine [44]
101+
✓ [Rspamd] detects and rejects spam [122]
102+
✓ [Rspamd] detects and rejects virus [189]
103+
103104
clamav.bats
104-
✓ [ClamAV] log files exist at /var/log/mail directory [68]
105-
✓ [ClamAV] should be identified by Amavis [67]
106-
✓ [ClamAV] freshclam cron is enabled [76]
107-
✓ [ClamAV] env CLAMAV_MESSAGE_SIZE_LIMIT is set correctly [63]
108-
✓ [ClamAV] rejects virus [60]
105+
✓ [ClamAV] log files exist at /var/log/mail directory [68]
106+
✓ [ClamAV] should be identified by Amavis [67]
107+
✓ [ClamAV] freshclam cron is enabled [76]
108+
✓ [ClamAV] env CLAMAV_MESSAGE_SIZE_LIMIT is set correctly [63]
109+
✓ [ClamAV] rejects virus [60]
109110
```
110111

111112
You're almost finished with your change before submitting it as a PR. It's a good idea to run the full parallel set those individual tests belong to (_especially if you've modified any tests_):
112113

113114
```console
114115
$ make clean generate-accounts tests/parallel/set1
115116
default_relay_host.bats
116-
✓ [Relay] (ENV) 'DEFAULT_RELAY_HOST' should configure 'main.cf:relayhost' [88]
117+
✓ [Relay] (ENV) 'DEFAULT_RELAY_HOST' should configure 'main.cf:relayhost' [88]
118+
117119
spam_virus/amavis.bats
118-
✓ [Amavis] SpamAssassin integration should be active [1165]
120+
✓ [Amavis] SpamAssassin integration should be active [1165]
121+
119122
spam_virus/clamav.bats
120-
✓ [ClamAV] log files exist at /var/log/mail directory [73]
121-
✓ [ClamAV] should be identified by Amavis [67]
122-
✓ [ClamAV] freshclam cron is enabled [76]
123+
✓ [ClamAV] log files exist at /var/log/mail directory [73]
124+
✓ [ClamAV] should be identified by Amavis [67]
125+
✓ [ClamAV] freshclam cron is enabled [76]
123126
...
124127
```
125128

126129
Even better, before opening a PR run the full test suite:
127130

128131
```console
129132
$ make clean tests
130-
...
131133
```
132134

133135
[BATS]: https://github.com/bats-core/bats-core

docs/content/faq.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,9 @@ require ["comparator-i;ascii-numeric","relational","fileinto"];
511511
if header :contains "X-Spam-Flag" "YES" {
512512
fileinto "Junk";
513513
} elsif allof (
514-
not header :matches "x-spam-score" "-*",
515-
header :value "ge" :comparator "i;ascii-numeric" "x-spam-score" "3.75" ) {
514+
not header :matches "x-spam-score" "-*",
515+
header :value "ge" :comparator "i;ascii-numeric" "x-spam-score" "3.75"
516+
) {
516517
fileinto "Junk";
517518
}
518519
```

docs/content/introduction.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ Here's where DMS's toolchain fits within the delivery chain:
4343

4444
```txt
4545
docker-mailserver is here:
46-
┏━━━━━━━┓
47-
Sending an email: MUA ---> MTA ---> (MTA relays) ---> ┫ MTA ╮ ┃
48-
Fetching an email: MUA <------------------------------ ┫ MDA ╯ ┃
49-
┗━━━━━━━┛
46+
┏━━━━━━━┓
47+
Sending an email: MUA ---> MTA ---> (MTA relays) ---> ┫ MTA ╮ ┃
48+
Fetching an email: MUA <------------------------------ ┫ MDA ╯ ┃
49+
┗━━━━━━━┛
5050
```
5151

5252
??? example "An Example"
@@ -86,18 +86,18 @@ When it comes to the specifics of email exchange, we have to look at protocols a
8686
The following picture gives a visualization of the interplay of all components and their [respective ports][docs-understandports]:
8787

8888
```txt
89-
┏━━━━━━━━━━ Submission ━━━━━━━━━━━━┓┏━━━━━━━━━━━━━ Transfer/Relay ━━━━━━━━━━━┓
90-
91-
┌─────────────────────┐ ┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
92-
MUA ----- STARTTLS ------> ┤(587) MTA ╮ (25)├ <-- cleartext ---> ┊ Third-party MTA ┊
93-
----- implicit TLS --> ┤(465) │ | └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
94-
----- cleartext -----> ┤(25) │ |
95-
|┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄|
96-
MUA <---- STARTTLS ------- ┤(143) MDA ╯ |
97-
<---- implicit TLS --- ┤(993) |
98-
└─────────────────────┘
99-
100-
┗━━━━━━━━━━ Retrieval ━━━━━━━━━━━━━┛
89+
┏━━━━━━━━━━ Submission ━━━━━━━━━━━━┓┏━━━━━━━━━━━━━ Transfer/Relay ━━━━━━━━━━━┓
90+
91+
┌─────────────────────┐ ┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
92+
MUA ----- STARTTLS -------> ┤(587) MTA ╮ (25)├ <-- cleartext ---> ┊ Third-party MTA ┊
93+
----- implicit TLS ---> ┤(465) │ | └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
94+
----- cleartext ------> ┤(25) │ |
95+
|┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄|
96+
MUA <---- STARTTLS -------- ┤(143) MDA ╯ |
97+
<---- implicit TLS ---- ┤(993) |
98+
└─────────────────────┘
99+
100+
┗━━━━━━━━━━ Retrieval ━━━━━━━━━━━━━┛
101101
```
102102

103103
If you're new to email infrastructure, both that table and the schema may be confusing.
@@ -124,15 +124,15 @@ My MTA will thus have to support two kinds of Submission:
124124
- Inbound Submission (third-party email has been submitted & relayed, then is accepted "inside" by the MTA)
125125

126126
```txt
127-
┏━━━ Outbound Submission ━━━┓
127+
┏━━━ Outbound Submission ━━━┓
128128
129129
┌────────────────────┐ ┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
130130
Me ---------------> ┤ ├ -----------------> ┊ ┊
131131
│ My MTA │ ┊ Third-party MTA ┊
132132
│ ├ <----------------- ┊ ┊
133133
└────────────────────┘ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
134134
135-
┗━━━━━━━━━━ Inbound Submission ━━━━━━━━━━┛
135+
┗━━━━━━━━━━ Inbound Submission ━━━━━━━━━━┛
136136
```
137137

138138
#### Outbound Submission
@@ -168,7 +168,7 @@ Granted it's still very difficult enforcing encryption between MTAs (Transfer/Re
168168
Overall, DMS's default configuration for SMTP looks like this:
169169

170170
```txt
171-
┏━━━ Outbound Submission ━━━┓
171+
┏━━━ Outbound Submission ━━━┓
172172
173173
┌────────────────────┐ ┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
174174
Me -- cleartext --> ┤(25) (25)├ --- cleartext ---> ┊ ┊
@@ -177,7 +177,7 @@ Me -- STARTTLS ---> ┤(587) │ ┊
177177
│ (25)├ <---cleartext ---- ┊ ┊
178178
└────────────────────┘ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
179179
180-
┗━━━━━━━━━━ Inbound Submission ━━━━━━━━━━┛
180+
┗━━━━━━━━━━ Inbound Submission ━━━━━━━━━━┛
181181
```
182182

183183
### Retrieval - IMAP
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22

33
@local_domains_maps = (
4-
read_hash('/etc/postfix/vhost')
4+
read_hash('/etc/postfix/vhost')
55
);
66

77
1; # ensure a defined return

target/bin/open-dkim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ ${ORANGE}OPTIONS${RESET}
4242
selector Set a manual selector for the key.
4343
Default: mail
4444
domain Provide the domain(s) for which to generate keys for.
45-
Default: The FQDN assigned to DMS, excluding any subdomain.
46-
'ACCOUNT_PROVISIONER=FILE' also sources domains from mail accounts.
45+
Default: The FQDN assigned to DMS, excluding any subdomain.
46+
'ACCOUNT_PROVISIONER=FILE' also sources domains from mail accounts.
4747
4848
${ORANGE}EXAMPLES${RESET}
4949
${LWHITE}setup config dkim keysize 4096${RESET}

0 commit comments

Comments
 (0)