Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email not flowing #10

Closed
alex-phillips opened this issue Mar 16, 2020 · 29 comments
Closed

Email not flowing #10

alex-phillips opened this issue Mar 16, 2020 · 29 comments
Labels

Comments

@alex-phillips
Copy link

alex-phillips commented Mar 16, 2020

Behaviour

After setup, it is unable to send verification emails. Manually verifying (changing column in DB) and sending to an alias with my email as the forwarded address doesn't seem to be sending either. None of the containers logs seem to show anything helpful (or that anything is happening at all).

Steps to reproduce this issue

  1. Fresh install, seed the DB
  2. Add a new recipient
  3. Send verification email (automatic)

Expected behaviour

Verification email should come to inbox (or at least spam?)

Actual behaviour

No email received, inbox or spam. Tried multiple email providers. Nothing signification (good or bad) in container logs.

Configuration

  • Docker version (type docker --version) : Docker version 19.03.6, build 369ce74a3c

  • Docker compose version if applicable (type docker-compose --version) : docker-compose version 1.21.2, build a133471

  • Platform (Debian 9, Ubuntu 18.04, ...) : Ubuntu 18.04

  • System info (type uname -a) : Linux 4.15.0-88-generic Simplify Dockerfile Alpine Linux apk usage #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  • Include all necessary configuration files : docker-compose.yml, .env, ...

docker-compose.yml

version: "3.5"
services:
  anonaddy:
    image: crazymax/anonaddy:latest
    container_name: anonaddy
    depends_on:
      - mariadb
      - anonaddy_redis
    volumes:
      - ${HOME}/docker/anonaddy:/data
    env_file:
      - ./anonaddy.env
    environment:
      - DB_HOST=mariadb
      - DB_DATABASE=anonaddy
      - DB_USERNAME=root
      - DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - REDIS_HOST=anonaddy_redis
    restart: always
    ports:
      - 8080:8080

  anonaddy_postfix:
    image: crazymax/anonaddy:latest
    container_name: anonaddy_postfix
    depends_on:
      - anonaddy
    ports:
      - 2500:2500
    volumes:
      - ${HOME}/docker/anonaddy:/data
    env_file:
      - ./anonaddy.env
    environment:
      - DB_HOST=mariadb
      - DB_DATABASE=anonaddy
      - DB_USERNAME=root
      - DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - REDIS_HOST=anonaddy_redis
      - SIDECAR_POSTFIX=1
    restart: always

  anonaddy_cron:
    image: crazymax/anonaddy:latest
    container_name: anonaddy_cron
    depends_on:
      - anonaddy
    volumes:
      - ${HOME}/docker/anonaddy:/data
    env_file:
      - ./anonaddy.env
    environment:
      - DB_HOST=mariadb
      - DB_DATABASE=anonaddy
      - DB_USERNAME=root
      - DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - REDIS_HOST=anonaddy_redis
      - SIDECAR_CRON=1
    restart: always

  anonaddy_redis:
    image: redis:4.0-alpine
    container_name: anonaddy_redis
    restart: always

  mariadb:
    container_name: mariadb
    image: linuxserver/mariadb
    volumes:
      - ${HOME}/docker/mariadb:/config
    ports:
      - 3306:3306
    environment:
      PGID: ${PGID}
      PUID: ${PUID}
      TZ: ${TIMEZONE}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}

anonaddy.env

TZ=America/New_York
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=REDACTED
APP_DEBUG=false
APP_URL=https://anonaddy.MYDOMAIN.com

ANONADDY_RETURN_PATH=bounces@mydomain.com
ANONADDY_ADMIN_USERNAME=anonaddy
ANONADDY_ENABLE_REGISTRATION=false
ANONADDY_DOMAIN=mydomain.com
ANONADDY_HOSTNAME=mail.mydomain.com
ANONADDY_DNS_RESOLVER=1.1.1.1
ANONADDY_SECRET=REDACTED
ANONADDY_LIMIT=200
ANONADDY_BANDWIDTH_LIMIT=104857600
ANONADDY_NEW_ALIAS_LIMIT=10
ANONADDY_ADDITIONAL_USERNAME_LIMIT=3

MAIL_FROM_NAME=AnonAddy
MAIL_FROM_ADDRESS=anonaddy@mydomain.com

Docker info

Client:
 Debug Mode: false
 Plugins:
  app: Docker Application (Docker Inc., v0.8.0)
  buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)

