Commit graph

57 commits

Author SHA1 Message Date
Bojan Čekrlić 95119aa607 Fix #169: Explicitly state different UIDs/GIDs across distros
This is a simple documentation update to notify users that UIDs/GIDs may
(and in fact are) different across distros.

The documentation now reflects the last known state od UIDs/GIDs.
Startup now announces specific UIDs/GIDs used to make sure people are
aware of any future changes.
2024-04-23 07:03:03 +01:00
Bojan Čekrlić 4b46b1d173 Fix #180: Rename authentication methods
This is a really dirt fix for issue #180. It will replace "well-known"
enumerated plugin names with SASL mechanism names. While this is more of
a "bandage" than the actual proper fix, I have currently found no better
ways to do it.

Most likely this issue will rise up again with another SASL plugin and
we will deal with it then. At this stage, it should cover most of the
use cases transparently.
2024-04-21 16:38:54 +01:00
Bojan Čekrlić b358d71454 Fix for #192: Automatically add domains to provided usernames for SASL
So, according to the documentation, usernames must always include a
domain for SASL.

In other words. User cannot be `johhny` but `johhny@example.org`.
Further info can be found on this ticket: https://github.com/bokysan/docker-postfix/issues/192

This commit will automatically append domain if one is not provided in
`SMTPD_SASL_USERS`.
2024-04-16 22:11:34 +02:00
Bojan Čekrlić 025cb58d0e Upt: Add postfix-pcre, add additional checks for sanity and mount /tmp to emptydir 2024-02-25 09:12:28 +01:00
Sébastien De Marchi bf84322ca6 Fix sasldb with SMTPD_SASL_USERS env variable
We encountered an issue where the script common-run.sh would fail if the SMTPD_SASL_USERS environment variable was defined. The failure occurred immediately after displaying the "Enable smtpd sasl auth" message, preventing the container from starting correctly.

The root cause was traced to a conditional check for the existence of the /etc/sasl2/sasldb2 file. When the file did not exist, the subsequent `chown` operation was skipped as intended, but the script would still fail due to an undefined behavior in the shell context.

The addition of a debug message "Sasldb configured" before the closing `fi` statement has resolved the issue. This change appears to stabilize the script execution, allowing the container to start as expected.

While the underlying cause is not fully understood and warrants further investigation, this commit serves as a temporary workaround to ensure functionality in environments where SMTPD_SASL_USERS is set.
2024-01-19 10:36:33 +01:00
Bojan Čekrlić a1b30f31f9 Fix for #174: Incrase healthcheck timeout
Default timeout for healthcheck by kubernetes is too low. As we wait up
for 2 seconds for the Postfix and DKIM to respond, this exceeds the
threshold and the healthcheck fails with:

```
Readiness probe failed: command "sh -c /scripts/healthcheck.sh" timed out
```

By simply increasing `timeoutSeconds` this issue is resolved.
2024-01-09 17:00:04 +01:00
Bojan Čekrlić 83b9af5c9b Fix for #174: Try to refactor healthcheck 2024-01-09 10:59:04 +01:00
Bojan Čekrlić 1c71da7adc Upd: Explicitly link timezone to folder 2023-12-29 15:20:50 +01:00
Bojan Čekrlić cccbf7ea65 Fix for #151 2023-11-01 14:33:44 +01:00
Bojan Čekrlić 743d3a0a86 Fix for #147: Update daemon_directory based on running distribution
This image will now automatically reconfigure `daemon_directory` in case
of distrubution switching.

