mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
formatting files according to standard (#1619)
* added EditorConfig linting * adding `eclint` as Travis script target * re-adjusted .pem files to have a newline
This commit is contained in:
parent
9f7414d95f
commit
a0791ef457
|
@ -28,8 +28,6 @@ indent_size = 2
|
||||||
|
|
||||||
# directories created by git submodules
|
# directories created by git submodules
|
||||||
[{test/bats/**,test/test_helper/bats-assert/**,test/test_helper/bats-support/**,target/docker-configomat/**}]
|
[{test/bats/**,test/test_helper/bats-assert/**,test/test_helper/bats-support/**,target/docker-configomat/**}]
|
||||||
insert_final_newline = none
|
|
||||||
indent_style = none
|
indent_style = none
|
||||||
indent_size = none
|
indent_size = none
|
||||||
trim_trailing_whitespace = none
|
|
||||||
end_of_line = none
|
end_of_line = none
|
||||||
|
|
14
.travis.yml
14
.travis.yml
|
@ -10,6 +10,7 @@ env:
|
||||||
global:
|
global:
|
||||||
- HADOLINT_VERSION=1.17.1
|
- HADOLINT_VERSION=1.17.1
|
||||||
- SHELLCHECK_VERSION=0.7.1
|
- SHELLCHECK_VERSION=0.7.1
|
||||||
|
- ECLINT_VERSION=2.1.0
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
@ -20,10 +21,16 @@ services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo curl -L https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint
|
# HADOLINT
|
||||||
|
- sudo curl -L https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint
|
||||||
- sudo chmod +rx /usr/local/bin/hadolint
|
- sudo chmod +rx /usr/local/bin/hadolint
|
||||||
- sudo wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJv
|
# SHELLCHECK
|
||||||
- sudo cp "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
|
- sudo wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJ
|
||||||
|
- sudo mv "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
|
||||||
|
# ECLINT
|
||||||
|
- sudo wget -qO- "https://github.com/editorconfig-checker/editorconfig-checker/releases/download/${ECLINT_VERSION}/ec-linux-amd64.tar.gz" | tar -xaz
|
||||||
|
- sudo mv bin/ec-linux-amd64 /usr/bin/eclint
|
||||||
|
- sudo chmod +x /usr/bin/eclint
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- make lint
|
- make lint
|
||||||
|
@ -31,6 +38,7 @@ install:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make shellcheck
|
- make shellcheck
|
||||||
|
- make eclint
|
||||||
- make generate-accounts run generate-accounts-after-run fixtures tests
|
- make generate-accounts run generate-accounts-after-run fixtures tests
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
|
|
18
Makefile
18
Makefile
|
@ -19,12 +19,8 @@ build:
|
||||||
backup:
|
backup:
|
||||||
# if backup directories exist, clean hasn't been called, therefore
|
# if backup directories exist, clean hasn't been called, therefore
|
||||||
# we shouldn't overwrite it. It still contains the original content.
|
# we shouldn't overwrite it. It still contains the original content.
|
||||||
@ if [ ! -d config.bak ]; then\
|
@ if [ ! -d config.bak ]; then cp -rp config config.bak; fi
|
||||||
cp -rp config config.bak;\
|
@ if [ ! -d testconfig.bak ]; then cp -rp test/config testconfig.bak; fi
|
||||||
fi
|
|
||||||
@ if [ ! -d testconfig.bak ]; then\
|
|
||||||
cp -rp test/config testconfig.bak;\
|
|
||||||
fi
|
|
||||||
|
|
||||||
generate-accounts:
|
generate-accounts:
|
||||||
@ docker run --rm -e MAIL_USER=user1@localhost.localdomain -e MAIL_PASS=mypassword -t $(NAME) /bin/sh -c 'echo "$$MAIL_USER|$$(doveadm pw -s SHA512-CRYPT -u $$MAIL_USER -p $$MAIL_PASS)"' > test/config/postfix-accounts.cf
|
@ docker run --rm -e MAIL_USER=user1@localhost.localdomain -e MAIL_PASS=mypassword -t $(NAME) /bin/sh -c 'echo "$$MAIL_USER|$$(doveadm pw -s SHA512-CRYPT -u $$MAIL_USER -p $$MAIL_PASS)"' > test/config/postfix-accounts.cf
|
||||||
|
@ -173,3 +169,13 @@ shellcheck:
|
||||||
else\
|
else\
|
||||||
echo -e '\nSuccess' ;\
|
echo -e '\nSuccess' ;\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
eclint:
|
||||||
|
@ echo -e "Testing file formatting according to .editorconfig\n"
|
||||||
|
@ printf "Version %s\n\n" "$$(/usr/bin/eclint --version)"
|
||||||
|
@ if /usr/bin/eclint -exclude "\.bats$$" | grep .; then\
|
||||||
|
echo -e "\nError" ;\
|
||||||
|
exit 1 ;\
|
||||||
|
else\
|
||||||
|
echo -e '\nSuccess' ;\
|
||||||
|
fi
|
||||||
|
|
43
README.md
43
README.md
|
@ -15,13 +15,13 @@
|
||||||
[shields::gitter]: https://img.shields.io/gitter/room/tomav/docker-mailserver.svg
|
[shields::gitter]: https://img.shields.io/gitter/room/tomav/docker-mailserver.svg
|
||||||
[gitter]: https://gitter.im/tomav/docker-mailserver
|
[gitter]: https://gitter.im/tomav/docker-mailserver
|
||||||
|
|
||||||
A fullstack but simple mail server (smtp, imap, antispam, antivirus...).
|
A fullstack but simple mail server (SMTP, IMAP, Antispam, Antivirus...).
|
||||||
Only configuration files, no SQL database. Keep it simple and versioned.
|
Only configuration files, no SQL database. Keep it simple and versioned.
|
||||||
Easy to deploy and upgrade.
|
Easy to deploy and upgrade.
|
||||||
|
|
||||||
Why I created this image: [Simple Mail Server with Docker](http://tvi.al/simple-mail-server-with-docker/)
|
Why I created this image: [Simple Mail Server with Docker](http://tvi.al/simple-mail-server-with-docker/)
|
||||||
|
|
||||||
1. [Announcement](#announcement)
|
1. [Announcements](#announcements)
|
||||||
2. [Includes](#includes)
|
2. [Includes](#includes)
|
||||||
3. [Issues & Contributing](#issues--contributing)
|
3. [Issues & Contributing](#issues--contributing)
|
||||||
4. [Requirements](#requirements)
|
4. [Requirements](#requirements)
|
||||||
|
@ -29,24 +29,19 @@ Why I created this image: [Simple Mail Server with Docker](http://tvi.al/simple-
|
||||||
6. [Examples](#examples)
|
6. [Examples](#examples)
|
||||||
7. [Environment Variables](#environment-variables)
|
7. [Environment Variables](#environment-variables)
|
||||||
|
|
||||||
## Announcement
|
## Announcements
|
||||||
|
|
||||||
At this point we have merged the next branch based on Debian Buster into master.
|
1. Debian Buster is now Docker base image
|
||||||
That means the docker image latest uses Buster. The change may break things!
|
- Filebeat was removed
|
||||||
|
- Dovecot was downgraded
|
||||||
The following possibly breaking changes are known:
|
2. ELK was removed
|
||||||
|
3. New contributing guidelines were added
|
||||||
- Filebeat is removed and should be handled by another container, see [Wiki](https://github.com/tomav/docker-mailserver/wiki/).
|
|
||||||
- Dovecot will be downgraded a little bit (same major version) so that we can use the official Debian version.
|
|
||||||
|
|
||||||
If you want to stick to the old version a while longer, either switch to stable or to a specific version.
|
|
||||||
If you run into problems, please raise issues and ask for help. Don't forget to provide details.
|
|
||||||
|
|
||||||
## Includes
|
## Includes
|
||||||
|
|
||||||
- [Postfix](http://www.postfix.org) with smtp or ldap auth
|
- [Postfix](http://www.postfix.org) with SMTP or LDAP auth
|
||||||
- [Dovecot](https://www.dovecot.org) for sasl, imap (and optional pop3) with ssl support, with ldap auth, sieve and [quotas](https://github.com/tomav/docker-mailserver/wiki/Configure-Accounts#mailbox-quota)
|
- [Dovecot](https://www.dovecot.org) for SASL, IMAP (and optional POP3) with ssl support, with ldap auth, sieve and [quotas](https://github.com/tomav/docker-mailserver/wiki/Configure-Accounts#mailbox-quota)
|
||||||
- saslauthd with ldap auth
|
- SASLauthd with LDAP auth
|
||||||
- [Amavis](https://www.amavis.org/)
|
- [Amavis](https://www.amavis.org/)
|
||||||
- [Spamassasin](http://spamassassin.apache.org/) supporting custom rules
|
- [Spamassasin](http://spamassassin.apache.org/) supporting custom rules
|
||||||
- [ClamAV](https://www.clamav.net/) with automatic updates
|
- [ClamAV](https://www.clamav.net/) with automatic updates
|
||||||
|
@ -112,21 +107,11 @@ curl -o env-mailserver https://raw.githubusercontent.com/tomav/docker-mailserver
|
||||||
|
|
||||||
**Note:** If you want to use a bare domain (host name equals domain name) see [FAQ](https://github.com/tomav/docker-mailserver/wiki/FAQ-and-Tips#can-i-use-nakedbare-domains-no-host-name).
|
**Note:** If you want to use a bare domain (host name equals domain name) see [FAQ](https://github.com/tomav/docker-mailserver/wiki/FAQ-and-Tips#can-i-use-nakedbare-domains-no-host-name).
|
||||||
|
|
||||||
### Start the Container
|
### Get up and running
|
||||||
|
|
||||||
``` BASH
|
``` BASH
|
||||||
docker-compose up -d mail
|
docker-compose up -d mail
|
||||||
```
|
|
||||||
|
|
||||||
### Create your mail accounts
|
|
||||||
|
|
||||||
``` BASH
|
|
||||||
./setup.sh email add <user@domain> [<password>]
|
./setup.sh email add <user@domain> [<password>]
|
||||||
```
|
|
||||||
|
|
||||||
### Generate DKIM keys
|
|
||||||
|
|
||||||
``` BASH
|
|
||||||
./setup.sh config dkim
|
./setup.sh config dkim
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -150,10 +135,6 @@ And don't forget to have a look at the remaining functions of the `setup.sh` scr
|
||||||
|
|
||||||
If you got any problems with SPF and/or forwarding mails, give [SRS](https://github.com/roehling/postsrsd/blob/master/README.md) a try. You enable SRS by setting `ENABLE_SRS=1`. See the variable description for further information.
|
If you got any problems with SPF and/or forwarding mails, give [SRS](https://github.com/roehling/postsrsd/blob/master/README.md) a try. You enable SRS by setting `ENABLE_SRS=1`. See the variable description for further information.
|
||||||
|
|
||||||
#### For informational purposes
|
|
||||||
|
|
||||||
`restart: always` ensures that the mail server container (and Filebeat/ELK containers when using the mail server together with ELK stack) is automatically restarted by Docker in cases like a Docker service or host restart or container exit.
|
|
||||||
|
|
||||||
#### Exposed ports
|
#### Exposed ports
|
||||||
|
|
||||||
| Protocol | Opt-in Encryption ¹ | Enforced Encryption | Purpose |
|
| Protocol | Opt-in Encryption ¹ | Enforced Encryption | Purpose |
|
||||||
|
|
Loading…
Reference in a new issue