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

Can't make smtp_forward to work - error "550 I cannot deliver mail for" #3437

Open
arseniov opened this issue Jan 26, 2025 · 1 comment
Open

Comments

@arseniov
Copy link

arseniov commented Jan 26, 2025

System Info

Docker image instrumentisto/haraka (https://hub.docker.com/r/instrumentisto/haraka)

Haraka | Haraka.js - Version 3.0.3
Node | v22.5.1
OS | Linux Debian 6.1.123-1 (2025-01-02) x86_64 Linux

(possibly duplicate of #2884 and #3211, but I haven't been able to fix my issues)

I am trying to make Haraka work as a queue manager and rate limiter before sending SMTP requests to my actual SMTP server (provided by my domain hosting).
Specifically I have multiple Docker services I need to send emails from, but since my hosting SMTP server limits 250 messages sent per hour I need a way to limit the number of messages sent to the SMTP server and queue/delay/defer the exceeding amounts to the following hour - and so on:

Local services > Haraka > actual outbound SMTP server (MX) > RCPT
queue :587 with TLS, AUTH w/ user/pwd
rate limit

So if I understand correctly to have this in Haraka I need to set it up with:

  • smtp listening
  • queue/smtp_forward set up to AUTH to my actual SMTP server
  • limit set up with rules to limit throughput from Haraka

The problem is - even before starting looking into the limit plugin - I am unable to send any email using the smtp_forward plugin to have my actual SMTP server.
I am getting this error: 550 I cannot deliver mail for <[redacted]@gmail.com>.

I have tried any possible configuration I am aware of, and haven't been able to understand what the issue is. I have tested other MTAs (Postfix - Postal) and are both working correctly (although not providing the sort of rate limiting options I need, and therefore not an option) so the issue is probably not in my SMTP or server set up, but rather in how I've configured Haraka?

Thanks in advance for any help ❤️

Haraka log:

2025-01-26T13:04:04.245Z Starting up Haraka version 3.0.3
2025-01-26T13:04:04.245Z [INFO] [-] [core] Loading plugins
2025-01-26T13:04:04.245Z [INFO] [-] [core] Loading plugin: queue/smtp_forward
2025-01-26T13:04:04.245Z [DEBUG] [-] [core] no timeout in queue/smtp_forward.timeout
2025-01-26T13:04:04.246Z [DEBUG] [-] [core] no timeout in plugin_timeout
2025-01-26T13:04:04.246Z [DEBUG] [-] [core] plugin queue/smtp_forward timeout is: 30s
2025-01-26T13:04:04.246Z [DEBUG] [-] [core] registered hook queue to queue/smtp_forward.queue_forward priority 0
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] registered hook queue_outbound to queue/smtp_forward.queue_forward priority 0
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] registered hook get_mx to queue/smtp_forward.get_mx priority 0
2025-01-26T13:04:04.247Z [INFO] [-] [core] Loading plugin: limit
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] no timeout in limit.timeout
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] no timeout in plugin_timeout
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] plugin limit timeout is: 30s
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] no timeout in haraka-plugin-redis.timeout
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] no timeout in plugin_timeout
2025-01-26T13:04:04.247Z [DEBUG] [-] [core] plugin haraka-plugin-redis timeout is: 30s
2025-01-26T13:04:04.250Z [INFO] [-] [core] loading tls.ini
2025-01-26T13:04:04.252Z [DEBUG] [-] [core] loading dhparams from dhparams.pem
2025-01-26T13:04:04.253Z [ERROR] [-] [core] tls key /etc/haraka/config/tls_key.pem could not be loaded.
2025-01-26T13:04:04.253Z [ERROR] [-] [core] tls cert /etc/haraka/config/tls_cert.pem could not be loaded.
2025-01-26T13:04:04.279Z [NOTICE] [-] [core] Listening on [::0]:8025
2025-01-26T13:04:04.280Z [DEBUG] [-] [server] running init_child hooks
2025-01-26T13:04:04.281Z [NOTICE] [-] [core] worker 1 listening on [::0]:8025
2025-01-26T13:04:43.905Z [DEBUG] [-] [core] addOCSP: not available
2025-01-26T13:04:43.940Z [NOTICE] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] connect ip=172.16.11.1 port=48496 local_ip=172.16.11.2 local_port=8025
2025-01-26T13:04:43.945Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running connect_init hooks
2025-01-26T13:04:43.945Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running connect_init_respond
2025-01-26T13:04:43.945Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running lookup_rdns hooks
2025-01-26T13:04:43.964Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running connect hooks
2025-01-26T13:04:43.973Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running ehlo hooks
2025-01-26T13:04:43.975Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321] [core] running capabilities hooks
2025-01-26T13:04:44.006Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running mail hooks
2025-01-26T13:04:44.006Z [NOTICE] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] sender <sales@[redacted].it> code=CONT msg=""
2025-01-26T13:04:44.013Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running rcpt hooks
2025-01-26T13:04:44.014Z [NOTICE] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] recipient <[redacted]@gmail.com> code=OK msg="" sender=sales@[redacted].it
2025-01-26T13:04:44.015Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running rset hooks
2025-01-26T13:04:44.018Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running reset_transaction hooks
2025-01-26T13:04:44.052Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running quit hooks
2025-01-26T13:04:44.052Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] client has disconnected
2025-01-26T13:04:44.052Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] running disconnect hooks
2025-01-26T13:04:44.053Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] client has disconnected
2025-01-26T13:04:44.053Z [DEBUG] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] client has disconnected
2025-01-26T13:04:44.053Z [NOTICE] [6C895F22-AAB5-4164-AD44-EF6A6C68A321.1] [core] disconnect ip=172.16.11.1 rdns=NXDOMAIN helo=[172.16.11.4] relay=N early=N esmtp=Y tls=N pipe=N errors=0 txns=1 rcpts=0/0/1 msgs=0/0/0 bytes=0 lr="550 I cannot deliver mail for <[redacted]@gmail.com>" time=0.129

smtp.ini:

listen=[::0]:8025

smtp_forward.ini:

host=mail.[redacted].it
port=587
enable_tls=true
auth_type=login
auth_user=sales@[redacted].it
auth_pass=[redacted]
enable_outbound=false
@taodong
Copy link

taodong commented Feb 19, 2025

I faced the same error in my docker environment, except that I used a docker image other than instrumentisto/haraka. I was able to solve this problem by adding the domain of my recipient email to the config/host_list file, in your case it would be gmail.com.

If you are not using rcpt_to.in_host_list plugin, I think having an open relay should work too.

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

2 participants