Authentication Providers Setting
Question asked by David Myers - 10/30/2026 at 8:25 PM
Answered
Setting up a brand new install of SmarterMail.
In Domains -> (domain name) -> general, I am trying to add an authentication provider (authentication provider settings), specifically that of Active directory.

Fields:
Type: Active Directory
Name: Bob
Server Address: <IP of AD Server>
Port: 389
Encryption: None
Domain name: <AD Domain Name>
Organizational Unit: <OrgUnit Stuff>
I have no other options. When I click "continue" it states
" The supplied credential is invalid".
There is nowhere to supply credentials. If I change it to LDAP there is a username / password option, but with "Active Directory" those are all the options.

I enabled "Active Directory Integration" under Domains -> (mydomain) -> Options -> Features -> Active Directory Integration.

I'm looking to migrate off on-prem Exchange, so I assume I need the AD integration but I can't see why I get this error when I can't authenticate anywhere.

I was able to authenticate with LDAP. I'm not seeing where the differences between the two are for use with SmarterMail, but the only difference is with LDAP I can put in user@domain and a password. But you have no options to do that with the Active Directory dropdown.
Douglas Foster Replied
Is your server joined to that domain, or joined to a domain trusted by that server?    I think that relationship is needed because SM uses operating system calls to authenticate with A.D.
Tony Scholz Replied
Employee Post Marked As Answer
Hello, 

The Active Directory (AD) and LDAP options can both connect to Microsoft Active Directory, but they authenticate differently. The Active Directory option uses the credentials available to the SmarterMail service, which is why it doesn’t display username and password fields. The LDAP option uses the credentials you enter.

I found that LDAP works better if you are on a Unix server. 

For the AD connection, the server does NOT need to be domain-joined, but it helps. 

Check the operating system and identity under which the SmarterMail service runs. That identity needs appropriate credentials and permission to query the directory.

Since you’ve already connected successfully with the LDAP option, that is also a valid way to connect SmarterMail to Active Directory. For LDAP basic authentication, use TLS or StartTLS rather than an unencrypted connection.

Thank you
~Tony



Tony Scholz
Lead Network/System Administrator
SmarterTools Inc.
David Myers Replied
The server is on the same domain, joined to active directory. 
I have LDAP working but the AD connection keeps failing because of “bad username or password”.
It appears it uses a pass thru use of credentials but even as a domain admin it fails. Since the majority of my environment is windows id prefer AD integration over LDAP thus why I started the post

Tony Scholz Replied
Employee Post
Hello, 

Run this to see which service is running SmarterMail. 

PowerShell
Get-CimInstance Win32_Service -Filter "Name='MailService'" | Select-Object Name, StartName, State

Then test what you get 

PowerShell
Add-Type -AssemblyName System.DirectoryServices.Protocols

$server = "<DC_IP_or_FQDN>"
$cred = Get-Credential -UserName "<DOMAIN>\<Username>" -Message "Enter service account password"

try {
    $ldap = New-Object System.DirectoryServices.Protocols.LdapConnection($server)
    $ldap.AuthType = [System.DirectoryServices.Protocols.AuthType]::Negotiate
    $ldap.Bind($cred)
    Write-Host "SUCCESS: Authenticated and bound to AD successfully." -ForegroundColor Green
    $ldap.Dispose()
} catch {
    Write-Host "FAILED: $($_.Exception.Message)" -ForegroundColor Red
}
Thank you
~Tony
Tony Scholz
Lead Network/System Administrator
SmarterTools Inc.
David Myers Replied
So first script tells me that it's running as local system.
I ran the second, and it fails:
"FAILED: Exception calling "Bind" with "1" argument(s): "The supplied credential is invalid."

That's typing in my domain admin username and password just to make sure it's not a security problem.

So I figure I'll try creating a service account. Get that in there. Now it's not running as localsystem, it's running as my service account (smartmail).

I get the same message as before - the supplied credential is invalid.

On the domain controller, it has an event for trying to log in with this username and password, and it tells me it's an unknown user name or bad password.
However I can log into windows on the server machine with these same credentials.

Tony Scholz Replied
Employee Post
For the local service account, try this? 


Add-Type -AssemblyName System.DirectoryServices.Protocols

$server = "<DC_IP_or_FQDN>"

try {
    $ldap = New-Object System.DirectoryServices.Protocols.LdapConnection($server)
    $ldap.AuthType = [System.DirectoryServices.Protocols.AuthType]::Negotiate
    $ldap.Bind() # Binds using the current process/machine identity
    Write-Host "SUCCESS: Machine context bound to AD successfully." -ForegroundColor Green
    $ldap.Dispose()
} catch {
    Write-Host "FAILED: $($_.Exception.Message)" -ForegroundColor Red
}
And let me know what you get. 

Thank you
Tony Scholz
Lead Network/System Administrator
SmarterTools Inc.
David Myers Replied
Running that script gives:

FAILED: Exception calling "Bind" with "0" argument(s): "The supplied credential is invalid."

Also assuming the Server IP was supposed to be the AD server.
Douglas Foster Replied
Have you used the LDP.EXE utility to test connectivity.
Most of my problems with LDAP logins and queries have been related to the LDAP query string.
I don't think it will walk a subtree to perform a login, so I think you need to specfiy the exact path to the account that you are using.   I am working from memory, but typically something like this:  
dc=com, dc=example, ou=services, ou=ldapservices, cn=SmarterMailService

Reply to Thread

Enter the verification text