kumo.on(‘http_server_validate_auth_basic’, function(user, password)
print(‘VALIDATING’)
local password_database = {
[‘scott’] = ‘tiger’,
}
if password == ‘’ then
return false
end
return password_database[user] == password
end)
This is my http server description and http auth handler, and I'm sending request to /inject URL with curl without --user flag, like no authentication, and from different IPs, but the thing is - it's always success, not printing "VALIDATING", so it's ignored.
Seems like I'm missing something basic, but don't understand what exactly.
Any help is appreciated. Thanks!
Hey there @dapper-yeti, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.
@free-spirited-yorksh so, now my question is: how can I set name/password pairs for each tenant/domain? Because as I understand with this configuration I can use scott:tiger for any domain right? Thanks in advance!
kumo.on('http_server_validate_auth_basic', function(user, password)
print('VALIDATING')
print(user)
print(password)
local password_database = {
['scott'] = 'tiger',
['sporty'] = 'lion'
}
if password == '' then
return false
end
return password_database[user] == password
end)
Based on that I can use both login/password pairs for any of these domains xxx or yyy.
But my goal is - sporty username should be allowed only for domain yyy.com
["auth-send.example.com"]
# relay to anywhere, so long as the sender domain is auth-send.example.com
# and the connected peer has authenticated as any of the authorization identities
# listed below using SMTP AUTH
relay_from_authz = [ 'username1', 'username2' ]```
– Use this to lookup and confirm a user/password credential
kumo.on(‘smtp_server_auth_plain’, function(authz, authc, password, conn_meta)
local password_database = {
[‘scott’] = ‘tiger’,
}
if password == ‘’ then
return false
end
return password_database[authc] == password
end)