Server:
 Containers: 87
  Running: 87
  Paused: 0
  Stopped: 0
 Images: 160
 Server Version: 19.03.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 35bd7a5f69c13e1563af8a93431411cd9ecf5021
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-88-generic
 Operating System: Ubuntu 18.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 62.88GiB
 Name: localhost
 ID: 6XPE:ZETM:Y5D2:EZFD:DXJG:SXRK:7VEF:G5LV:OPNJ:TMHV:2CP7:2PII
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: alexphillips
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Logs

anonaddy

s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-fix-logs.sh: executing... 
[cont-init.d] 00-fix-logs.sh: exited 0.
[cont-init.d] 01-fix-uidgid.sh: executing... 
[cont-init.d] 01-fix-uidgid.sh: exited 0.
[cont-init.d] 02-fix-perms.sh: executing... 
Fixing perms...
[cont-init.d] 02-fix-perms.sh: exited 0.
[cont-init.d] 03-config.sh: executing... 
Setting timezone to America/New_York...
Setting PHP-FPM configuration...
Setting PHP INI configuration...
Setting OpCache configuration...
Setting Nginx configuration...
Initializing files and folders...
Checking database connection...
Waiting 60s for database to be ready...
Database ready!
Creating AnonAddy env file...
Copied File [/vendor/fideloper/proxy/config/trustedproxy.php] To [/config/trustedproxy.php]
Publishing complete.
[cont-init.d] 03-config.sh: exited 0.
[cont-init.d] 04-svc-main.sh: executing... 
Nothing to migrate.
Application cache cleared!
Configuration cache cleared!
Configuration cached successfully!
[cont-init.d] 04-svc-main.sh: exited 0.
[cont-init.d] 05-svc-postfix.sh: executing... 
[cont-init.d] 05-svc-postfix.sh: exited 0.
[cont-init.d] 06-svc-cron.sh: executing... 
[cont-init.d] 06-svc-cron.sh: exited 0.
[cont-init.d] 99-clean.sh: executing... 
[cont-init.d] 99-clean.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2020/03/16 11:55:29 [notice] 324#324: using the "epoll" event method
2020/03/16 11:55:29 [notice] 324#324: nginx/1.16.1
2020/03/16 11:55:29 [notice] 324#324: OS: Linux 4.15.0-88-generic
2020/03/16 11:55:29 [notice] 324#324: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2020/03/16 11:55:29 [notice] 324#324: start worker processes
2020/03/16 11:55:29 [notice] 324#324: start worker process 339
2020/03/16 11:55:29 [notice] 324#324: start worker process 340
2020/03/16 11:55:29 [notice] 324#324: start worker process 341
2020/03/16 11:55:29 [notice] 324#324: start worker process 342
2020/03/16 11:55:29 [notice] 324#324: start worker process 343
2020/03/16 11:55:29 [notice] 324#324: start worker process 344
2020/03/16 11:55:29 [notice] 324#324: start worker process 345
2020/03/16 11:55:29 [notice] 324#324: start worker process 348
2020/03/16 11:55:29 [notice] 324#324: start worker process 355
2020/03/16 11:55:29 [notice] 324#324: start worker process 373
2020/03/16 11:55:29 [notice] 324#324: start worker process 389
2020/03/16 11:55:29 [notice] 324#324: start worker process 409
2020/03/16 11:55:29 [notice] 324#324: start worker process 431
2020/03/16 11:55:29 [notice] 324#324: start worker process 451
2020/03/16 11:55:29 [notice] 324#324: start worker process 477
2020/03/16 11:55:29 [notice] 324#324: start worker process 504
2020/03/16 11:55:29 [notice] 324#324: start worker process 535
2020/03/16 11:55:29 [notice] 324#324: start worker process 579
2020/03/16 11:55:29 [notice] 324#324: start worker process 607
2020/03/16 11:55:29 [notice] 324#324: start worker process 642
2020/03/16 11:55:29 [notice] 324#324: start worker process 700
2020/03/16 11:55:29 [notice] 324#324: start worker process 734
2020/03/16 11:55:29 [notice] 324#324: start worker process 756
2020/03/16 11:55:29 [notice] 324#324: start worker process 778
[16-Mar-2020 11:55:29] NOTICE: fpm is running, pid 325
[16-Mar-2020 11:55:29] NOTICE: ready to handle connections

