# Configure Cyrus SASL NTLM Plugin with Postfix

**URL:** <https://community.unix.com/t/configure-cyrus-sasl-ntlm-plugin-with-postfix/312451>\
**Category:** Shell Programming and Scripting\
**Created:** [June 25, 2012, 4:02am UTC](https://community.unix.com/t/configure-cyrus-sasl-ntlm-plugin-with-postfix/312451 "2012-06-25T04:02:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktor1985](https://community.unix.com/letter_avatar/viktor1985/32/6_449c533f586939b6e5f246632a46421f.png) [@viktor1985](https://community.unix.com/u/viktor1985)\
**Post date:** [June 25, 2012, 4:02am UTC](https://community.unix.com/t/configure-cyrus-sasl-ntlm-plugin-with-postfix/312451/1 "2012-06-25T04:02:54Z")

</div>

Hello

I hope somebody can help with this.

I have a shell, that in case of failure, sends an email (relaying through an Exchange Server). This Exchange server only offers NTLM authentication.

```nohighlight
250-AUTH NTLM

```

This is the configuration I have:

Postfix 2.1.1 as client.

Cyrus-SASL installed (without NTLM plugin):

```nohighlight
linux:/usr/local/sbin # rpm -q cyrus-sasl
cyrus-sasl-2.1.18-33.1

```

In main.cf

relayhost=172.168.240.129  
smtp\_sasl\_security\_options=  
smtp\_sasl\_auth\_enable=yes  
smtp\_sasl\_password\_maps=hash:/etc/postfix/sasl\_passwd

cat /etc/postfix/sasl\_passwd

172.168.240.129 myuser:mypass

As this version of cyrus-sasl 2.1.18 did not have the cyrus-sasl-ntlm plugin, I had to download the cyrus-sasl-2.1.25 and compile with --enable-ntlm option.

So I got installed ntlm plugin in /usr/local/lib/sasl2/

```nohighlight
rwxr-xr-x 1 root root 89921 Jun 24 22:55 libntlm.so.2.0.25
lrwxrwxrwx 1 root root 17 Jun 24 22:55 libntlm.so.2 -> libntlm.so.2.0.25
lrwxrwxrwx 1 root root 17 Jun 24 22:55 libntlm.so -> libntlm.so.2.0.25

```

But in test this error shows in maillog

warning: SASL authentication failure: No worthy mechs found  
send attr reason = delivery via 172.168.240.129[172.168.240.129]: Authentication failed: cannot SASL authenticate to server 172.168.240.129[172.168.240.129]: no mechanism available

Any ideas, suggestions to this would be very appreciated. (I've been dealing with this issue many days)

Thanks in advance !!

Victor

---

<div class="post-metadata">

**Author:** ![viktor1985](https://community.unix.com/letter_avatar/viktor1985/32/6_449c533f586939b6e5f246632a46421f.png) [@viktor1985](https://community.unix.com/u/viktor1985)\
**Post date:** [June 26, 2012, 7:18pm UTC](https://community.unix.com/t/configure-cyrus-sasl-ntlm-plugin-with-postfix/312451/2 "2012-06-26T19:18:44Z")

</div>

> [@viktor1985](#):
>
> Hello
> 
> I hope somebody can help with this.
> 
> I have a shell, that in case of failure, sends an email (relaying through an Exchange Server). This Exchange server only offers NTLM authentication.
> 
> ```plaintext
> 250-AUTH NTLM
> 
> ```
> 
> This is the configuration I have:
> 
> Postfix 2.1.1 as client.
> 
> Cyrus-SASL installed (without NTLM plugin):
> 
> ```plaintext
> linux:/usr/local/sbin # rpm -q cyrus-sasl
> cyrus-sasl-2.1.18-33.1
> 
> ```
> 
> In main.cf
> 
> relayhost=172.168.240.129  
> smtp\_sasl\_security\_options=  
> smtp\_sasl\_auth\_enable=yes  
> smtp\_sasl\_password\_maps=hash:/etc/postfix/sasl\_passwd
> 
> cat /etc/postfix/sasl\_passwd
> 
> 172.168.240.129 myuser:mypass
> 
> As this version of cyrus-sasl 2.1.18 did not have the cyrus-sasl-ntlm plugin, I had to download the cyrus-sasl-2.1.25 and compile with --enable-ntlm option.
> 
> So I got installed ntlm plugin in /usr/local/lib/sasl2/
> 
> ```plaintext
> rwxr-xr-x 1 root root 89921 Jun 24 22:55 libntlm.so.2.0.25
> lrwxrwxrwx 1 root root 17 Jun 24 22:55 libntlm.so.2 -> libntlm.so.2.0.25
> lrwxrwxrwx 1 root root 17 Jun 24 22:55 libntlm.so -> libntlm.so.2.0.25
> 
> ```
> 
> But in test this error shows in maillog
> 
> warning: SASL authentication failure: No worthy mechs found  
> send attr reason = delivery via 172.168.240.129[172.168.240.129]: Authentication failed: cannot SASL authenticate to server 172.168.240.129[172.168.240.129]: no mechanism available
> 
> Any ideas, suggestions to this would be very appreciated. (I've been dealing with this issue many days)
> 
> Thanks in advance !!
> 
> Victor

After so many days of research, I finally got it:

Hi:

I finally got it. Here are the steps:

Postfix 2.1.1  
Cyrus 2.1.25

1. install libtool2.4

```plaintext
./configure
make 
make install

```

1. install openssl-1.0.1c

```plaintext
./config shared
make
make test
make install

```

1. 

```plaintext
echo /usr/local/ssl/lib > /etc/ld.so.conf.d/openssl.conf
ldconfig

echo /usr/local/lib/sasl2 >> /etc/ld.so.conf
ldconfig

```

1. 

```plaintext
gzip -d cyrus-sasl-2.1.25.tar.gz
tar -xvf cyrus-sasl-2.1.25.tar
cd cyrus-sasl-2.1.25

export CPPFLAGS=-I/usr/local/ssl/include
export LDFLAGS=-L/usr/local/ssl/lib   

./configure --with-plugindir=/usr/local/lib/sasl2 --with-saslauthd=/var/run/saslauthd --disable-gssapi --disable-cram --disable-anon --disable-otp --disable-krb4 --disable-digest --disable-scram --enable-plain --enable-login --enable-ntlm
make 
make install

```

1. 

```plaintext
cp /usr/local/lib/sasl2/libntlm.la /usr/lib/sasl2/
cp /usr/local/lib/sasl2/libntlm.so.2.0.25 /usr/lib/sasl2/

cd /usr/lib/sasl2/

ln -s libntlm.so.2.0.25 libtnlm.so
ln -s libntlm.so.2.0.25 libtnlm.so.2

```

🙂  
Victor
