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

Emails will not forward to destination #116

Closed jbcbdse closed 1 year ago

jbcbdse commented 2 years ago

I have a pretty simple setup here, and I'm just really stuck trying to figure out what to do.

My docker-compose file:

version: '3.8'
services:
  smf:
    container_name: mail-forwarder
    image: zixia/simple-mail-forwarder:1.4
    restart: always
    ports:
      - "25:25"
    environment:
      - SMF_CONFIG=bob@mynamemail.net:boblmyname@outlook.com
    volumes:
      - /opt/smf/dkim:/var/db/dkim
      - /etc/letsencrypt/live/mynamemail.net/fullchain.pem:/etc/postfix/cert/smtp.ec.cert
      - /etc/letsencrypt/live/mynamemail.net/privkey.pem:/etc/postfix/cert/smtp.ec.key

The output on startup:

mail-forwarder  | v1.4.7
mail-forwarder  | Source#c2fe07d Wed Oct 13 12:11:40 2021 +0000 * master
mail-forwarder  | Built on Wed Oct 13 12:11:55 UTC 2021 by buildkitsandbox
mail-forwarder  |
mail-forwarder  | >> ENV SMF_DOMAIN not set.
mail-forwarder  | >> ENV SMF_CONFIG found. value:[bob@mynamemail.net:boblmyname@outlook.com]
mail-forwarder  | >> ARGV arguments found. value:[start]
mail-forwarder  | >> SMF_CONFIG found in ENV. use this settings for forward maps.
mail-forwarder  | >> Setting password[ag6ekeuw] for user bob@mynamemail.net ...
mail-forwarder  | >> Set hostname to mynamemail.net
mail-forwarder  | Postfix logging configuration
mail-forwarder  | Postfix will use the default logging configuration: /dev/stdout
mail-forwarder  | Inserting mynamemail.net data to /etc/opendkim/{KeyTable, SigningTable, TrustedHosts}
mail-forwarder  | OpenDKIM: this TXT record for mynamemail.net should be present:
mail-forwarder  | default._domainkey    IN      TXT     ( "v=DKIM1; k=rsa; "
mail-forwarder  |         "p=MIIBIjAabcdehkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr2kLenlhlkkS1g/YsnE+zhJ/MqnmpkbzNGBaey3zIf3Bw2QOGbGNYqy1p6T56tHKf2Ein1LwJwNxL5uUjdMMbD9FzXXuPR6n5ZPoE0kNNmTtg45njRq7kTVpAgdoa8r8WpCa4ssZR5bp82L0nsdD7hSo75OK+5TZlhix5s6Y0qe/4pw3J4I/T/7fkhL3GpZCxhYNAY/XtT06iR"
mail-forwarder  |         "tL/96E6q8V0h8abcdeUPyGhtaA1JaP6pkWBDd1q2jzP7/MixOOW14SDmEQPrRR4GjxxIKPZmdFoppDDNDizRFx9/D7NRKwBiKaqsO4jG9oy0c+AFiH8KSn4BjtZwmHEJhFnTvV5wIDAQAB" )  ; ----- DKIM key default for mynamemail.net
mail-forwarder  | Configuring DKIM key settings in /etc/opendkim/opendkim.conf
mail-forwarder  | Postfix main.cf custom entries from SMF_POSTFIXMAIN_
mail-forwarder  | Postfix master.cf custom entries from SMF_POSTFIXMASTER_
mail-forwarder  | >> Start self-testing...
mail-forwarder  | 1..24
mail-forwarder  | ok 1 SMF_CONFIG exist
mail-forwarder  | ok 2 SMF_DOMAIN exist
mail-forwarder  | ok 3 virtual maping source is set
mail-forwarder  | ok 4 virtual maping data is set
mail-forwarder  | ok 5 virtual maping db is set
mail-forwarder  | ok 6 system hostname FQDN resolvable
mail-forwarder  | ok 7 postfix myhostname FQDN & resolvable
mail-forwarder  | ok 8 check other hostname setting
mail-forwarder  | ok 9 confirm postfix is running
mail-forwarder  | ok 10 confirm port 25 is open
mail-forwarder  | ok 11 crond is running # skip skip this for 0.3.0 -> 0.4.0
mail-forwarder  | ok 12 ESMTP STATTLS supported
mail-forwarder  | ok 13 ESMTP AUTH supported
mail-forwarder  | ok 14 ESMTP STARTTLS connect ok
mail-forwarder  | ok 15 create user testi@testo.com by password test
mail-forwarder  | ok 16 ESMTP AUTH by testi@testo.com/test
mail-forwarder  | ok 17 ESMTP TLS AUTH by testi@testo.com/test
mail-forwarder  | ok 18 deleting test user testi@testo.com
mail-forwarder  | ok 19 test DKIM keys
mail-forwarder  | ok 20 test custom main.cf entries
mail-forwarder  | ok 21 test custom master.cf entries
mail-forwarder  | ok 22 test default postfix logging configuration
mail-forwarder  | ok 23 test custom postfix logging configuration with an error
mail-forwarder  | ok 24 test custom postfix logging configuration
mail-forwarder  | >> Test PASSED
mail-forwarder  |
mail-forwarder  |
mail-forwarder  | >> CONGRATULATIONS! System is UP and You are SET!
mail-forwarder  | >> Powered by SMF - a Simple Mail Forwarder
mail-forwarder  | >> View in DockerHub: https://hub.docker.com/r/zixia/simple-mail-forwarder
mail-forwarder  |
mail-forwarder  |
mail-forwarder  | >> Init System for Servicing...
mail-forwarder  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
mail-forwarder  | [s6-init] ensuring user provided files have correct perms...exited 0.
mail-forwarder  | [fix-attrs.d] applying ownership & permissions fixes...
mail-forwarder  | [fix-attrs.d] done.
mail-forwarder  | [cont-init.d] executing container initialization scripts...
mail-forwarder  | [cont-init.d] done.
mail-forwarder  | [services.d] starting services
mail-forwarder  | [2022-09-10T18:37:19.019250] WARNING: Configuration file format is too old, syslog-ng is running in compatibility mode. Please update it to use the syslog-ng 3.27 format at your time of convenience. To upgrade the configuration, please review the warnings about incompatible changes printed by syslog-ng, and once completed change the @version header at the top of the configuration file; config-version='3.9'
mail-forwarder  | Sep 10 18:37:19 6399c76cc1a3 syslog-ng[939]: syslog-ng starting up; version='3.27.1'
mail-forwarder  | Sep 10 18:37:19 6399c76cc1a3 syslog-ng[939]: WARNING: log-fifo-size() works differently starting with syslog-ng 3.22 to avoid dropping flow-controlled messages when log-fifo-size() is misconfigured. From now on, log-fifo-size() only affects messages that are not flow-controlled. (Flow-controlled log paths have the flags(flow-control) option set.) To enable the new behaviour, update the @version string in your configuration and consider lowering the value of log-fifo-size().;
mail-forwarder  | [services.d] done.

