Home arrow Site Administration arrow Page 9 - Getting Started with Sendmail

1.6 Compiling sendmail with STARTTLS Support - Administration

If you want to build or customize a sendmail configuration, you need to know your way around the sendmail distribution. This article will help you find your way around the cf directory, which contains the configuration files. It was excerpted from chapter one of The Sendmail Cookbook, written by Craig Hunt (O'Reilly Media, 2004; ISBN: 0596004710).

  1. Getting Started with Sendmail
  2. The cf directory structure
  3. The cf/m4 directory
  4. 1.1 Downloading the Latest Release
  5. 1.2 Installing sendmail
  6. 1.3 Compiling sendmail to Use LDAP
  7. 1.4 Adding the regex Map Type to sendmail
  8. 1.5 Compiling sendmail with SASL Support
  9. 1.6 Compiling sendmail with STARTTLS Support
  10. 1.7 Compiling in STARTTLS File Paths
  11. 1.8 Building a sendmail Configuration
  12. 1.9 Testing a New Configuration
  13. 1.10 Logging sendmail
By: O'Reilly Media
Rating: starstarstarstarstar / 26
July 07, 2005

print this article




sendmail must be specially compiled to support the STARTTLS extension.


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')

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`


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

Recipes 1.2 to 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.

>>> More Site Administration Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: