How to set smtp user and password

Hello everyone,

I’m new to KumoMTA, and I have to say that it has completely blown me away with how powerful it is—and it’s open source, too! I’ve recently installed KumoMTA on CentOS 9, and after some setup, it’s now responding properly when I use telnet to connect on port 25.

However, I’m struggling with setting up SMTP authentication, specifically assigning usernames and passwords for SMTP clients to authenticate with. I’ve gone through the documentation over the past few days, but I still can’t figure out how to configure this.

Previously, I worked with PowerMTA (PMTA), which had a single configuration file where I could easily modify all settings. With KumoMTA, I’m unsure where and how to define SMTP users and passwords since there are several configuration files involved.

Could anyone guide me on how to set up SMTP authentication in KumoMTA, or point me in the right direction?

Thank you all in advance for your help!

This is probably the droid you are looking for:

THe sample on that page will literally work as is.

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)```

so, the smtp listener checks to make sure you are connecting from an approved IP or domain. Then is SMTP_Auth was used AND you have TLS configured, the messages is handed to the function listed above to validate the SMTP_Auth credentials. Inside there you can use plain text, or a data store to look up the credentials.

Several people in this group have implemented using sqlite3.

The thing most people have trouble with is that TLS MUST be configured or SMTP_Auth will not work.

@faithful-ostrich Thank you for your response. I have already gone through the technical article you shared (https://discord.com/channels/1072980126737907824/1292515510063202475/1292658690394161256), but I’m unsure about which file this code should be written in.

That would be init.lua

Pretty much everything is in init.lua unless otherwise specified.