I'm trying to use Gmail to send mail to my custom domain that forwards to either outlook.com or yahoo.com (I have tried both)

I see this in my postfix logs:

Sep 10 18:40:09 mynamemail postfix/smtpd[1047]: connect from mail-lj1-f172.google.com[209.85.208.172]
Sep 10 18:40:10 mynamemail postfix/smtpd[1047]: 1F93FA776D5: client=mail-lj1-f172.google.com[209.85.208.172]
Sep 10 18:40:10 mynamemail postfix/cleanup[1054]: 1F93FA776D5: message-id=<CAPH=1FgB1w12RmF5eDmAU2uLY5c34oqQqomoFTVBkQ8=svUS7w@mail.gmail.com>
Sep 10 18:40:10 mynamemail postfix/qmgr[1038]: 1F93FA776D5: from=<bobmyname@gmail.com>, size=2846, nrcpt=1 (queue active)
Sep 10 18:40:40 mynamemail postfix/smtp[1057]: connect to outlook-com.olc.protection.outlook.com[104.47.4.33]:25: Operation timed out
Sep 10 18:40:43 mynamemail postfix/smtpd[1047]: disconnect from mail-lj1-f172.google.com[209.85.208.172] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7

I see the same "Operation timed out" error for both outlook and yahoo. Any idea what I'm doing wrong?

jbcbdse commented 2 years ago

I'm running on an EC2 instance. I've check ingress and egress. I can shell into the container and "curl google.com" and such, verifying that I have egress. Everything appears to work on https://www.checktls.com/

It just can't forward out to outlook or yahoo

wwwDESIGN-basti commented 1 year ago

same here.

jbcbdse commented 1 year ago

I discovered that AWS does not allow any outbound traffic on port 25 (i.e. you can't send email) from EC2 or Lambda unless you ask their permission and give them a valid reason.

wwwDESIGN-basti commented 1 year ago

I just noticed that too. I put the service down to Hetzner