Commit graph

24 commits

Author SHA1 Message Date
sdelrio 88c94f979a Fix for #69: Disable healthcheck logs 2021-11-08 09:45:48 +01:00
Bojan Čekrlić 3cb19e7c13 Fix for #84: Do not set storageClassName if not set in values.yml 2021-08-22 17:49:29 +02:00
Bojan Čekrlić 956caf3fa4 Upd #63: Gracefully scaledown Postfix
Make sure the queue is flushed when the Postfix container is
shutdown through Kubernetes lifecycle hooks.
2021-06-05 21:07:54 +02:00
msvechla 02b1caa6e5
add SASL_RELAYHOST to overwrite RELATHOST in sasl_passwd file on demand (#77) 2021-06-04 15:52:19 +02:00
Bojan Čekrlić a695d05a7b Fix: Depricate RELAYHOST_TLS_LEVEL with Postfix equivivalent 2021-05-31 09:01:53 +02:00
Bojan Čekrlić 13bdabe27e Fix: Fix deploymen of TLS certificates, script exec and Ubuntu build 2021-05-29 18:21:02 +02:00
Bojan Čekrlić 0c12027622 New: Add support for Ubuntu builds and TLS certs on Helm 2021-05-29 17:08:08 +02:00
Bojan Čekrlić c6e9a2e4a9 Upgrade: improvements to migrations 2021-05-18 22:51:57 +02:00
Bojan Čekrlić 77cee99643 Fix for #64 and many other improvements
E.g. if mounting `/docker-init.db/` from kubernetes config.
2021-05-18 22:42:44 +02:00
Bojan Čekrlić cf2b2be0d3 Remove references to hash: databases
With upgrade to Alpine 3.13, support for `hash:` and `btree:` has
beenremoved from Alpine.

As such `hash:<file>` references do not work any more.

[Alpine](https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0)
explains it like this:

> Oracle has changed the license of BDB to AGPL-3.0, making it unsuitable
> to link to packages with GPL-incompatible licenses. Since the old version
> is no longer maintained, the db package is now deprecated. Alpine Linux
> packages are being transitioned to alternatives or, where no alternatives
> exist, removed entirely.

This, unfortunately, will mean that the new version of `docker-postfix`
might not be backwards-compatible, if you're using your own postfix
configuration. Sorry. :-(
2021-02-07 23:07:39 +01:00
Lukas Grossar cc6c8e4673
Fix readability check for OpenDKIM keys (#49) 2020-12-11 16:22:22 +01:00
Ivan Martinez-Ortiz 16771d45eb
Add XOAuth2 support for GMail (#42)
* Add XOAuth2 support for GMail

* Attempt to support integration tests
2020-11-06 10:52:17 +01:00
Bojan Čekrlić 51173d36e0 Fix for #38
The postfix configuration was a bit too permissive with `mynetworks`.

This commit:
- adds `reject` at the end of `*restrictions` list
- adds tests for this feature
2020-10-24 21:24:18 +02:00
Bojan Čekrlić bd67c9547c Additional fixes for #39 and #37 2020-10-24 21:24:18 +02:00
Bojan Čekrlić 5f441fb7a2 Fix for #39 - Make sure private keys are readable by OpenDKIM
Private keys generated with `DKIM_AUTOGENERATE` were created with
the root account and as such were not readable by OpenDKIM.

This fix will reown the created files to the `opendkim` user.
2020-10-24 21:24:18 +02:00
Bojan Čekrlić 9a33ade483 Fix for #37
While quite annoying behavour, this is the how `postconf` works.
If you tell it to comment out a command, it will add it to the config
even when the same command exists commented out in the config file.

This commit does a bit of sed and grep magic to find if the comment
already exists and if yes, then it does nothing.
2020-10-24 21:24:18 +02:00
Bojan Čekrlić 5aca4e36dc Normalize whitespace
Make sure that all whitespaces are the same -- spaces have been
converted to tabs.
2020-10-24 21:24:18 +02:00
Antoine GC 2b577f3522
Update common-run.sh (#31)
To fix an issue when multiple domains in ALLOWED_SENDER_DOMAINS, DKIM signature only works for one domain
2020-08-20 08:20:41 +02:00
Bojan Čekrlić 3f6d1330bb Simplify configuration
Postfix has an option to run in foreground. Use this feature to
reduce the complexity of supervisord.conf.
2020-08-15 23:52:22 +02:00
Bojan Čekrlić 35fa2d7acf Fix for #30 - Use sleep inifinity instead of sleep <number>
Apparently using sleep with very large numbers is not a good idea
when your image can be compiled down to 32-bit platforms.

This fix uses `sleep infinity` and -- failing that -- tries to
sleep for about 68 years (which is exactly 2^15 seconds).
2020-08-15 22:47:49 +02:00
Bojan Čekrlić cfd1a13676 Deprecate some common properties and add auto-generation of DKIM keys 2020-07-03 07:08:27 +02:00
Bojan Čekrlić c460941b90 Fix for #24 + some new integration tests 2020-07-01 14:12:04 +02:00
Bojan Čekrlić ff2d080279 Add the option to log to rsyslog as plain or JSON and restructure tests
- It's now possible to choose the logging type - either 'plain' or
  'json'
- The code is ready to support multiple integration tests (with
  different configurations)
- `OPENDKIM_` and `POSTFIX_` variables are handled properly and recorded
  in the corresponding files. (This had a downfall that `bash` now needs
  to be installed, so we can probably simplify some of the shell
  scripts.)
2020-07-01 13:50:08 +02:00
Bojan Čekrlić 9b1902c047 Larger refactoring of the codebase + DKIM_SELECTOR
Summary
^^^^^^^

This commit refactors the code base to be more manageble and
prepares the groundwork for tests.

Refactoring
^^^^^^^^^^^

Files are now moved to subdirectories, all for the sole purpose of
easier management. Tests live in their own folders, as well as configs
and other files.

Test framework
^^^^^^^^^^^^^^

Two new important scripts/directories are available:
- `unit-tests.sh` / `/unit-test` which executes unit tests across shell
  scripts, and
- `integration-test.sh` / `integration-tests`, which spins up the
  container and tries to send the email.

Both tests use the [BATS](https://github.com/sstephenson/bats) framework
for testing. To create a new test, simply drop a `.bats` file into a
corresponding directory.

Functions have been extracted into `common-run.sh`, to be able to test
them independently.

DKIM_SELECTOR
^^^^^^^^^^^^^

It is now possible to specify a DKIM selector to use (instead of
the default "mail"). See `README.md` for more details.

JSON logging
^^^^^^^^^^^^

WIP: rsyslog will now output JSON logs. This is especially important
if you plan on deploying the image into Kubernetes, as [Prometheus](https://prometheus.io/)
can handle logs in JSON much easier.

TODO: Make this an optional feature, to not confuse existing users.
2020-06-29 19:03:24 +02:00