Alpine and Debian/Ubuntu will use different directly layout and if the
user persists `/etc/postfix`, this image will not start if the
distribution changes.
2023-10-29 23:42:37 +01:00
Bojan Čekrlić 1d74829eaa Fix: Try fixing the #147 issue and conver it by unit tests 2023-10-29 16:24:22 +01:00
Bojan Čekrlić 25e919644f Fix for #147
This will change the `deamon_directory` if it detects a distribution
change. Some distributions will by default set the `deamon_directory` in
`main.cf` and they differentiate between distributions. Hence, updating
to another distribution causes Postfix to fail starting.
2023-10-29 09:09:51 +01:00
Bojan Čekrlić e8c6cd5332 Fix: Make sure to use the proper name for pluginviewer based on distro
Debian/Ubuntu use 'saslpluginviewer`, so we should check for that.
2023-10-27 18:04:36 +02:00
Bojan Čekrlić 5a09ee5a45 Fix: Fix a typo -> 'reowing' to 'reowning' 2023-10-27 13:48:46 +02:00
Bojan Čekrlić b90b336d04 Fix: Remove unneccessary dependendancy on external logrotate image
We now include logrotate in the the basic image. This does -- up to a
point -- reduce the "separation of concerns", but it simplifies image
management considerably and removes an unneccessary dependency on a
third-party container.
2023-10-27 09:38:54 +02:00
Bojan Čekrlić 6da38c0d4e Fix: Big logorotate ourselves for different platforms 2023-10-27 08:51:19 +02:00
Jonathon Beauregard II ab1cca7286 Feat: Create metrics service 2023-09-27 22:55:28 +02:00
Dmitry Sakun 8b6a6acfae fix: do not duplicate sasl configuration entries on restart
Fixing the issue when container will not restart due to sasl config file error
2023-09-27 18:34:28 +02:00
FlorianKronos 9235ee0dc1 Upd: Fix OAuth token support for Microsoft 365
This is a smaller fix to enable proper working of the image with
Microsoft 365.
2023-09-27 17:01:06 +02:00
Bojan Čekrlić b505a8e8ba Update: make sure that output of copying files for chroot is properly alinged 2023-02-09 10:39:51 +01:00
Bojan Čekrlić e0e5942fad Fox for #102: Setup proper configuration for chrooting Postfix 2023-02-09 09:55:44 +01:00
vcazsdk fc7ed0b391 Fix bad sasldb2 path with alpine image 2022-09-13 08:24:26 +02:00
vcazsdk f2daefd7e1 Add smtpd sender sasl authentication 2022-09-13 08:24:26 +02:00
Bojan Čekrlić 06db8fb392 Fix for #106: Removed xouath2 from authentication methods if not used 2022-06-16 10:46:26 +02:00
Bojan Čekrlić c7c56d3ff1 Upd: Add new integration and unit tests
Test a few more functionalities in the image. Change how postfix
message IDs are detected. Message ID can be set by the client and
hence detecting them via regex is not the best way to go around it.

This fix will actually look at the log line and try to determine
if we're looking at the message ID or not.
2022-04-10 17:52:12 +02:00
Antoine GC 3fb5844bb3 Update email-anonymizer.py
fix regex to avoid '>' at the end of email
set default prefix & suffix to '' have a clean email in logs
update hmac hashing to use the same function as others programming languages
fix typos
2022-04-10 17:33:19 +02:00
Bojan Čekrlić 2717970c72 Fix: Fix issues found after integration tests 2022-03-28 20:15:20 +02:00
Bojan Čekrlić 2593172f87 Fix #97: Allow skipping reown and don't die on reown failure 2022-03-28 20:10:44 +02:00
Bojan Čekrlić 3d750cfb6a Fix #95: Make grep quiet
Grep was missing the quiet (`-q`) option which made it echo the
password to postfix logs.
2022-03-28 19:51:47 +02:00
Bojan Čekrlić 156b45d9f7 Fix #104: Inproper usage of sed
A small error where sed was called wrongly ('s/.../d') instead of
'/.../d' was causing an error `sed: unmatched '/' on configuration
change`.

This commit should fix the issue.
2022-03-28 19:49:31 +02:00
Bojan Čekrlić f5d0e56b1b New: Add smart email anonymizer
This email anonymizer tries to be a bit more smart about how it goes
about anonymizing email addresses, by providing as much as possible
information while still making sure to respect user's privacy.

More info available in `README.md`.
2022-03-28 19:42:56 +02:00
Bojan Čekrlić b4c0f2650e Upd: Fix typos and add hashing email obfuscation 2022-01-08 15:52:58 +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
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