Hi everyone,
I’m new to KumoMTA and struggling with setting up proper SMTP authentication and relaying. I’ve installed KumoMTA on a Rocky Linux server and generated self-signed certificates for TLS.
My issue is that when clients try to send mail through my server, they receive:
Mailbox unavailable.The server response was: 5.7.1 relaying not permitted for 192.99.35.202
I’ve configured the server with authentication users in my my init.lua (attached. ) and set up the get_listener_domain event to allow authenticated users to relay to any domain.
I believe my auth setup is correct, but I’m not seeing any auth attempts in the logs, which makes me think clients aren’t successfully doing STARTTLS and attempting authentication before sending.
My current setup includes:
Self-signed certs for TLS
SMTP listeners on ports 25 and 587
Authentication handler for smtp_server_auth_plain
Connection logging for debugging
Special rule to allow mail-tester.com for testing
Are there any common gotchas with authentication and relaying I should be aware of? How can I debug whether clients are attempting authentication correctly?
Any help would be greatly appreciated!
I have now noticed that when i send the email, even with right authentication it does not send and says that The server response was: 5.7.1 relaying not permitted for 192.99.35.202. Am i missing something in my config? message.txt (5.03 KB)
The way authentication works is that ONE of the methods will let you pass mail. You can use:
relay hosts
smtp_auth
listener_domains
If you want smtp_auth, you do not (should not) add the ip to relay_hosts. If a message arrives from ANY IP with valid credentials it will be allowed to pass. It is important to know that you do NOT need to set the listener as an open relay. If the credentials are valid Kumo will accept it.
I now started seeing different error. I had to dump all my code to see if i am missing something, of if someone can help me reproduce the issues and see if we come up with a solution together
I am also requesting for a general review of my work to see if i get some recommendation.
Thank you, I solved the permission issues, but then I just noticed from the logs that I am not receiving the credentials actually from the logs.
I feel it is from this code block
local authz_id = conn_meta:get_meta('authz_id')
local peer_ip = conn_meta:get_meta('peer_address')
local is_using_tls = conn_meta:get_meta('tls_status') == 'Active'
kumo.log_debug("Checking relay permissions - Domain:", domain,
"IP:", peer_ip,
"Auth:", authz_id or "none",
"TLS:", is_using_tls and "Yes" or "No")```
Maybe I am not collecting the connection meta data right and then there is no value for peer_ip, autz_id and even is_using_tls all are empty string unfortunately. from my logs observation