Recipe 1.6 Compiling sendmail with STARTTLS Support

Problem

sendmail must be specially compiled to support the STARTTLS extension.

Solution

Use the command sendmail -bt -d0.1 to check the sendmail compiler options. If the string STARTTLS appears in the "Compiled with:" list, there is no need to recompile sendmail. If sendmail was not compiled with STARTTLS support, edit the devtools/Site/site.config.m4 file to add STARTTLS to the compiler's -D flags and to add ssl and crypto to the -l flags used to select libraries for linking. See the following example:

 #  cd /usr/local/src/sendmail-8.12.9/devtools/Site  #  cat >> site.config.m4   APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')   APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto')   Ctrl-D  

Recompile, reinstall, and restart sendmail:

 #  cd /usr/local/src/sendmail-8.12.9  #  ./Build -c   ...many lines of output deleted...  #  ./Build install   ...many lines of output deleted...  #  kill -HUP `head -1 /var/run/sendmail.pid`  

Discussion

In the sample site.config.m4 file, the first APPENDDEF command adds -DSTARTTLS to the list of compiler options stored in the conf_sendmail_ENVDEF define. The second APPENDDEF command adds -lssl and -lcrypto to the list of libraries stored in the conf_sendmail_LIBS define.

Build is then used to recompile sendmail. The -c option on the Build command line ensures that Build detects the changes made to the site.config.m4 file. Build install is run to install the freshly compiled sendmail binary. The HUP signal is used to restart sendmail with the new binary.

After recompiling sendmail, rerunning sendmail with the -d0.1 option shows that STARTTLS is included in the "Compiled with:" list. sendmail can now be configured to offer STARTTLS as described in Chapter 8.

See Also

Recipe 1.2 to Recipe 1.5 provide further information on compiling sendmail. Additionally, Recipe 1.7 provides information on fixing a problem that may appear when recompiling sendmail to support STARTTLS . Chapter 8 covers STARTTLS configuration. The sendmail book covers compiling sendmail in Section 2.2 and STARTTLS in Section 10.10.



Sendmail Cookbook
sendmail Cookbook
ISBN: 0596004710
EAN: 2147483647
Year: 2005
Pages: 178
Authors: Craig Hunt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net