huan / docker-simple-mail-forwarder

Simplest and Smallest Email Forward Service based on Docker.
https://hub.docker.com/r/zixia/simple-mail-forwarder/
Apache License 2.0
544 stars 88 forks source link

Exec format error on arm64 and arm/v7 #106

Open Sylvan86 opened 3 years ago

Sylvan86 commented 3 years ago

I start the container with the following docker-compose.yml:

version: "3"

services:
  mailforward:
    image: zixia/simple-mail-forwarder
    container_name: mailforward
    environment:
      - SMF_CONFIG=joe@yyy.net:joe.yyy@gmail.com
      - SMF_DOMAIN=yyy.net
      - TZ=Europe/Berlin
#    volumes:
#      - ./certs:/etc/postfix/cert/
    ports:
      - "25:25"
    restart: unless-stopped

This leads to the following startup log:

>> Chdir to /app...
 ____  _                 _         __  __       _ _
/ ___|(_)_ __ ___  _ __ | | ___   |  \/  | __ _(_) |
\___ \| | '_ ` _ \| '_ \| |/ _ \  | |\/| |/ _` | | |
 ___) | | | | | | | |_) | |  __/  | |  | | (_| | | |
|____/|_|_| |_| |_| .__/|_|\___|  |_|  |_|\__,_|_|_|
                  |_|
  _____                                _
 |  ___|__  _ ____      ____ _ _ __ __| | ___ _ __
 | |_ / _ \| '__\ \ /\ / / _` | '__/ _` |/ _ \ '__|
 |  _| (_) | |   \ V  V / (_| | | | (_| |  __/ |
 |_|  \___/|_|    \_/\_/ \__,_|_|  \__,_|\___|_|

v1.4.6
Source#c3b5b30 Tue Jul  6 06:54:15 2021 +0000 * master
Built on Tue Jul  6 06:54:37 UTC 2021 by buildkitsandbox

>> END SMF_DOMAIN found. value:[yyy.net]
>> ENV SMF_CONFIG found. value:[joe@yyy.net:joe.yyy@gmail.com]
>> ARGV arguments found. value:[start]
Generating a RSA private key
............+++++
......+++++
writing new private key to 'smtp.key'
-----
Generating an EC private key
writing new private key to 'smtp.ec.key'
-----
/entrypoint.sh: line 47: [: =: unary operator expected
>> SMF_CONFIG found in ENV. use this settings for forward maps.
>> Setting password[dx1h0cq6] for user joe@yyy.net ...
>> Set hostname to yyy.net
Postfix logging configuration
Postfix will use the default logging configuration: /dev/stdout
OpenDKIM: Keys for yyy.net not found, generating...
opendkim-genkey: generating private key
opendkim-genkey: private key written to default.private
opendkim-genkey: extracting public key
opendkim-genkey: DNS TXT record written to default.txt
Inserting yyy.net data to /etc/opendkim/{KeyTable, SigningTable, TrustedHosts}
OpenDKIM: this TXT record for yyy.net should be present:
default._domainkey        IN      TXT     ( "v=DKIM1; k=rsa; "
    "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6TtNNXK4m8gFiQdpw52GzA0OViDfkxi/qI4f+T5sheT4CmYZb7jZRm03TQV6RhebuILcBJz5IZwF7eduIWAgDVHfpvaLdbAlwh4bVvzokzF3U7+MHKI213RSwffWzSaToJoQWEGMS2NlGk2O0dUJeC6540nDMEUjrxsafsY6TXTM7SlODhawtMclv1IJW8KDxkBZeu7yWr3uv6"
    "VUAgj/TukQ3kVRMzBnm2Fh6/0ojqOTeCx0XBN45/bG6wTz1mg7gc9Nuuj+HiNzdBWRHg19owPFGeUze7odZG1KpoIbVVv+GSIRQEXz+UKUeEqlYQiRNtZiCBy+2EUtkfFmFzKZOQIDAQAB" )  ; ----- DKIM key default for yyy.net
Configuring DKIM key settings in /etc/opendkim/opendkim.conf
Postfix main.cf custom entries from SMF_POSTFIXMAIN_
Postfix master.cf custom entries from SMF_POSTFIXMASTER_
Editing /etc/postfix/master.cf, adding missing entry for postlog unix-domain datagram service
>> Start self-testing...
1..24
ok 1 SMF_CONFIG exist
ok 2 SMF_DOMAIN exist
ok 3 virtual maping source is set
ok 4 virtual maping data is set
ok 5 virtual maping db is set
ok 6 system hostname FQDN resolvable
ok 7 postfix myhostname FQDN & resolvable
ok 8 check other hostname setting
ok 9 confirm postfix is running
ok 10 confirm port 25 is open
ok 11 crond is running # skip skip this for 0.3.0 -> 0.4.0
ok 12 ESMTP STATTLS supported
ok 13 ESMTP AUTH supported
ok 14 ESMTP STARTTLS connect ok
ok 15 create user testi@testo.com by password test
ok 16 ESMTP AUTH by testi@testo.com/test
ok 17 ESMTP TLS AUTH by testi@testo.com/test
ok 18 deleting test user testi@testo.com
not ok 19 test DKIM keys
# (in test file test/simple-mail-forwarder.bats, line 182)
#   `opendkim-testkey -d ${domain:13:-1} -s default -vvv' failed with status 69
# Validating DKIM for yyy.net
# opendkim-testkey: using default configfile /etc/opendkim/opendkim.conf
# opendkim-testkey: checking key 'default._domainkey.yyy.net'
# opendkim-testkey: 'default._domainkey.yyy.net' record not found
ok 20 test custom main.cf entries
ok 21 test custom master.cf entries
ok 22 test default postfix logging configuration
ok 23 test custom postfix logging configuration with an error
ok 24 test custom postfix logging configuration
>> Test FAILED!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> !!!!!!!!!!!!!!!!!!!! SYSTEM ERROR !!!!!!!!!!!!!!!!!!!!
>> But I'll pretend to run... good luck! :P

>> CONGRATULATIONS! System is UP and You are SET!
>> Powered by SMF - a Simple Mail Forwarder
>> View in DockerHub: https://hub.docker.com/r/zixia/simple-mail-forwarder

>> Init System for Servicing...
/init: line 11: /bin/importas: cannot execute binary file: Exec format error
/init: line 12: export: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin': not a valid identifier
/etc/s6/init/init-stage1: line 26: syntax error near unexpected token `}'
/etc/s6/init/init-stage1: line 26: `}'

It seems to be related to >>this<< issue but i tried this on two independent rasperry pis - one with arch linux 32 bit and one with arch linux 64 bit. On both the error occurs.

gothchibjo commented 2 years ago

v. 1.4.7. Same problem. Bump up...

limitium commented 2 years ago

+bump

doryashar commented 1 year ago

I'm still facing this issue with aarch64

thomaswitt commented 1 year ago

Same here. Doesn't run unfortunately on a Raspberry Pi 4

pd-giz-dave commented 1 year ago

I had the same problem and discovered three issues:

  1. the install-s6-overlays.sh script always loads the amd version (its not using the $URL variable built in the previous line)
  2. the -C option on the tar line is set to '\' (line continuation) and should be '/'
  3. version 2 of s6 only provides a binary for 'arm'

Correcting the script and always loading the 'arm' architetcure for all arm variants worked for me.

Modified script below:

!/usr/bin/env bash

set -eo pipefail

if [[ -n "$1" ]]; then S6_VERSION=$1; shift else echo "arg 1 should be the s6 version" exit 1 fi

case $(uname -m) in armv6l) ;& # fall through armv7l) ARCH=arm
;; armv8l) ARCH=arm ;; aarch64) ARCH=arm
;; i386) ARCH=x86 ;; x86_64) ARCH=amd64 ;; *) echo "ARCH not supported: $ARCH" exit 1 ;; esac

URL="https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-${ARCH}.tar.gz" curl -L -s "$URL" | tar xpzf - -C /

dabeeeenster commented 4 months ago

I'm still getting this error - is anyone interested in forking this project if its not being fixed here?

xriser commented 4 weeks ago

https://github.com/huan/docker-simple-mail-forwarder/pull/131