Commit graph

49 commits

Author SHA1 Message Date
Bojan Čekrlić 1e80626550 Upd: Update documentation - fix typos, make it more explicit we use Debian as default 2024-02-25 09:24:13 +01:00
Bojan Čekrlić 83b9af5c9b Fix for #174: Try to refactor healthcheck 2024-01-09 10:59:04 +01:00
Bojan Čekrlić df9771b6e2 Fix for #172: Change order of parameters for netcat 2024-01-07 16:51:33 +01:00
Henry Thasler 9b2d54f15e improved healthcheck with proper command sequence 2024-01-06 11:59:50 +01:00
Kroese fef288268e Use Debian Slim as base image 2023-10-27 19:02:08 +02:00
Bojan Čekrlić 2d21a4f908 Upd: Add Debian building to the pipeline 2023-10-27 10:31:10 +02:00
Bojan Čekrlić b45c4ac11a Upd: Update SASL XOAuth2 to v0.24 2023-10-27 09:50:39 +02:00
Bojan Čekrlić 1be2c20b89 Fix Ubuntu build and upgrade to latest Ubuntu LTS release 2023-02-09 09:22:59 +01:00
vcazsdk 38d767c55d Remove duplicate var 2022-09-13 08:24:26 +02:00
vcazsdk 5776119ef3 Fix network error: disable postfix chroot 2022-09-13 08:24:26 +02:00
vcazsdk a142b4547f Update ubuntu and sasl_xoauth2 version 2022-09-13 08:24:26 +02:00
Bojan Čekrlić e145f8761e Fix: Fix build issue with Alpine and Caching 2022-06-16 12:36:30 +02:00
Bojan Čekrlić 42078d5017 Fix: Fix multiplatform build caching issues
So, alpine will download platform-specific cache files, meaning that
when another platform tries to use the cache, it will fail with
packages not being found.
2022-06-09 15:32:07 +02:00
Bojan Čekrlić 3385de7fca Upd: Fix integration tests with the latest refactor 2022-04-13 10:16:42 +02:00
Bojan Čekrlić a6d10e6a13 Upd: Refactor Dockerfile and cache local builds
This refactor simplifies the `Dockerfile` by considerable amount:
new features of mobykit buildkit allow us to cache `apt`/`apk`
folder (so no need to delete `/var/lib/cache`) as well as extract
the build / install logic into separate files, which removes the
need for `&& \` and makes the code *much more* readable.

`build.sh` script has been updated as well to allow caching local
builds when testing, making it much more easier to test.
2022-04-13 09:57:46 +02:00
Bojan Čekrlić 0310983060 Upd: Upgrade XOAUTH2 to 0.11
Hopefully this should reduce issues like #101.
2022-03-28 20:25:52 +02:00
Bojan Čekrlić 16b19d59e8 Upgrade Ubuntu Focal -> Impish
This allows us to build `arm/v7` which should hopefully fix #90.
2021-12-14 16:10:19 +01:00
Sergio Del Río Mayoral a1a2082ae1 Add email anonymizer option in case is needed for GDPR
This new feature will anonymize emails in the Postfix logs. This allows
you to keep them indefinetely while being compliant with GDPR.

Based on excellent work on [this pull request](https://github.com/bokysan/docker-postfix/pull/91).

Check `README.md` for more details.
2021-12-07 13:43:13 +01:00
Bojan Čekrlić a489b4c113 Move build of sasl-xoauth2 to the main file
Some users have reported issues with GCE and how sasl-xoauth2 was
built. Moving the building process back into the main part of the
`Dockerfile` should hopefully prevent similar issues.
2021-09-06 11:25:10 +02:00
Bojan Čekrlić 552d73c623 Fix. Fix typo 2021-05-30 13:34:52 +02:00
Bojan Čekrlić 15dab4cfbd Upd: Simplify GitHub actions. 2021-05-29 21:14:24 +02:00
Bojan Čekrlić 3b37f9164a Upd: Split steps in Dockerfile for more caching 2021-05-29 17:48:54 +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ć 1dbe9cb3ec Fix: A possible fix for #59 2021-02-24 15:54:23 +01:00
Bojan Čekrlić 54578c8e58 Remove dependency on cyrus-sasl-plain
It seems that this package was remove from the latest version of Alpine.
2021-02-07 22:52:45 +01:00
Bojan Čekrlić b85c1ea429 Update: Upgrade OAuth library to v0.10 2020-12-11 16:31:09 +01:00
Lukas Grossar a956398b37
Replace localhost with 127.0.0.1 for healthcheck (#50)
Additionally change the commands in the pod probes from a single string to a list of strings.
2020-12-11 16:17:47 +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ć ab725f5c40 Fix for #40: Add healthcheck to Dockerfile
`HEALTHCHECK` instruction has been added to `Dockerfile`. This should
allow `docker-compose` installations to monitor and restart the
container if neccessary.

Kubernetes deployment healthcheck has been tweaked a bit to better
validate that the server is actually running.
2020-11-03 11:58:10 +01: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ć 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
Matthew Critchlow 0feeccbfc3
Support alpine versions (#20)
* Support multiple alpine versions in Dockerfile

Add an ARG to the Dockerfile to support passing in build-args when
running docker build to support different alpine base image versions.

* Create push.sh script for managing image updates

The push.sh script supports passing multiple alpine tags which will then
be built, tagged, and pushed to docker hub
2020-01-31 21:01:29 +01:00
Andrés Álvarez 8fda5d9004 Decouple commons.sh from run.sh (#18)
Use case is being able to reuse the common methods when extending the image so that the behavior is consistent (e.g: same formatting for log messages) without needing to repeat the code while extending.
2019-10-20 18:34:27 +02:00
Andrés Álvarez 074125ffe1 Allow setting empty ALLOWED_SENDER_DOMAINS (#17)
This PR allows setting an empty `ALLOWED_SENDER_DOMAINS` variable. The default behaviour remains the same (empty `ALLOWED_SENDER_DOMAINS` will throw an error), but it is posible to override this behaviour via a new variable `ALLOW_EMPTY_SENDER_DOMAINS`.
2019-10-20 18:33:08 +02:00
Bojan Čekrlić f4448d6d9e Rename HEADER_CHECKS to SMTP_HEADER_CHECKS 2019-10-03 09:32:39 +02:00
malware-watch a9a09b0085 Added HEADER_CHECKS configuration option (#15)
* Added HEADER_CHECKS  configuration option
2019-10-03 09:01:53 +02:00
Bojan Čekrlić f971f1efd2 Fix for #12 where Alpine 3.9 split cyrus-sasl into multiple packages: https://bugs.alpinelinux.org/issues/9987 2019-05-13 13:28:55 +02:00
Matias 6cbb7d0837 Add packages needed to authenticate to gmail (#10)
* Add packages needed to correctly authenticate using a gmail relay
* Squishing 'apk add' lines
2019-02-25 14:28:16 +01:00
Bojan Čekrlić a1cffc6b23 More resillient builds
It turns out that builds cannot be predictable - different accounts
were assigned by different build systems. Consequentially we install
each tool separately.
2019-02-19 12:08:13 +01:00
Bojan Čekrlić 928e5d64c7 Initial support for DKIM and testing
This commit brings two important features:
- **DKIM support** It's now possible to configure this postfix
  image to sign messages using DKIM by simply generating the keys
  and providing them in the approprate folder. This should bring
  us one step closer to directly sending out emails without relying
  on a 3rd-party proxy.
- **test support** A nice and handy script, conviniently called
  `test.sh` has been provided, builds the image, spins it up and
  tries to send out an email. You'll need `docker-compose` to run
  it, though.
2019-02-19 10:49:55 +01:00
Bojan Čekrlić aa66569ac1 Major update, better support for handling TLS connections.
This update includes a few features that make it easier to work
with relay hosts. The configuration now uses built-in (Alpine) TLS
certificates and allows the user to specify how the Postfix should
establish a TLS connection. Configure it using `RELAYHOST_TLS_LEVEL`,
if needed.

Another configuration option was added, `MESSAGE_SIZE_LIMIT`, which
enables you to reject messages exceeding certain limits. Especially
useful with relay servers, to prevent messages getting stuck in
Postfix queue.

Use the `INBOUND_DEBUGGING` parameter to enable additional postfix
logs for incoming messages when things go south.

Use `TZ` parameter to set the timezone of the container (especially
useful for logs and dates in the messages).

*Notice that `ALLOWED_SENDER_DOMAINS` is now a neccessary parameter.*
Turns out that due to Postfix anti-spam configuration there's no way
to start it properly without specifying the domains it will relay
email for.

This commit also includes a few samples of running the container:
- standalone
- in [docker-compose](https://docs.docker.com/compose/)

Further work: add a working Kubernetes / Helm chart example.
2019-01-02 14:06:00 +01:00
Bojan Čekrlić 397c0ce838 Swiched from alpine:edge to alpine:latest. Fixed some typos. 2018-11-13 12:05:58 +01:00
Bojan Čekrlić 0638d349bd Minor edits for easier understanding.
The Dockerfile has been reformatted a bit to make it more clear and easy
to understand. README.md has been updated with the postfix's user
account details.
2018-07-27 16:42:35 +02:00
Bojan Čekrlić 2797040faa NEW FEATURE: A new feature has been added -- it's now posible to specify a RELAY
hosts's username and password, if your remote host requires
authentication.

NEW FEATURE: The possibility to execute third party scripts. This should
make extending this image easier.

REFACTORING: Dockerfile now starts with run.sh instead of suprevisor.
This makes it much easier to see any errors that might creep into the
code. Also note that the script now relies on POSIX-compliant commands
only so the executor has been changed from /bin/bash to /bin/sh.
2017-11-02 14:20:28 +01:00
Bojan Čekrlić 56e02ffd33 Fixed an issue with ALLOWED_SENDER_DOMAINS. Fixed an issue with pthread_setname_np: symbol not found. 2017-07-24 08:17:04 +02:00
Bojan Čekrlić f9f7935ae0 Fix for postfix; it now checks properly for allowed domains and sends off the email if the domain matches. 2016-04-22 14:16:12 +02:00
Bojan Čekrlić d2487b475b Postfix, initial release 2016-03-18 00:06:12 +01:00