Skip to content

Commit

Permalink
Merge branch 'add-i386-ghcr' into 'master'
Browse files Browse the repository at this point in the history
Adds support for i386 and ghcr.io

See merge request ix.ai/smtp!14
  • Loading branch information
tlex committed Aug 28, 2022
2 parents 9056acd + f0b07eb commit 564c563
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
variables:
DOCKERHUB_REPO_NAME: smtp
GITHUB_REPO_NAME: ix-ai/smtp
ENABLE_ARM64: 'true'
ENABLE_ARMv7: 'true'
ENABLE_ARMv6: 'true'
ENABLE_i386: 'true'
ENABLE_386: 'true'

include:
- project: 'ix.ai/ci-templates'
Expand Down
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,34 @@ The container accepts `OTHER_HOSTNAMES` environment variable which will set the
## Below are scenarios for using this container

### As SMTP Server

You don't need to specify any environment variable to get this up.

### As a Secondary SMTP Server

Specify 'RELAY_DOMAINS' to setup what domains should be accepted to forward to lower distance MX server.

Format is `<domain1> : <domain2> : <domain3> etc`

### As Gmail Relay

You need to set the `GMAIL_USER` and `GMAIL_PASSWORD` to be able to use it.

### As Amazon SES Relay
You need to set the `SES_USER` and `SES_PASSWORD` to be able to use it.<br/>

You need to set the `SES_USER` and `SES_PASSWORD` to be able to use it.

You can override the SES region by setting `SES_REGION` as well.
If you use Google Compute Engine you also should set `SES_PORT` to 2587.

### As generic SMTP Relay

You can also use any generic SMTP server with authentication as smarthost.</br>
You need to set `SMARTHOST_ADDRESS`, `SMARTHOST_PORT` (connection parameters), `SMARTHOST_USER`, `SMARTHOST_PASSWORD` (authentication parameters), and `SMARTHOST_ALIASES`: this is a list of aliases to puth auth data for authentication, semicolon separated.</br>

Example 1:
```

```txt
SMARTHOST_ADDRESS=mail.mysmtp.com
SMARTHOST_PORT=587
SMARTHOST_USER=myuser
Expand All @@ -56,7 +63,7 @@ SMARTHOST_ALIASES=*.mysmtp.com

Example 2 using docker-compose.yml:

```
```yml
version: '3'

services:
Expand All @@ -76,31 +83,33 @@ services:
## Tags and Arch
Starting with version v0.0.1, the images are multi-arch, with builds for amd64, arm64 and armv7.
Starting with version v0.0.1, the images are multi-arch, with builds for amd64, arm64 and armv7. Starting with v0.1.3 support for i386 was added.
* `vN.N.N` - for example v0.0.1
* `latest` - always pointing to the latest version
* `dev-master` - the last build on the master branch

## Resources:
* GitLab: https://gitlab.com/ix.ai/smtp
* GitHub: https://github.com/ix-ai/smtp
* GitLab Registry: https://gitlab.com/ix.ai/smtp/container_registry
* Docker Hub: https://hub.docker.com/r/ixdotai/smtp
## Resources

* Gitlab Registry: `registry.gitlab.com/ix.ai/smtp` - [gitlab.com/ix.ai/smtp](https://gitlab.com/ix.ai/smtp)
* GitHub Registry: `ghcr.io/ix-ai/smtp` [github.com/ix-ai/smtp](https://github.com/ix-ai/smtp)
* Docker Hub: `ixdotai/smtp` - [hub.docker.com/r/ixdotai/smtp](https://hub.docker.com/r/ixdotai/smtp)

## Troubleshooting:
## Troubleshooting

Check the container logs to see exim output.

### Certificate Verification Error in Exim 4.93 and 4.94

Additional checking added in Exim 4.93 can cause certificate verification to fail with this error message:

```
```txt
TLS session: (certificate verification failed): certificate invalid: delivering unencrypted to H=smtp.sendgrid.net [167.89.115.117] (not in hosts_require_tls)
```

Exim then tries to deliver unencrypted but this may fail because authentication may only be possible on TLS connections:

```
```txt
smtp | 293 SMTP<< 550 Unauthenticated senders not allowed
smtp | 293 SMTP<< 503 Must have sender before recipient
smtp | 293 SMTP<< 503 Must have valid receiver and originator
Expand All @@ -112,24 +121,27 @@ Exim then tries to deliver unencrypted but this may fail because authentication
smtp | 292 Frozen (delivery error message)
```

This issue will hopefully be resolved in Exim 4.95 (see https://bugs.exim.org/show_bug.cgi?id=2594), but at the time of writing (Sept 2021) the debian stable bas image we use has Exim 4.94. One possible workaround in the meantime is to disable TLS verification when sending to your smarthost.
This issue will hopefully be resolved in Exim 4.95 (see [bugs.exim.org/show_bug.cgi?id=2594](https://bugs.exim.org/show_bug.cgi?id=2594)), but at the time of writing (Sept 2021) the debian stable bas image we use has Exim 4.94. One possible workaround in the meantime is to disable TLS verification when sending to your smarthost.

Put this into a config file `exim4_additional_macros`:
```

```sh
# disable TLS verification as a workaround
REMOTE_SMTP_SMARTHOST_TLS_VERIFY_HOSTS = :
```
and bind-mount this file to `/etc/exim4/_docker_additional_macros`.

and bind-mount this file to `/etc/exim4/_docker_additional_macros`.

## Credits

# Credits
Special thanks to [namshi/docker-smtp](https://github.com/namshi/docker-smtp).

## Differences from namshi/docker-smtp
### Differences from namshi/docker-smtp

In terms of configuration, this image works the same as namshi/docker-smtp.

The main differences are:
* this image is based on `debian:stable` (vs. `debian:buster` used by namshi) so it has a newer version of Exim with the latest security updates. The newer version may result in some differences vs. namshi.
* this image in addition to AMD64, is built for ARM64, ARMv7, ARMv6 and i386.
* cosmetic changes in `entrypoint.sh` to make [shellcheck](https://github.com/koalaman/shellcheck/) happy

* this image is based on `debian:stable` (vs. `debian:buster` used by namshi) so it has a newer version of Exim with the latest security updates. The newer version may result in some differences vs. namshi.
* this image in addition to AMD64, is built for ARM64, ARMv7, ARMv6 and i386.
* cosmetic changes in `entrypoint.sh` to make [shellcheck](https://github.com/koalaman/shellcheck/) happy

0 comments on commit 564c563

Please sign in to comment.