anonaddy_postfix

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-fix-logs.sh: executing... 
[cont-init.d] 00-fix-logs.sh: exited 0.
[cont-init.d] 01-fix-uidgid.sh: executing... 
[cont-init.d] 01-fix-uidgid.sh: exited 0.
[cont-init.d] 02-fix-perms.sh: executing... 
Fixing perms...
[cont-init.d] 02-fix-perms.sh: exited 0.
[cont-init.d] 03-config.sh: executing... 
Setting timezone to America/New_York...
Setting PHP-FPM configuration...
Setting PHP INI configuration...
Setting OpCache configuration...
Setting Nginx configuration...
Initializing files and folders...
Checking database connection...
Waiting 60s for database to be ready...
Database ready!
Creating AnonAddy env file...
Copied File [/vendor/fideloper/proxy/config/trustedproxy.php] To [/config/trustedproxy.php]
Publishing complete.
[cont-init.d] 03-config.sh: exited 0.
[cont-init.d] 04-svc-main.sh: executing... 
[cont-init.d] 04-svc-main.sh: exited 0.
[cont-init.d] 05-svc-postfix.sh: executing... 
Setting Postfix master configuration...
Setting Postfix main configuration...
Creating recipient access configuration...
Creating stored procedure...
[cont-init.d] 05-svc-postfix.sh: exited 0.
[cont-init.d] 06-svc-cron.sh: executing... 
[cont-init.d] 06-svc-cron.sh: exited 0.
[cont-init.d] 99-clean.sh: executing... 
[cont-init.d] 99-clean.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Mar 16 11:55:36 mydomain postfix/postfix-script[385]: starting the Postfix mail system
Mar 16 11:55:36 mydomain postfix/master[386]: daemon started -- version 3.4.7, configuration /etc/postfix

anonaddy_redis

1:C 16 Mar 15:55:22.168 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 16 Mar 15:55:22.168 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 16 Mar 15:55:22.168 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 16 Mar 15:55:22.170 * Running mode=standalone, port=6379.
1:M 16 Mar 15:55:22.170 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 16 Mar 15:55:22.170 # Server initialized
1:M 16 Mar 15:55:22.170 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 16 Mar 15:55:22.170 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 16 Mar 15:55:22.170 * Ready to accept connections

mariadb

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing... 
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
200311 20:07:01 mysqld_safe Logging to syslog.
200311 20:07:01 mysqld_safe Starting mysqld daemon with databases from /config/databases
@bastidest
Copy link

Same behavior for me. I tried sending a email to the website to check if an alias was created automatically, but without success.

How can I check if the postfix container receives mails?

@crazy-max
Copy link
Member

@alex-phillips @bastidest,

Like I said in the README, this image is a draft for the moment. Not yet tested myself. I'll let you know when I have time to test this image completely.

@bastidest
Copy link

The following patch makes me receive the confirmation mail. The 'anonaddy' docker container was missing a postfix service to deliver the locally queued verification mails.

index f6495f6..82fd49d 100644
--- a/rootfs/etc/cont-init.d/04-svc-main.sh
+++ b/rootfs/etc/cont-init.d/04-svc-main.sh
@@ -7,6 +7,8 @@ if [ "$SIDECAR_CRON" = "1" ] || [ "$SIDECAR_POSTFIX" = "1" ]; then
   exit 0
 fi
 
+postfix start
+
 # Migrate
 su-exec anonaddy:anonaddy php artisan migrate --no-interaction --force
 su-exec anonaddy:anonaddy php artisan cache:clear --no-interaction

Did not have any luck with receiving emails yet tho.

@bastidest
Copy link

@alex-phillips With the patch from my previous message and this patch i got it working. I will make a PR with both.

A sendmail to the configured domain showed that the connection with the smtp server was refused. In the example docker-compose configuration, the smtp port is 2500. I set it to 25 and it was working without problems.

index 606af1e..b225298 100644
--- a/examples/compose/docker-compose.yml
+++ b/examples/compose/docker-compose.yml
@@ -47,7 +47,7 @@ services:
       - anonaddy
     ports:
       - target: 2500
-        published: 2500
+        published: 25
         protocol: tcp
     volumes:
       - "./data:/data"

@alex-phillips
Copy link
Author

@bastidest So the port change to 25 fixes receiving email, but I'm still unable to send email (specifically the confirmation email). I see now with the postfix start addition that it is actually attempting now, but the postfix logs don't seem right:

In the logs below, my recipient email was added (REAL_EMAIL@gmail.com), but it looks unusual in the log lines. Not sure if this is correct or not?

