anonaddy / docker

AnonAddy Docker image
MIT License
468 stars 51 forks source link

catch-all behavior related to ANONADDY_ALL_DOMAINS #241

Open zkazsi opened 8 months ago

zkazsi commented 8 months ago

Support guidelines

I've found a bug and checked that ...

Description

Not sure if I found a bug or a feature

It seems, catch-all not always works, when I would expect.

However, to me it seems contrary to the description, which says: ANONADDY_ALL_DOMAINS: If you would like to have other domains to use (e.g. @username.example2.com), set a comma separated list like so, example.com,example2.com (default $ANONADDY_DOMAIN) Based on this I expected, I will need to have all domains used in this line

Expected behaviour

Actual behaviour

=> in these cases only addresses already created manually would work and be forwarded.

Additional problem, that there is no feedback at all about not forwarding the mail (it just goes into nowhere). The server does receive the message from the external sender (smtpd), but does not forward it to the recipient (smtp)

Steps to reproduce

In the anonaddy.env:

Catch-all not working ANONADDY_ALL_DOMAINS=mainaddydomain.com,domain2.com,domain3.xyz

When I remove the 2 additional domains from this line, catch-all seems to work again Catch-all is working: ANONADDY_ALL_DOMAINS=mainaddydomain.com

Docker info

Client: Docker Engine - Community
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.21.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 8
  Running: 4
  Paused: 0
  Stopped: 4
 Images: 9
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
 runc version: v1.1.9-0-gccaecfc
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-87-generic
 Operating System: Ubuntu 22.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.918GiB
 Name: mail.mainaddydomain.com
 ID: 3ea26cc9-1e27-407c-9977-7c2e8716c8d0
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

No response

Logs

Example of log when forwarding does not work:

anonaddy        |    INFO  No scheduled commands are ready to run.  
anonaddy        | 
anonaddy        | Nov 02 16:33:02 app postfix/smtpd[949]: 8FD364045E: client=mail-oi1-f177.google.com[209.85.167.177]
anonaddy        | Nov 02 16:33:02 app postfix/cleanup[956]: 8FD364045E: message-id=<CAAKWhEkatdp+hr3kyV+-RsOcuyQ6E0=qVL0h9OK6s8dYOdkJ3A@mail.gmail.com>
anonaddy        | Nov 02 16:33:07 app postfix/qmgr[940]: 8FD364045E: from=<sender@gmail.com>, size=2064, nrcpt=1 (queue active)
anonaddy        | Nov 02 16:33:07 app postfix/smtpd[949]: disconnect from mail-oi1-f177.google.com[209.85.167.177] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
anonaddy        | Nov 02 16:33:07 app postfix/pipe[957]: 8FD364045E: to=<alias@domain3.xyz>, relay=anonaddy, delay=7.6, delays=6.8/0.01/0/0.76, dsn=2.0.0, status=sent (delivered via anonaddy service)
anonaddy        | Nov 02 16:33:07 app postfix/qmgr[940]: 8FD364045E: removed
anonaddy        | crond: USER anonaddy pid 961 cmd php /var/www/anonaddy/artisan schedule:run --no-ansi --no-interaction
anonaddy        | 
anonaddy        |    INFO  No scheduled commands are ready to run.  

=> no further interaction. In normal operation there are lines about forwarding email to recipient


### Additional info

anonaddy.env file relevant content:

PUID=1000 PGID=1000

MEMORY_LIMIT=256M UPLOAD_MAX_SIZE=16M OPCACHE_MEM_SIZE=128 REAL_IP_FROM=0.0.0.0/32 REAL_IP_HEADER=X-Forwarded-For LOG_IP_VAR=remote_addr

APP_KEY=base64:[redacted] APP_DEBUG=false APP_URL=https://app.mainaddydomain.com

ANONADDY_ADMIN_USERNAME=user-addy ANONADDY_ENABLE_REGISTRATION=false ANONADDY_DOMAIN=mainaddydomain.com

ANONADDY_ALL_DOMAINS=mainaddydomain.com,domain2.com,domain3.xyz # in this case, catch-all NOT working

ANONADDY_ALL_DOMAINS=mainaddydomain.com # this case, catch-all working correctly ANONADDY_HOSTNAME=mainaddydomain.com ANONADDY_DNS_RESOLVER=127.0.0.1 ANONADDY_SECRET=verylongsecret ANONADDY_DKIM_SELECTOR=default ANONADDY_DKIM_SIGNING_KEY=/data/dkim/mainaddydomain.com.private SANCTUM_STATEFUL_DOMAINS=app.mainaddydomain.com,localhost,localhost:8000,127.0.0.1,127.0.0.1:8000,domain2.com,domain3.xyz