I've posted questions on this before, but now I really, really need a solution. Using Dovecot 2.2.33.2 We've been using Dovecot as IMAP server for several years on a Linux host which is also the Active Directory / Domain Controller. We have both Thunderbird and Outlook clients. The Thunderbird clients authenticate w/o problem with AD credentials using Kerberos/GSSAPI. I've never been able to get the Outlook clients to authenticate using domain credentials, so I've also hard-coded user and password into /etc/passwd and let the Dovecot authenticate via PLAIN LOGIN. Now, however, I am mandated to switch all users to Outlook, so I need an AD credential solution. I found https://wiki2.dovecot.org/HowTo/ActiveDirectoryNtlm and followed those instructions. The first problem I ran into was in Step 3 where it said to put the following line in the config: auth_ntlm_use_winbind = yes This gave me an error when I restarted Dovecot: Restarting Dovecotdoveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/10-auth.conf line 84: Unknown setting: auth_ntlm_use_winbind googling this error indicated that this was a version 1.x directive and 2.x used only auth_use_winbind. I removed the auth_ntlm_use_winbind and Dovecot restart. If this is true, the wiki should be updated since it purports to be a version 2.x wiki. I followed the rest of the instructions on that wiki and my modified config is: $ doveconf -n # 2.2.33.2 (d6601f4ec): /usr/local/etc/dovecot/dovecot.conf # OS: Linux 4.4.157 x86_64 Slackware 14.2 auth_debug = yes auth_debug_passwords = yes auth_gssapi_hostname = $ALL auth_krb5_keytab = /etc/dovecot/dovecot.keytab auth_mechanisms = plain login gssapi ntlm auth_use_winbind = yes auth_username_format = %n auth_verbose = yes auth_verbose_passwords = plain disable_plaintext_auth = no info_log_path = /var/log/dovecot_info mail_location = maildir:~/Maildir passdb { driver = shadow } protocols = imap ssl_cert = </etc/ssl/certs/OHPRS/GoDaddy/Apache/2016-08-10/54e789087d419b6e.crt ssl_key = # hidden, use -P to show it userdb { driver = passwd } verbose_ssl = yes New additions to my pre-ntlm conf is only the 'ntlm' added the the auth_mechanism and: auth_winbind_helper_path = /usr/bin/ntlm_auth which interestingly doesn't show into the 'doveconf -n' output, above. Is it a default? I then attempted to connect from Outlook and got the error: auth: Info: ntlm(?,192.168.0.58,<qd9nulmB4sLAqAA6>): ntlm_auth reports broken helper: NT_STATUS_UNSUCCESSFUL After more searching I came across this post, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774263 which, in summary, said that ntlm_auth had to run as root. So, I added the following to my dovecot config per that post's suggestion: service auth { user = root } After restarting and trying again to connect from Outlook I got the message: auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY At this point I've been unable to find a solution to this error. I've listed the entire dovecot log output for this last attempt to connect from Outlook below. Has anyone in the Universe successfully connected from Outlook using active domain credentials? If so, what's the secret? What am I not doing correctly? Thanks for any and all help! --Mark dovecot log: Feb 07 23:39:40 auth: Debug: Loading modules from directory: /usr/local/lib/dovecot/auth Feb 07 23:39:40 auth: Debug: Module loaded: /usr/local/lib/dovecot/auth/lib20_auth_var_expand_crypt.so Feb 07 23:39:40 auth: Debug: Read auth token secret from /usr/local/var/run/dovecot/auth-token-secret.dat Feb 07 23:39:40 auth: Debug: auth client connected (pid=16357) Feb 07 23:39:40 auth: Debug: client in: AUTH 1 NTLM service=imap session=SCINjFqBKcXAqAA6 lip=192.168.0.2 rip=192.168.0.58 lport=143 rport=50473 Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw== (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 TlRMTVNTUAACAAAACAAIADgAAAAFgomifTyOI3AwfogAAAAAAAAAAGIAYgBAAAAABgEAAAAAAA9IAFAAUgBTAAIACABIAFAAUgBTAAEACABNAEEASQBMAAQAFABoAHAAcgBzAC4AbABvAGMAYQBsAAMAHgBtAGEAaQBsAC4AaABwAHIAcwAuAGwAbwBjAGEAbAAHAAgAVIrLTWi/1AEAAAAA Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAADAAAAGAAYAGwAAAD8APwAhAAAAAAAAABYAAAACAAIAFgAAAAMAAwAYAAAAAAAAACAAQAABYKIogYBsR0AAAAPEulY2h+wL/nnNAXbmMSVx20AYQByAGsAQwBPAE0ATQBPAE4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5+rNhVU1odt5650z/pNVpQEBAAAAAAAAVIrLTWi/1AFg5+W08PtmxQAAAAACAAgASABQAFIAUwABAAgATQBBAEkATAAEABQAaABwAHIAcwAuAGwAbwBjAGEAbAADAB4AbQBhAGkAbAAuAGgAcAByAHMALgBsAG8AYwBhAGwABwAIAFSKy01ov9QBBgAEAAIAAAAIADAAMAAAAAAAAAABAAAAACAAAOity40ZG1J9BpqGn4TwBjP02UByQ6D/OUD6DrRDhg+3CgAQAAAAAAAAAAAAAAAAAAAAAAAJABIAaQBtAGEAcAAvAG0AYQBpAGwAAAAAAAAAAAAAAAAA (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY Feb 07 23:39:42 auth: Debug: client passdb out: FAIL 1
More on this ... I short-sheeted ntlm_auth to see what was being passed to it. It is getting as arg1: --helper-protocol=squid-2.5-ntlmssp I tried running ntlm_auth at the command line as: ntlm_auth --username=user --password=password --helper-protocol=squid-2.5-ntlmssp It did nothing, just hung there. The ntlm_auth man page says: --helper-protocol=PROTO Operate as a stdio-based helper. Valid helper protocols are: squid-2.5-ntlmssp Server-side helper for use with Squid 2.5's NTLMSSP authentication. Requires access to the directory winbindd_privileged in $LOCKDIR. The protocol used is described here: http://devel.squid-cache.org/ntlm/squid_helper_protocol.html. This protocol has been extended to allow the NTLMSSP Negotiate packet to be included as an argument to the YR command. (Thus avoiding loss of information in the protocol exchange). Squid NTLM authentication? As far as I know, I don't have Squid. If I leave off the --helper-protocol bit on the ntlm_auth command line, it returns an OK status. Is there a way to NOT pass "--helper-protocol=squid-2.5-ntlmssp"? Would this help? --Mark -----Original Message----- Date: Fri, 08 Feb 2019 00:19:19 -0500 Organization: Ohio Highway Patrol Retirement System To: dovecot at dovecot.org Subject: Need to authenticate Outlook and NTLM I've posted questions on this before, but now I really, really need a solution. Using Dovecot 2.2.33.2 We've been using Dovecot as IMAP server for several years on a Linux host which is also the Active Directory / Domain Controller. We have both Thunderbird and Outlook clients. The Thunderbird clients authenticate w/o problem with AD credentials using Kerberos/GSSAPI. I've never been able to get the Outlook clients to authenticate using domain credentials, so I've also hard-coded user and password into /etc/passwd and let the Dovecot authenticate via PLAIN LOGIN. Now, however, I am mandated to switch all users to Outlook, so I need an AD credential solution. I found https://wiki2.dovecot.org/HowTo/ActiveDirectoryNtlm and followed those instructions. The first problem I ran into was in Step 3 where it said to put the following line in the config: auth_ntlm_use_winbind = yes This gave me an error when I restarted Dovecot: Restarting Dovecotdoveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/10-auth.conf line 84: Unknown setting: auth_ntlm_use_winbind googling this error indicated that this was a version 1.x directive and 2.x used only auth_use_winbind. I removed the auth_ntlm_use_winbind and Dovecot restart. If this is true, the wiki should be updated since it purports to be a version 2.x wiki. I followed the rest of the instructions on that wiki and my modified config is: $ doveconf -n # 2.2.33.2 (d6601f4ec): /usr/local/etc/dovecot/dovecot.conf # OS: Linux 4.4.157 x86_64 Slackware 14.2 auth_debug = yes auth_debug_passwords = yes auth_gssapi_hostname = $ALL auth_krb5_keytab = /etc/dovecot/dovecot.keytab auth_mechanisms = plain login gssapi ntlm auth_use_winbind = yes auth_username_format = %n auth_verbose = yes auth_verbose_passwords = plain disable_plaintext_auth = no info_log_path = /var/log/dovecot_info mail_location = maildir:~/Maildir passdb { driver = shadow } protocols = imap ssl_cert = </etc/ssl/certs/OHPRS/GoDaddy/Apache/2016-08-10/54e789087d419b6e.crt ssl_key = # hidden, use -P to show it userdb { driver = passwd } verbose_ssl = yes New additions to my pre-ntlm conf is only the 'ntlm' added the the auth_mechanism and: auth_winbind_helper_path = /usr/bin/ntlm_auth which interestingly doesn't show into the 'doveconf -n' output, above. Is it a default? I then attempted to connect from Outlook and got the error: auth: Info: ntlm(?,192.168.0.58,<qd9nulmB4sLAqAA6>): ntlm_auth reports broken helper: NT_STATUS_UNSUCCESSFUL After more searching I came across this post, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774263 which, in summary, said that ntlm_auth had to run as root. So, I added the following to my dovecot config per that post's suggestion: service auth { user = root } After restarting and trying again to connect from Outlook I got the message: auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY At this point I've been unable to find a solution to this error. I've listed the entire dovecot log output for this last attempt to connect from Outlook below. Has anyone in the Universe successfully connected from Outlook using active domain credentials? If so, what's the secret? What am I not doing correctly? Thanks for any and all help! --Mark dovecot log: Feb 07 23:39:40 auth: Debug: Loading modules from directory: /usr/local/lib/dovecot/auth Feb 07 23:39:40 auth: Debug: Module loaded: /usr/local/lib/dovecot/auth/lib20_auth_var_expand_crypt.so Feb 07 23:39:40 auth: Debug: Read auth token secret from /usr/local/var/run/dovecot/auth-token-secret.dat Feb 07 23:39:40 auth: Debug: auth client connected (pid=16357) Feb 07 23:39:40 auth: Debug: client in: AUTH 1 NTLM service=imap session=SCINjFqBKcXAqAA6 lip=192.168.0.2 rip=192.168.0.58 lport=143 rport=50473 Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw== (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 TlRMTVNTUAACAAAACAAIADgAAAAFgomifTyOI3AwfogAAAAAAAAAAGIAYgBAAAAABgEAAAAAAA9IAFAAUgBTAAIACABIAFAAUgBTAAEACABNAEEASQBMAAQAFABoAHAAcgBzAC4AbABvAGMAYQBsAAMAHgBtAGEAaQBsAC4AaABwAHIAcwAuAGwAbwBjAGEAbAAHAAgAVIrLTWi/1AEAAAAA Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAADAAAAGAAYAGwAAAD8APwAhAAAAAAAAABYAAAACAAIAFgAAAAMAAwAYAAAAAAAAACAAQAABYKIogYBsR0AAAAPEulY2h+wL/nnNAXbmMSVx20AYQByAGsAQwBPAE0ATQBPAE4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5+rNhVU1odt5650z/pNVpQEBAAAAAAAAVIrLTWi/1AFg5+W08PtmxQAAAAACAAgASABQAFIAUwABAAgATQBBAEkATAAEABQAaABwAHIAcwAuAGwAbwBjAGEAbAADAB4AbQBhAGkAbAAuAGgAcAByAHMALgBsAG8AYwBhAGwABwAIAFSKy01ov9QBBgAEAAIAAAAIADAAMAAAAAAAAAABAAAAACAAAOity40ZG1J9BpqGn4TwBjP02UByQ6D/OUD6DrRDhg+3CgAQAAAAAAAAAAAAAAAAAAAAAAAJABIAaQBtAGEAcAAvAG0AYQBpAGwAAAAAAAAAAAAAAAAA (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY Feb 07 23:39:42 auth: Debug: client passdb out: FAIL 1
Is it possible that no one on this list is authenticating Outlook with Dovecot and NTLM? --Mark -----Original Message----- Date: Fri, 08 Feb 2019 00:51:01 -0500 To: dovecot at dovecot.org Subject: Re: Need to authenticate Outlook and NTLM From: Mark Foley via dovecot <dovecot at dovecot.org> More on this ... I short-sheeted ntlm_auth to see what was being passed to it. It is getting as arg1: --helper-protocol=squid-2.5-ntlmssp I tried running ntlm_auth at the command line as: ntlm_auth --username=user --password=password --helper-protocol=squid-2.5-ntlmssp It did nothing, just hung there. The ntlm_auth man page says: --helper-protocol=PROTO Operate as a stdio-based helper. Valid helper protocols are: squid-2.5-ntlmssp Server-side helper for use with Squid 2.5's NTLMSSP authentication. Requires access to the directory winbindd_privileged in $LOCKDIR. The protocol used is described here: http://devel.squid-cache.org/ntlm/squid_helper_protocol.html. This protocol has been extended to allow the NTLMSSP Negotiate packet to be included as an argument to the YR command. (Thus avoiding loss of information in the protocol exchange). Squid NTLM authentication? As far as I know, I don't have Squid. If I leave off the --helper-protocol bit on the ntlm_auth command line, it returns an OK status. Is there a way to NOT pass "--helper-protocol=squid-2.5-ntlmssp"? Would this help? --Mark -----Original Message----- Date: Fri, 08 Feb 2019 00:19:19 -0500 Organization: Ohio Highway Patrol Retirement System To: dovecot at dovecot.org Subject: Need to authenticate Outlook and NTLM I've posted questions on this before, but now I really, really need a solution. Using Dovecot 2.2.33.2 We've been using Dovecot as IMAP server for several years on a Linux host which is also the Active Directory / Domain Controller. We have both Thunderbird and Outlook clients. The Thunderbird clients authenticate w/o problem with AD credentials using Kerberos/GSSAPI. I've never been able to get the Outlook clients to authenticate using domain credentials, so I've also hard-coded user and password into /etc/passwd and let the Dovecot authenticate via PLAIN LOGIN. Now, however, I am mandated to switch all users to Outlook, so I need an AD credential solution. I found https://wiki2.dovecot.org/HowTo/ActiveDirectoryNtlm and followed those instructions. The first problem I ran into was in Step 3 where it said to put the following line in the config: auth_ntlm_use_winbind = yes This gave me an error when I restarted Dovecot: Restarting Dovecotdoveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/10-auth.conf line 84: Unknown setting: auth_ntlm_use_winbind googling this error indicated that this was a version 1.x directive and 2.x used only auth_use_winbind. I removed the auth_ntlm_use_winbind and Dovecot restart. If this is true, the wiki should be updated since it purports to be a version 2.x wiki. I followed the rest of the instructions on that wiki and my modified config is: $ doveconf -n # 2.2.33.2 (d6601f4ec): /usr/local/etc/dovecot/dovecot.conf # OS: Linux 4.4.157 x86_64 Slackware 14.2 auth_debug = yes auth_debug_passwords = yes auth_gssapi_hostname = $ALL auth_krb5_keytab = /etc/dovecot/dovecot.keytab auth_mechanisms = plain login gssapi ntlm auth_use_winbind = yes auth_username_format = %n auth_verbose = yes auth_verbose_passwords = plain disable_plaintext_auth = no info_log_path = /var/log/dovecot_info mail_location = maildir:~/Maildir passdb { driver = shadow } protocols = imap ssl_cert = </etc/ssl/certs/OHPRS/GoDaddy/Apache/2016-08-10/54e789087d419b6e.crt ssl_key = # hidden, use -P to show it userdb { driver = passwd } verbose_ssl = yes New additions to my pre-ntlm conf is only the 'ntlm' added the the auth_mechanism and: auth_winbind_helper_path = /usr/bin/ntlm_auth which interestingly doesn't show into the 'doveconf -n' output, above. Is it a default? I then attempted to connect from Outlook and got the error: auth: Info: ntlm(?,192.168.0.58,<qd9nulmB4sLAqAA6>): ntlm_auth reports broken helper: NT_STATUS_UNSUCCESSFUL After more searching I came across this post, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774263 which, in summary, said that ntlm_auth had to run as root. So, I added the following to my dovecot config per that post's suggestion: service auth { user = root } After restarting and trying again to connect from Outlook I got the message: auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY At this point I've been unable to find a solution to this error. I've listed the entire dovecot log output for this last attempt to connect from Outlook below. Has anyone in the Universe successfully connected from Outlook using active domain credentials? If so, what's the secret? What am I not doing correctly? Thanks for any and all help! --Mark dovecot log: Feb 07 23:39:40 auth: Debug: Loading modules from directory: /usr/local/lib/dovecot/auth Feb 07 23:39:40 auth: Debug: Module loaded: /usr/local/lib/dovecot/auth/lib20_auth_var_expand_crypt.so Feb 07 23:39:40 auth: Debug: Read auth token secret from /usr/local/var/run/dovecot/auth-token-secret.dat Feb 07 23:39:40 auth: Debug: auth client connected (pid=16357) Feb 07 23:39:40 auth: Debug: client in: AUTH 1 NTLM service=imap session=SCINjFqBKcXAqAA6 lip=192.168.0.2 rip=192.168.0.58 lport=143 rport=50473 Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw== (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Debug: client passdb out: CONT 1 TlRMTVNTUAACAAAACAAIADgAAAAFgomifTyOI3AwfogAAAAAAAAAAGIAYgBAAAAABgEAAAAAAA9IAFAAUgBTAAIACABIAFAAUgBTAAEACABNAEEASQBMAAQAFABoAHAAcgBzAC4AbABvAGMAYQBsAAMAHgBtAGEAaQBsAC4AaABwAHIAcwAuAGwAbwBjAGEAbAAHAAgAVIrLTWi/1AEAAAAA Feb 07 23:39:40 auth: Debug: client in: CONT 1 TlRMTVNTUAADAAAAGAAYAGwAAAD8APwAhAAAAAAAAABYAAAACAAIAFgAAAAMAAwAYAAAAAAAAACAAQAABYKIogYBsR0AAAAPEulY2h+wL/nnNAXbmMSVx20AYQByAGsAQwBPAE0ATQBPAE4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5+rNhVU1odt5650z/pNVpQEBAAAAAAAAVIrLTWi/1AFg5+W08PtmxQAAAAACAAgASABQAFIAUwABAAgATQBBAEkATAAEABQAaABwAHIAcwAuAGwAbwBjAGEAbAADAB4AbQBhAGkAbAAuAGgAcAByAHMALgBsAG8AYwBhAGwABwAIAFSKy01ov9QBBgAEAAIAAAAIADAAMAAAAAAAAAABAAAAACAAAOity40ZG1J9BpqGn4TwBjP02UByQ6D/OUD6DrRDhg+3CgAQAAAAAAAAAAAAAAAAAAAAAAAJABIAaQBtAGEAcAAvAG0AYQBpAGwAAAAAAAAAAAAAAAAA (previous base64 data may contain sensitive data) Feb 07 23:39:40 auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY Feb 07 23:39:42 auth: Debug: client passdb out: FAIL 1
On Mon, 18 Feb 2019 10:17:16 -0000 Stuart Henderson wrote:> > On 2019-02-13, Mark Foley via dovecot <dovecot at dovecot.org> wrote: > > Is it possible that no one on this list is authenticating Outlook with Dovecot and NTLM? > > Yes, it's possible, the outdated instructions you found on the wiki > suggests it's an uncommon configiration.Hmmm, really? And yet Windows/Outlook is still the predominant email client out there (unfortunately). Maybe everyone is going to outlook.com?> No actual answers from me, but it might give you some clues: > > > More on this ... > > > > I short-sheeted ntlm_auth to see what was being passed to it. It is getting as arg1: > > > > --helper-protocol=squid-2.5-ntlmssp > > > > I tried running ntlm_auth at the command line as: > > > > ntlm_auth --username=user --password=password --helper-protocol=squid-2.5-ntlmssp > > > > It did nothing, just hung there. The ntlm_auth man page says: > > > > --helper-protocol=PROTO > > Operate as a stdio-based helper. Valid helper protocols are: > > The squid auth helpers are stdio-based, they run in a loop, reading from > stdin, checking authentication, and return results on stdout. This avoids both > passing sensitive data on the command line (visible to ps, at least briefly) > and the need to keep forking and initialising a new process. > > So it's normal that it would just sit waiting for input. > > Dovecot is just reusing the same protocol that squid uses.If --username and --password are passed on the command line, what is it waiting for on stdin? Normally, ntlm_auth, with id and pw passed on the command line prints, "NT_STATUS_OK: The operation completed successfully. (0x0)" to stdout. There is no further stdin input needed. Is there a way to disable the --helper-protocol in Dovecot?> > > After more searching I came across this post, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774263 > > which, in summary, said that ntlm_auth had to run as root. So, I added the following to my > > dovecot config per that post's suggestion: > > > > service auth { > > user = root > > } > > > > After restarting and trying again to connect from Outlook I got the message: > > > > auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY > > I don't know the full details of how samba/ntlm works, but this seems like > an error coming from the server you're attempting to authenticate against. > I think you should start debugging on the samba side - make sure tools > like wbinfo are working, if not then debug those with samba, then move > on to Dovecot after you have that working.Samba has been running for years (with updates) and everything like wbinfo works. Dovecot can authenticate with kerberos/GSSAPI, and other applications can authenticate with ntlm_auth. My suspicion here is that the "user not authenticated" problem is perhaps because dovecot cannot run the auth service as root? The dovecot user is dovenull, so why would it be permitted to run as root in any case? I think the problem is in invoking ntlm_auth. I tried simply returning zero from my "fake" ntlm_auth, but that didn't work. Not sure what Dovecot is expecting from ntlm_auth_helper. --Mark
On 19.2.2019 4.48, Mark Foley via dovecot wrote:> On Mon, 18 Feb 2019 10:17:16 -0000 Stuart Henderson wrote: >> On 2019-02-13, Mark Foley via dovecot <dovecot at dovecot.org> wrote: >>> Is it possible that no one on this list is authenticating Outlook with Dovecot and NTLM? >> Yes, it's possible, the outdated instructions you found on the wiki >> suggests it's an uncommon configiration. > Hmmm, really? And yet Windows/Outlook is still the predominant email client out there > (unfortunately). Maybe everyone is going to outlook.com? > >> No actual answers from me, but it might give you some clues: >> >>> More on this ... >>> >>> I short-sheeted ntlm_auth to see what was being passed to it. It is getting as arg1: >>> >>> --helper-protocol=squid-2.5-ntlmssp >>> >>> I tried running ntlm_auth at the command line as: >>> >>> ntlm_auth --username=user --password=password --helper-protocol=squid-2.5-ntlmssp >>> >>> It did nothing, just hung there. The ntlm_auth man page says: >>> >>> --helper-protocol=PROTO >>> Operate as a stdio-based helper. Valid helper protocols are: >> The squid auth helpers are stdio-based, they run in a loop, reading from >> stdin, checking authentication, and return results on stdout. This avoids both >> passing sensitive data on the command line (visible to ps, at least briefly) >> and the need to keep forking and initialising a new process. >> >> So it's normal that it would just sit waiting for input. >> >> Dovecot is just reusing the same protocol that squid uses. > If --username and --password are passed on the command line, what is it waiting for on stdin? > Normally, ntlm_auth, with id and pw passed on the command line prints, "NT_STATUS_OK: The > operation completed successfully. (0x0)" to stdout. There is no further stdin input needed. > > Is there a way to disable the --helper-protocol in Dovecot? > >>> After more searching I came across this post, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774263 >>> which, in summary, said that ntlm_auth had to run as root. So, I added the following to my >>> dovecot config per that post's suggestion: >>> >>> service auth { >>> user = root >>> } >>> >>> After restarting and trying again to connect from Outlook I got the message: >>> >>> auth: Info: ntlm(?,192.168.0.58,<SCINjFqBKcXAqAA6>): user not authenticated: NT_STATUS_NO_MEMORY >> I don't know the full details of how samba/ntlm works, but this seems like >> an error coming from the server you're attempting to authenticate against. >> I think you should start debugging on the samba side - make sure tools >> like wbinfo are working, if not then debug those with samba, then move >> on to Dovecot after you have that working. > Samba has been running for years (with updates) and everything like wbinfo works. Dovecot can > authenticate with kerberos/GSSAPI, and other applications can authenticate with ntlm_auth. My > suspicion here is that the "user not authenticated" problem is perhaps because dovecot cannot > run the auth service as root? The dovecot user is dovenull, so why would it be permitted to run > as root in any case? > > I think the problem is in invoking ntlm_auth. I tried simply returning zero from my "fake" > ntlm_auth, but that didn't work. Not sure what Dovecot is expecting from ntlm_auth_helper. > > --MarkHi, try service auth { ? user = root } Aki