Mar 26 20:39:24 MYDOMAIN postfix/pipe[483]: 751BF34899B: to=<anonaddy+REAL_EMAIL=gmail.com@MYDOMAIN.com>, relay=anonaddy, delay=0.53, delays=0.01/0/0/0.52, dsn=2.0.0, status=sent (delivered via anonaddy service)

@bastidest
Copy link

@alex-phillips
My theory is that the postfix server in the anonaddy_postfix container is able to receive and redirect mail. The only thing the postfix in the anonaddy container does is to send the confirmation mail.

My (successful) mail delivery looks like that:

postfix_1   | Mar 27 07:36:30 MY_DOMAIN postfix/smtpd[929]: connect from outgoing-mailserver[A.A.A.A]
postfix_1   | Mar 27 07:36:30 MY_DOMAIN postfix/smtpd[929]: D852BDB31F: client=outgoing-mailserver[A.A.A.A]
postfix_1   | Mar 27 07:36:30 MY_DOMAIN postfix/cleanup[932]: D852BDB31F: message-id=<4d30bb0c-e88a-819e-1ec8-8abc086fb071@address.com>
postfix_1   | Mar 27 07:36:30 MY_DOMAIN postfix/qmgr[388]: D852BDB31F: from=<incoming.mail@address.com>, size=1203, nrcpt=1 (queue active)
postfix_1   | Mar 27 07:36:30 MY_DOMAIN postfix/smtpd[929]: disconnect from outgoing-mailserver[A.A.A.A] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
redis_1     | 1:M 27 Mar 06:36:31.370 * 1 changes in 3600 seconds. Saving...
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/pickup[895]: 66609DB324: uid=1000 from=<bounces@MY_DOMAIN.com>
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/cleanup[932]: 66609DB324: message-id=<0f5f51a7823f65998e3548cc2054cef9@MY_DOMAIN.com>
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/qmgr[388]: 66609DB324: from=<bounces@MY_DOMAIN.com>, size=1145, nrcpt=1 (queue active)
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/pipe[933]: D852BDB31F: to=<foobar@MY_DOMAIN.com>, relay=anonaddy, delay=0.57, delays=0.08/0.01/0/0.48, dsn=2.0.0, status=sent (delivered via anonaddy service)
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/qmgr[388]: D852BDB31F: removed
redis_1     | 1:M 27 Mar 06:36:31.371 * Background saving started by pid 15
redis_1     | 15:C 27 Mar 06:36:31.373 * DB saved on disk
redis_1     | 15:C 27 Mar 06:36:31.374 * RDB: 0 MB of memory used by copy-on-write
redis_1     | 1:M 27 Mar 06:36:31.472 * Background saving terminated with success
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/smtp[943]: 66609DB324: to=<receiving-mail-address@googlemail.com>, relay=gmail-smtp-in.l.google.com[74.125.140.27]:25, delay=0.51, delays=0.01/0.01/0.08/0.41, dsn=2.0.0, status=sent (250 2.0.0 OK DMARC:Quarantine 1585290991 m1si4818407wml.218 - gsmtp)
postfix_1   | Mar 27 07:36:31 MY_DOMAIN postfix/qmgr[388]: 66609DB324: removed
cron_1      | crond: USER anonaddy pid 6234 cmd cd /var/www/anonaddy && php artisan schedule:run --no-ansi --no-interaction --quiet

@alex-phillips
Copy link
Author

@bastidest Right, so if you look at my postfix logs, this specifically: to=<anonaddy+REAL_EMAIL=gmail.com@MYDOMAIN.com> That doesn't look right at all. I'm wondering if this is now a config issue on my part.

Can you glance over my files above or perhaps post yours?

@crazy-max
Copy link
Member

Hi @bastidest,

The following patch makes me receive the confirmation mail. The 'anonaddy' docker container was missing a postfix service to deliver the locally queued verification mails.
postfix start

