Add SASL Support to sendmail

To add support for the SASL libraries to sendmail, just add one of the following pairs of lines to your Build m4 file:

APPENDDEF(`confENVDEF', `-DSASL=1')                       ← V1
APPENDDEF(`conf_sendmail_LIBS', `-lsasl')                 ← V1
APPENDDEF(`confENVDEF', `-DSASL=2')                       ← V2
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')                ← V2

The first line causes SASL support to be included in the sendmail program.[88] The second line tells sendmail to use the V1 or V2 SASL library, respectively. If you installed the SASL library in the standard location as described in the previous section, these two additional Build lines might be all you need.

Now build sendmail as usual. If you get the following error (or something similar):

sendmail.h:127: sasl.h: No such file or directory

you will have to add a line that looks something like the following to your Build m4 file:

APPENDDEF(`confINCDIRS', `-I/disk/3/packages/sasl/include')
                             ↑
        the path to where the SASL include files are located

Another possible problem might be that the SASL library cannot be found. In that instance, an error message such as the following might appear:

ld: cannot open -lsasl: No such file or directory

To correct this problem, simply add the following line to your Build m4 file:[89]

APPENDDEF(`confLIBDIRS', `-L/disk/3/packages/sasl/lib')
                             ↑
           the path to where the SASL library is located

But be careful about where you locate this library. The SASL library is a shared library and as such is subject to security restrictions. When sendmail runs, ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.