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

Cannot send emails #69

Closed
Coderdude112 opened this issue Jul 28, 2021 · 10 comments
Closed

Cannot send emails #69

Coderdude112 opened this issue Jul 28, 2021 · 10 comments

Comments

@Coderdude112
Copy link

Coderdude112 commented Jul 28, 2021

Right after setting up AnonAddy and registering for an account, AnonAddy wants to verify the user's real email address. I setup a dummy account using a 10 min mail real address but noticed that no verification email is being sent. In the logs I get this error message:

Jul 28 11:42:05 mail postfix/smtp[1155]: connect to mail.hyprhost.com[206.189.253.136]:25: Connection refused

What's going on with this? I've also tried it with my gmail account but got the same error. Does this have something to do with my ports? (I am forwarding port 52 to my docker container)

Thanks for your help in advance

EDIT: here are some more descriptive error messages:

Jul 28 13:08:39 mail postfix/pickup[925]: 9B4F08886: uid=1000 from=<[REDACTED EMAIL]>
Jul 28 13:08:39 mail postfix/cleanup[1006]: 9B4F08886: message-id=<b82f06c290a70d771e73cb15c135e898@swift.generated>
Jul 28 13:08:39 mail postfix/qmgr[926]: 9B4F08886: from=<[REDACTED EMAIL]>, size=14646, nrcpt=1 (queue active)
Jul 28 13:09:02 mail postfix/smtp[1009]: connect to [REDACTED EMAIL SERVICE] Connection refused
Jul 28 13:09:23 mail postfix/smtp[1009]: 9B4F08886: to=<[REDACTED EMAIL]>, relay=none, delay=44, delays=0.23/0.01/44/0, dsn=4.4.1, status=deferred (connect to [REDACTED EMAIL SERVICE] Connection refused)

UPDATE:
Does this have something to do with my reverse DNS records? Im starting to think it does...

@willbrowningme
Copy link
Member

Is port 25 open?

Check by running sudo ufw status

@Coderdude112
Copy link
Author

Coderdude112 commented Jul 29, 2021

I am unsure of where to run this.

I am exposing port 25 on the docker container with these lines:

ports:
  - 25:25/tcp
  - 8098:8000/tcp

And I am forwarding port 25 on my router to my server.

EDIT:
Though I'm not entirely sure if my ISP is allowing port 25.

@KevinRoebert
Copy link
Contributor

It is unusual to run a mail server over a private Internet connection because this usually does not work.

There are several reasons for this. First, the IP address range of the end customer ISPs is on almost all blocklists. This is done to prevent mass spam from infected bots.

So you need an IP address from your ISP that is not in its default address range.

Furthermore, the IPv4 addresses of a private connection usually change after a certain time or a router restart. This is not suitable for email servers. Most mail servers work with a reverse DNS record check. To do this, you need to have your ISP create a reverse DNS record for your fixed IPv4 address. You cannot create this entry yourself. The reverse DNS record points from your IP address to your domain name (not the other way around as is usual with DNS - hence reverse DNS).

You can check it with this tool. Just enter your IPv4 address. What is the output?: https://mxtoolbox.com/ReverseLookup.aspx

What do you get as output from this tool? https://ssl-tools.net/mailservers

@Coderdude112
Copy link
Author

Yeah I just got off the phone with my ISP and can't change the rDNS record without a business acc & static IP so like 160+ a month. So that's an end right there.

Though, its a little silly as I've had the same IP for literally years, through long blackouts and many router restarts.

Anyway, I'm gonna get a VPS that has port 25 open and allows me to set custom rDNS records. (Vultr is who I'm thinking of going with)

Thanks for all the help everyone

@Coderdude112
Copy link
Author

Ok so I've got Anonaddy setup on a VPS but am still having problems sending the verification email for my account.
Here are the errors that appear when I try and send a verification email (I only edited the parts that say [REDACTED]

July 30 14:17:52 mail postfix/smtpd[975]: connect from unknown [127.0.0.1]
July 30 14:17:52 mail postfix/smtpd[975]: lost connection after STARTTLS from unknown[127.0.0.1]
July 30 14:17:52 mail postfix/smtpd[975]: disconnect from unknown[127.0.0.1] ehlo=1 starttls=0/1 commands=1/2

I have ensured that port 25 is open and my hosting provider isn't blocking things. I'm not sure if I've messed up other things so below are my config files. For reference I am trying to use anonaddy at lake.[DOMAIN]


docker-compose.yml

version: "3.5"
services:
  app:
    container_name: the_lake
    depends_on:
      - db
      - redis
    env_file:
      - ./the_lake.env
    image: anonaddy/anonaddy:latest
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.anonaddy.entrypoints=https"
      - "traefik.http.routers.anonaddy.rule=Host(`lake.[DOMAIN]`)"
      - "traefik.http.routers.anonaddy.tls=true"
      - "traefik.http.routers.anonaddy.tls.certresolver=letsencrypt"
      - "traefik.http.routers.anonaddy.tls.domains[0].main=lake.[DOMAIN]"
      - "traefik.http.services.anonaddy.loadbalancer.server.port=8000"
    ports:
      - 25:25/tcp
    restart: unless-stopped
    volumes:
      - ./data:/data
  db:
    container_name: the_lake_db
    command:
      - "mysqld"
      - "--character-set-server=utf8mb4"
      - "--collation-server=utf8mb4_unicode_ci"
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: the_lake_db
      MYSQL_USER: the_lake_db_user
      MYSQL_PASSWORD: "[PASSWORD]"
    image: mariadb:10.5
    restart: unless-stopped
    volumes:
      - ./db:/var/lib/mysql
  redis:
    container_name: the_lake_redis
    image: redis:4.0-alpine
    restart: unless-stopped
  proxy:
    container_name: the_lake_proxy
    command:
      - "--global.checknewversion=false"
      - "--global.sendanonymoususage=false"
      - "--log=true"
      - "--log.level=INFO"
      - "--entrypoints.http=true"
      - "--entrypoints.http.address=:80"
      - "--entrypoints.http.http.redirections.entrypoint.to=https"
      - "--entrypoints.http.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.https=true"
      - "--entrypoints.https.address=:443"
      - "--certificatesresolvers.letsencrypt"
      - "--certificatesresolvers.letsencrypt.acme.storage=acme.json"
      - "--certificatesresolvers.letsencrypt.acme.email=the_lake-lets_encrypt--webmaster@[DOMAIN]"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http"
      - "--providers.docker"
      - "--providers.docker.watch=true"
      - "--providers.docker.exposedbydefault=false"
    image: traefik:2.3
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
    volumes:
      - ./acme.json:/acme.json
      - /var/run/docker.sock:/var/run/docker.sock

the_lake.env

# General
TZ=[TZ]
PUID=1000
PGID=1000
MEMORY_LIMIT=256M
UPLOAD_MAX_SIZE=30M
OPCACHE_MEM_SIZE=128
REAL_IP_FROM=0.0.0.0/32
REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=remote_addr

# App
APP_NAME=The_Lake
APP_KEY=[KEY]
APP_DEBUG=false
APP_URL=https://lake.[DOMAIN]

# AnonAddy
ANONADDY_RETURN_PATH=bounces@[DOMAIN]
ANONADDY_ADMIN_USERNAME=[NAME]
ANONADDY_ENABLE_REGISTRATION=true
ANONADDY_DOMAIN=[DOMAIN]
ANONADDY_ALL_DOMAINS=[DOMAIN]
ANONADDY_HOSTNAME=lake.[DOMAIN]
ANONADDY_DNS_RESOLVER=9.9.9.9
ANONADDY_SECRET=[SECRET]
ANONADDY_LIMIT=200
ANONADDY_BANDWIDTH_LIMIT=524288000
ANONADDY_NEW_ALIAS_LIMIT=10
ANONADDY_ADDITIONAL_USERNAME_LIMIT=50

# Database
DB_HOST=db
DB_DATABASE=the_lake_db
DB_USERNAME=the_lake_db_user
DB_PASSWORD=[PASSWORD]

# Redis
REDIS_HOST=redis

# E-Mail
MAIL_FROM_NAME=The_Lake
MAIL_FROM_ADDRESS=the_lake@[DOMAIN]

# Postfix
POSTFIX_DEBUG=false
POSTFIX_SMTPD_TLS=false
POSTFIX_SMTP_TLS=false

# DMARC
DMARC_ENABLE=true
DMARC_FAILURE_REPORTS=true
DMARC_MILTER_DEBUG=0

DNS records

Please note my rDNS record is set to lake.[DOMAIN]

Edited

@KevinRoebert
Copy link
Contributor

Try Version 0.7.5

@Coderdude112
Copy link
Author

Yep, changed from the latest version to 0.7.5 and it worked immediately.

@crazy-max
Copy link
Member

Tracked in #70

@iabdo9
Copy link

iabdo9 commented Feb 28, 2022

Try Version 0.7.5

Version of what?
I have same problem

@Coderdude112
Copy link
Author

@abdooo9 At the time I tried using version 0.7.5 of Anonaddy on my server, I believe version 0.9+ is out by now so using the latest version is prob your best bet. This issue was due to my ISP blocking connections on port 25 & my inability to set rDNS records. I would look into both of these things to see if its the issue.

PS. Self-hosting email is kinda a pain in the butt. If it fits your needs, see if you can use Anonaddy or ProtonMail or both.

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

No branches or pull requests

5 participants