It is not good practice to start a service this way (see https://github.com/just-containers/s6-overlay/). Also the sidecar postfix container already do this job.

A sendmail to the configured domain showed that the connection with the smtp server was refused. In the example docker-compose configuration, the smtp port is 2500. I set it to 25 and it was working without problems.

Default smtp port (25) should be ok for you but some distrib do not allow binding to unprivileged ports. But in our case we have to bind to port 25 like you said because there is no way to tell a sending server what port you're listening on using MX.

@alex-phillips
Copy link
Author

@crazy-max Is it possible that these containers need to share the same network then? Is the anonaddy container attempting to send to postfix, but since its technically running in another container, it's not working properly?

@crazy-max
Copy link
Member

crazy-max commented Mar 27, 2020

@alex-phillips

Is it possible that these containers need to share the same network then?

If you use the compose file in the examples folder, they are intrinsically part of the same network.

Is the anonaddy container attempting to send to postfix, but since its technically running in another container, it's not working properly?

I don't know if anonaddy is communicating directly with postfix. If it does, I don't see anything to configure the postfix server address on anonaddy. Any idea @willbrowningme?

@alex-phillips
Copy link
Author

@crazy-max yes they are on the same network, but if you use network_mode: service:anonaddy on the postfix container, then they will 'share' the same port 25. Not sure if that would help.

@bastidest
Copy link

@crazy-max

I don't know if anonaddy is communicating directly with postfix. If it does, I don't see anything to configure the postfix server address on anonaddy. Any idea @willbrowningme?

It appears to me that anonaddy is using Laravel as web framework. The current configuration tells Laravel to use the sendmail mail driver, which executes the local sendmail executable in the anonaddy container.
https://github.com/crazy-max/docker-anonaddy/blob/8475ef76624a1c1c191a8dd668713d31f3620d3d/rootfs/etc/cont-init.d/03-config.sh#L174-L176

Maybe set the driver to SMTP and use the existing anonaddy_postfix container to send mails. Laravel Mail Documentation.

Default smtp port (25) should be ok for you but some distrib do not allow binding to unprivileged ports. But in our case we have to bind to port 25 like you said because there is no way to tell a sending server what port you're listening on using MX.

I don't get your point. AFAIK mail servers need to be reachable under their well-known port.

@willbrowningme
Copy link
Member

@alex-phillips
I don't know if anonaddy is communicating directly with postfix. If it does, I don't see anything to configure the postfix server address on anonaddy. Any idea @willbrowningme?

When an email arrives at the server it is handled by Postfix. Postfix then pipes the received email through to the Laravel application (the lines in /etc/postfix/master.cf do this).

The Laravel application then determines where to forward the email onto by consulting the database, it sends the email using sendmail (set in config/mail.php - 'sendmail' => '/usr/sbin/sendmail -t -XV',).

@alex-phillips The reason you can see REAL_EMAIL@gmail.com is probably because of the variable envelope return path (VERP) being set.

I'm hoping to release the full detailed instructions for manually setting up the server soon which should help greatly with this Docker image.

@crazy-max
Copy link
Member

Maybe set the driver to SMTP and use the existing anonaddy_postfix container to send mails. Laravel Mail Documentation.

@bastidest Yes that should do it.

I'm hoping to release the full detailed instructions for manually setting up the server soon which should help greatly with this Docker image.

@willbrowningme I think I'll have time next week to test the documentation you sent me.

crazy-max added a commit that referenced this issue Mar 29, 2020
@crazy-max
Copy link
Member

crazy-max commented Mar 31, 2020

@alex-phillips @bastidest Should be fixed with latest image

@alex-phillips
Copy link
Author

@crazy-max I'm now getting a 500 now when attempting to send the confirmation email. I'm trying to add in an error_log directive to the nginx config, but every time I restart the container it reverts my changes. Are you logging errors anywhere so I can see what exactly the 500 is?

@alex-phillips
Copy link
Author

@crazy-max Looks like this is the error:

[2020-03-31 23:56:19] production.ERROR: Connection could not be established with host postfix :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name does not resolve {"userId":"18e2e368-2f81-4f98-b1b1-4b0edbddf38f","e
xception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host postfix :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name does not resolve at /var/www/anonaddy/vendor/swiftma
iler/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:269)

@alex-phillips
Copy link
Author

You can disregard that 500 error - I had the wrong hostname set for MAIL_HOST. That's returning successfully now, postfix outputs the following, which looks normal:

Apr 01 12:07:27 mydomain postfix/smtpd[402]: connect from anonaddy.htpc_default[172.18.0.31]
Apr 01 12:07:27 mydomain postfix/smtpd[402]: 899161A18C7: client=anonaddy.htpc_default[172.18.0.31]
Apr 01 12:07:27 mydomain postfix/cleanup[405]: 899161A18C7: message-id=<ee4997201ef6002b83a95c5def9cdba8@swift.generated>
Apr 01 12:07:27 mydomain postfix/qmgr[389]: 899161A18C7: from=<anonaddy@mydomain.com>, size=14674, nrcpt=1 (queue active)
Apr 01 12:07:27 mydomain postfix/smtpd[402]: disconnect from anonaddy.htpc_default[172.18.0.31] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Apr 01 12:07:27 mydomain postfix/pipe[406]: 899161A18C7: to=<ME@gmail.com>, relay=anonaddy, delay=0.38, delays=0.05/0/0/0.33, dsn=2.0.0, status=sent (delivered via anonaddy service)
Apr 01 12:07:27 mydomain postfix/qmgr[389]: 899161A18C7: removed

But still not getting the confirmation email at the destination.

@bastidest
Copy link

I am unable to do the initial login now. http://<host>:8000/login provides me with the error message

These credentials do not match our records.

when logging in with anonaddy/anonaddy.

What I did:

  • docker-compose down
  • docker system prune
  • docker volume prune
  • docker-compose pull (new image was pulled)
  • rm -rf data db
  • docker-compose up

I set ANONADDY_ADMIN_USERNAME=anonaddy in the anonaddy.env file.

@alex-phillips
Copy link
Author

@bastidest Did you run the seed command? docker-compose exec --user anonaddy anonaddy php artisan db:seed --force

@bastidest
Copy link

@alex-phillips thank you that worked
Now I don't get an confirmation mail either. These are my postfix logs:

postfix_1   | Apr 02 20:49:02 <hostname> postfix/smtpd[419]: connect from anonaddy.anonaddy_default[172.26.0.4]
postfix_1   | Apr 02 20:49:02 <hostname> postfix/smtpd[419]: CFDE21FE54: client=anonaddy.anonaddy_default[172.26.0.4]
postfix_1   | Apr 02 20:49:02 <hostname> postfix/cleanup[421]: CFDE21FE54: message-id=<10d460e8615039161895008f547afe5e@swift.generated>
postfix_1   | Apr 02 20:49:02 <hostname> postfix/qmgr[417]: CFDE21FE54: from=<anonaddy@<hostname>.com>, size=14723, nrcpt=1 (queue active)
postfix_1   | Apr 02 20:49:02 <hostname> postfix/smtpd[419]: disconnect from anonaddy.anonaddy_default[172.26.0.4] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
postfix_1   | Apr 02 20:49:03 <hostname> postfix/pipe[422]: CFDE21FE54: to=<myaddress@googlemail.com>, relay=anonaddy, delay=0.35, delays=0.01/0.01/0/0.32, dsn=2.0.0, status=sent (delivered via anonaddy service)
postfix_1   | Apr 02 20:49:03 <hostname> postfix/qmgr[417]: CFDE21FE54: removed

@alex-phillips
Copy link
Author

Anyone have any luck getting this working?

@brincowale
Copy link

brincowale commented May 10, 2020

Same problem, but I don't need to send emails yet. So I modified the database to approve the domains whithout to receive the confirmation email

docker-compose exec db mysql
sql> use anonaddy;
sql> select * from recipients;
update recipients set email_verified_at = '2020-05-10 14:19:12';

But still not working. This is the error when postfix receive an email sent from Gmail.

postfix/smtpd[411]: NOQUEUE: reject: RCPT from mail-oi1-f181.google.com[209.85.167.181]: 554 5.7.1 <first@anonaddy.mydomain.com>: Relay access denied; from=<myemail@gmail.com> to=<first@anonaddy.mydomain.com> proto=ESMTP helo=<mail-oi1-f181.google.com>

I'll see how this thread goes

@crazy-max
Copy link
Member

I'll start the tests on the Docker image and I'll get back to you on that issue.

@crazy-max
Copy link
Member

Ok I was able to reproduce this issue on a VPS. Keep you in touch.

@crazy-max
Copy link
Member

@bastidest @alex-phillips @brincowale I've made some changes to this image and now everything seems to work. See CHANGELOG and the new compose example.

@alex-phillips
Copy link
Author

Great! I look forward to giving this a try. Thanks!

@Coderdude112
Copy link

Hello @alex-phillips,

I am having a very similar issue happen. I can access the web interface, create a user but the verification email won't send. I'm woundering if this has something to do with the most recent version of anonaddy (0.8.0) what version were you able to get this running with?

Thanks in advance

@crazy-max
Copy link
Member

@Coderdude112 #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants