<?xml version="1.0"?>

<!--
$Id: smtpauth-starttls.xml,v 1.2 2004/09/27 05:07:48 jmates Exp $

Copyright (c) 2001, 2002 by Jeremy Mates.  This material may be
distributed only subject to the terms and conditions set forth in the
Open Publication License, v1.0 or later (the latest version is
presently available at http://www.opencontent.org/openpub/).
-->

<!DOCTYPE eolas SYSTEM "http://sial.org/_xs/eolas/DTD">

<eolas xmlns:xlink="http://www.w3.org/1999/xlink">
	<summary>
		<title>SMTP AUTH and STARTTLS</title>
		<description>Presentation of the SMTP AUTH and STARTTLS email protocols and their application in the Sendmail Mail Transport Agent.</description>
		<author xlink:href="http://sial.org/contact/">
			<first-name>Jeremy</first-name><last-name>Mates</last-name>
		</author>
		<date>2002-01-10</date>
		<rights>Copyright 2001, 2002 Jeremy Mates. Distributed under the Open Publication License.</rights>
		<source xlink:href="http://sial.org/talks/smtpauth-starttls/"/>
		<version>$Id: smtpauth-starttls.xml,v 1.2 2004/09/27 05:07:48 jmates Exp $</version>
	</summary>

	<section>
		<title>SMTP AUTH and STARTTLS</title>
		<info>Standards-based protocols that add authentication and encryption to SMTP.</info>
		<list>
			<li>SMTP <rfc>821</rfc> (August 1982) - Simple Mail Transport Protocol.</li>
			<li>SMTP Service Extensions <rfc>1869</rfc> (November 1995).</li>
			<li>SMTP AUTH <rfc>2554</rfc> (March 1999) - Authentication for SMTP.</li>
			<li>STARTTLS <rfc>2487</rfc> (January 1999) - Secure SMTP over TLS.</li>
		</list>
	</section>

	<section>
		<title>Problems with SMTP</title>
		<list>
			<li>SMTP is an old protocol, written in a different age.</li>
			<li>Mail servers historically set to relay openly.</li>
			<li>Unsolicited email (spam) now a problem.</li>
		</list>
		<info>Need to support roaming users without becoming open relay.</info>
		<list>
			<li>In a secure manner.</li>
			<li>With minimum hassle client-side.</li>
		</list>
		<info>ESMTP allows extensions to solve such problems.</info>
	</section>

	<section>
		<title>“Users Good, Spammers Bad” — Solutions</title>
		<info>Various approaches, no best solution.</info>
		<list>
			<li>Require use of ISP’s local mail server.</li>
			<li>Allowing internal access.</li>
			<list>
				<li>Terminal mail via SSH (mutt, PINE).</li>
				<li>Web-based email solutions.</li>
			</list>
			<li>VPN - extending trusted network.</li>
			<list>
				<li>SSH port forwarding (<cmd>ssh -L 2525:localhost:25</cmd>).</li>
				<li>IPSec.</li>
			</list>
			<li>“<protocol><abbr>POP</abbr><name>Post Office Protocol</name></protocol> before SMTP,” for example via <link xlink:href="http://mail.cc.umanitoba.ca/drac/">DRAC</link>.</li>
			<li>SMTP AUTH (and/or STARTTLS).</li>
		</list>
	</section>

	<section>
		<title>SMTP AUTH</title>
		<list>
			<li>Extension of Simple Authentication and Security Layer (SASL) <rfc>2222</rfc>.</li>
			<li>Allows clients to authenticate with server.</li>
			<list>
				<li>Open relay rights to authorized users.</li>
				<li>Access to otherwise disabled services (e.g. <code>EXPN</code>, <code>VRFY</code>).</li>
			</list>
			<li>Implemented through <code>AUTH</code> keyword.</li>
		</list>
		<data>
			<shell prefix="$ ">telnet localhost 25</shell>
			<line>…</line>
			<line><input>EHLO localhost</input></line>
			<line>…</line>
			<line>250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN</line>
			<line><input>AUTH cram-md5</input></line>
			<line>334 SGVsbG8sIFdvcmxk…</line>
		</data>
	</section>

	<section>
		<title>SMTP AUTH - Mechanisms</title>
		<list>
			<li>Multiple <link xlink:href="http://www.iana.org/assignments/sasl-mechanisms">authentication mechanisms</link> are supported, of varied security.</li>
			<li>Mechanisms supported vary by implementation, configuration.</li>
			<list>
				<li><code>LOGIN</code>, <code>PLAIN</code> are common, but insecure (plaintext password on network).</li>
				<li><code>CRAM-MD5</code>, <code>DIGEST-MD5</code> more secure (can be harder to support).</li>
				<li><code>GSSAPI</code> (kerberos) and others have poorer support (especially on clients).</li>
			</list>
		</list>
	</section>

	<section>
		<title>STARTTLS</title>
		<list>
			<li>Mechanism for negotiating TLS <rfc>2246</rfc> over a SMTP connection.</li>
			<list>
				<li>TLS (essentially SSLv3) provides link authenticity, privacy.</li>
				<li>Uses X.509 Certificates <rfc>2459</rfc>.</li>
			</list>
			<li>Works over regular SMTP link via “upwards negotiation.”</li>
			<li>Implemented through <code>STARTTLS</code> keyword.</li>
		</list>
		<info>Also (disfavored) <code>smtps</code> protocol, equivalent of <code>https</code>— the <acronym><abbr>IESG</abbr><name>Internet Engineering Steering Group</name></acronym> recommends protocol designers to use upwards negotiation over alternate ports.</info>
	</section>

	<section>
		<title>STARTTLS - Bad News, Good News</title>
		<list>
			<li>Does not handle virtual hosts well.</li>
			<li>Slow (especially on the server side).</li>
			<li>Can be susceptible to man-in-the-middle attacks.</li>
			<li>Does not provide end-to-end confidentiality or message integrity.</li>
			<list>
				<li>That task is better met by PGP or S/MIME.</li>
			</list>
		</list>
		<list>
			<li>Good against passive attackers.</li>
			<li>Protects message envelope (PGP or S/MIME do not).</li>
		</list>
	</section>

	<section>
		<title>Mail Headers Showing TLS</title>
		<data>
			<line>Received: from mail.example.edu (IDENT:smmsp@mail.example.edu [10.0.0.11])</line>
			<line>    by example.org (8.12.1/8.12.1) with ESMTP id fBA0M7gU038106</line>
			<line>    <em>(using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified FAIL)</em></line>
			<line>    for &lt;user@example.org&gt;; Sun, 9 Dec 2001 16:22:10 -0800 (PST)</line>
			<line>Received: from grue.example.edu (sender@grue.example.edu [10.0.0.13])</line>
			<line>    <em>(authenticated bits=0)</em></line>
			<line>    by mail.example.edu (8.12.1/8.12.1) with ESMTP id fBA0M3rD003797</line>
			<line>    <em>(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)</em></line>
			<line>    for &lt;user@example.org&gt;; Sun, 9 Dec 2001 16:22:07 -0800</line>
			<line>Sender: sender@example.edu</line>
			<line>Message-ID: &lt;3C14002A.FAB442A3@example.edu&gt;</line>
			<line>Date: Sun, 09 Dec 2001 16:22:02 -0800</line>
			<line>From: Sender &lt;sender@example.edu&gt;</line>
			<line>To: user@example.org</line>
			<line>Subject: test</line>
		</data>
	</section>

	<section>
		<title>SMTP AUTH versus STARTTLS</title>
		<info>Some degree of overlap between the two standards.</info>
		<list>
			<li>Can authenticate TLS clients with certificates.</li>
			<li>Provisions in SASL to renegotiate to a secure link.</li>
		</list>
		<info>SMTP AUTH for users, STARTTLS for machines.</info>
		<list>
			<li>Users probably more comfortable with passwords.</li>
			<li>Could use TLS client certificates to authenticate machines.</li>
		</list>
		<warn>Determine your needs and requirements before implementation!</warn>
	</section>

	<section>
		<title>Small Workgroup Implementation</title>
		<list>
			<li>Need to support roaming users.</li>
			<li>Clients use common GUI MUAs (e.g. Netscape).</li>
			<li>Client setup should be easy as possible.</li>
			<li>Want to interoperate with existing accounts.</li>
			<li>Fast machines and few users, so TLS performance not an issue.</li>
		</list>
	</section>

	<section>
		<title>Design Overview</title>
		<list>
			<li>Use <man section="8">sendmail</man> as MTA on server side.</li>
			<list>
				<li><link xlink:href="http://cr.yp.to/surveys.html">Sendmail use widespread</link> on Internet.</li>
				<li>Has native support for SMTP AUTH, STARTTLS, <code>smtps</code>, etc.</li>
			</list>
			<li>Use <code>LOGIN</code>/<code>PLAIN</code> AUTH for client (and server) compatibility.</li>
			<li>STARTTLS with server certificate to protect passwords.</li>
			<li>Need <link xlink:href="http://directory.google.com/Top/Computers/Security/Public_Key_Infrastructure/PKIX/Tools_and_Services/Third_Party_Certificate_Authorities/">trusted third-party signed</link> TLS certificate.</li>
		</list>
	</section>

	<section>
		<title>Sendmail Protocol Support</title>
		<list>
			<li>SMTP AUTH first added in Sendmail 8.10 (<date>2000-03-01</date>).</li>
			<li>Uses <link xlink:href="http://asg.web.cmu.edu/sasl/">Cyrus SASL</link> authentication libraries.</li>
		</list>
		<list>
			<li>STARTTLS available in Sendmail 8.11 (<date>2000-07-19</date>).</li>
			<li>Uses <link xlink:href="http://www.openssl.org/">OpenSSL</link> to provide SSL/TLS services.</li>
		</list>
		<list>
			<li><link xlink:href="http://www.sendmail.org/8.12.0.html">Sendmail 8.12</link> improved support and features (<date>2001-09-08</date>).</li>
			<li>Support generally requires recompiling Sendmail.</li>
			<li>Vendor supplied Sendmail may have required features.</li>
		</list>
		<info>Use the following command to determine your sendmail version and compile features.</info>
		<data>
			<shell prefix="$ ">sendmail -d0 &lt; /dev/null</shell>
		</data>
	</section>

	<section>
		<title>OpenSSL Overview</title>
		<list>
			<li><link xlink:href="http://www.openssl.org/">OpenSSL homepage</link>, the <link xlink:href="ftp://ftp.openssl.org/source/">source code</link>, and <link xlink:href="http://sial.org/sendmail/doc/OpenSSL.txt">my config notes</link>.</li>
			<li>Strong entropy source mandatory (e.g. <file>/dev/urandom</file>).</li>
			<li>Typical <cmd>./config</cmd> installation.</li>
			<li>May be available as package/port for your system.</li>
		</list>
	</section>

	<section>
		<title>TLS Certificates</title>
		<list>
			<li>Need <link xlink:href="http://directory.google.com/Top/Computers/Security/Public_Key_Infrastructure/PKIX/Tools_and_Services/Third_Party_Certificate_Authorities/">Third Party Certificate Authority</link> signed certificate.</li>
			<li>Expensive, but client setup easier and generally more secure.</li>
			<li>“Common Name” must match <acronym><abbr>FQDN</abbr><name>Fully Qualified Domain Name</name></acronym> of the server.</li>
		</list>
		<data>
			<shell prefix="# ">openssl genrsa 1024 &gt; host.key</shell>
			<shell prefix="# ">chmod 400 host.key</shell>
			<shell prefix="# ">openssl req -new -key host.key > host.csr</shell>
			<line>…</line>
			<line>Common Name (eg, YOUR name) []:<input>mail.example.edu</input></line>
		</data>
		<info><file>host.key</file> and <file>host.cert</file> (from Certificate Authority) used later.</info>
		<info>Self-signed certificate or own Certificate Authority may be an alternative (but client support for custom certificates varies, and may be insecure).</info>
	</section>

	<section>
		<title>Compiling Cyrus SASL</title>
		<info>Sendmail uses cyrus sasl 1.5 at time of writing.</info>
		<list>
			<li><link xlink:href="http://asg.web.cmu.edu/sasl/">Cryus SASL homepage</link>, the <link xlink:href="http://asg.web.cmu.edu/sasl/sasl-library.html">source code</link>, and <link xlink:href="http://sial.org/sendmail/doc/cyrus-sasl.txt">my config notes</link>.</li>
			<li>Typical <cmd>./configure</cmd> installation.</li>
			<list>
				<li><code>--enable-login</code> - legacy support of <code>LOGIN</code>.</li>
				<li><code>--with-pwcheck</code> - optional daemon.</li>
			</list>
			<li>May need to fiddle with library file locations.</li>
			<li>May be available as package/port for your system.</li>
		</list>
	</section>

	<section>
		<title>Cyrus SASL Configuration</title>
		<info>Setup the <file>/usr/lib/sasl/Sendmail.conf</file> for Sendmail.</info>
		<list>
			<li>Specify a <code>pwcheck_method: method</code>.</li>
			<list>
				<li><code>passwd</code> - use system <man section="3">getpwent</man> interface.</li>
				<li><code>sasldb</code> - <file>/etc/sasldb</file>.</li>
				<li><code>pwcheck</code> - talk to <code>pwcheck</code> daemon.</li>
			</list>
			<li><link xlink:href="http://www.sendmail.org/~ca/email/cyrus/sysadmin.html">Check documentation</link> for more options.</li>
		</list>
		<info>Example <file>Sendmail.conf</file> from production Linux system:</info>
		<data>
			<shell prefix="$ ">cat /usr/lib/sasl/Sendmail.conf</shell>
			<line>pwcheck_method: shadow</line>
		</data>
	</section>

	<section>
		<title>SASL Database Setup (Optional)</title>
		<list>
			<li>Allows support for <code>DIGEST-MD5</code>, <code>CRAM-MD5</code> mechanisms.</li>
			<li>Not compatible with system accounts (uses <file>/etc/sasldb</file>).</li>
			<li>May require setting Sendmail's <code>GroupReadableSASLDBFile</code> parameter to the <code>DontBlameSendmail</code> option for compatibility with <link xlink:href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP</link>.</li>
			<li>Add users via <man section="8" xlink:href="http://www.FreeBSD.org/cgi/man.cgi?query=saslpasswd&amp;sektion=8&amp;manpath=Red+Hat+Linux%2Fi386+7.2&amp;format=html">saslpasswd</man> utility.</li>
			<data>
				<shell prefix="# ">saslpasswd -a Sendmail -c -u mail.example.org user</shell>
			</data>
			<li>May need to enable <code>PLAIN</code> support.</li>
			<data>
				<shell prefix="# ">echo "pwcheck_method: sasldb" &gt; /usr/lib/sasl/saslpasswd.conf</shell>
			</data>
		</list>
	</section>

	<section>
		<title>pwcheck Daemon (Optional)</title>
		<list>
			<li>Allows unprivileged Sendmail or Cyrus IMAP users access to system account data.</li>
			<li>Or an easy tie-in to custom accounts system (database, etc.).</li>
			<li>Only <code>LOGIN</code>, <code>PLAIN</code> mechanisms available.</li>
		</list>
		<list>
			<li>Run <cmd>pwcheck</cmd> daemon as super-user at startup.</li>
			<li><file>/var/pwcheck</file> should only be accessible by required users.</li>
			<li><code>pwcheck</code> creates socket under <file>/var/pwcheck</file>.</li>
		</list>
	</section>

	<section>
		<title>Sendmail 8.12 Compile Overview</title>
		<list>
			<li><link xlink:href="http://www.gnu.org/manual/m4/index.html"><man section="1">m4</man></link> macro files used to control <link xlink:href="ftp://ftp.sendmail.org/pub/sendmail/">source build</link>.</li>
			<li>Setup <link xlink:href="site.config.m4"><file>devtools/Site/site.config.m4</file></link> under source to modify build.</li>
		</list>
		<list>
			<li>Add <code>smmsp</code> user/group to system first!</li>
			<li><cmd>sh Build</cmd> and <cmd>sh Build install</cmd>.</li>
			<li>Copy source <file-glob>cf/*</file-glob> files to system location.</li>
			<li>Make sure resulting binary supports features you need.</li>
		</list>
		<data>
			<shell prefix="$ ">sendmail -d0.12 &lt; /dev/null</shell>
<line>Version 8.12.3</line>
<line> Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7</line>
<line>                NAMED_BIND NETINET NETUNIX NEWDB PIPELINING <em>SASL</em> SCANF <em>STARTTLS</em></line>
<line>                USERDB XDEBUG</line>
<line>…</line>
		</data>
	</section>

	<section>
		<title>Compile support for Cyrus SASL</title>
		<info>Add the following to your <file>site.config.m4</file>.</info>
		<data>
			<line>APPENDDEF(`confENVDEF', `-DSASL')</line>
			<line>APPENDDEF(`confLIBS', `-lsasl -lcrypt')</line>
			<line></line>
			<line><comment>dnl allows AUTH_OPTIONS to prevent LOGIN/PLAIN over non-TLS link</comment></line>
			<line>APPENDDEF(`confENVDEF', `-D_FFR_SASL_OPTS')</line>
			<line>define(`confAUTH_OPTIONS', `p')</line>
		</data>
		<warn>May need <link xlink:href="http://www.openldap.org/lists/openldap-bugs/200101/msg00079.html">Cyrus SASL defines (<code>-lcrypt</code></link>) above OpenSSL’s (<code>-lcrypto</code>) to prevent function name conflicts.</warn>
	</section>

	<section>
		<title>Compile support for OpenSSL</title>
		<info>Add the following to your <file>site.config.m4</file>.</info>
		<data>
			<line>APPENDDEF(`confENVDEF', `-DSTARTTLS')</line>
			<line>APPENDDEF(`confLIBS', `-lssl -lcrypto')</line>
			<line></line>
			<line>APPENDDEF(`confLIBDIRS', `-L/usr/local/ssl/lib')</line>
			<line>APPENDDEF(`confINCDIRS', `-I/usr/local/ssl/include')</line>
		</data>
	</section>

	<section>
		<title>Sendmail Config File Locations</title>
		<info>Files under <file>cf/</file> are used to help build <file>sendmail.cf</file>.</info>
		<list>
			<li><file>/usr/share/sendmail/conf</file> - Darwin (a.k.a. Mac OS X).</li>
			<li><file>/usr/share/sendmail</file> - OpenBSD.</li>
			<li><file>/usr/lib/sendmail-cf</file> - RedHat 6 (via sendmail-cf RPM).</li>
			<li><file>/usr/lib/mail</file> - Solaris.</li>
		</list>
		<list>
			<li>If unsure: <code>find / -name cf.m4 -print</code> or <code>locate cf.m4</code>.</li>
			<li>Or invent a site-local location (NFS share).</li>
		</list>
	</section>

	<section>
		<title>Sendmail 8.12 Runtime Changes</title>
		<info>Different due to non-suid operation; see <link xlink:href="http://www.sendmail.org/%7Eca/email/doc8.12/SECURITY"><file>sendmail/SECURITY</file></link> for details.</info>
		<list>
			<li>Modify startup flags, e.g. <file>/etc/rc.conf</file> on OpenBSD.</li>
			<data>
				<line>sendmail_flags="<em>-L sm-mta</em> -bd -q15m"</line>
			</data>
			<li>Cron job (<man section="5">crontab</man>) to clear <file>/var/spool/clientmqueue</file>.</li>
			<data>
				<line>*/30 * * * * /usr/sbin/sendmail -L sm-msp-queue -Ac -q</line>
			</data>
			<li>Need to build a <file>submit.cf</file> in addition to <file>sendmail.cf</file>.</li>
		</list>
	</section>

	<section>
		<title>Custom Mailer Compile Tips</title>
		<list>
			<li>Be sure to disable vendor supplied mailer.</li>
			<list>
				<li>Beware vendor “updates” that downgrade sendmail.</li>
				<li>Set <code>NO_SENDMAIL=true</code> and <code>NO_MAILWRAPPER=true</code> in FreeBSD’s <file>/etc/make.conf</file>.</li>
			</list>
			<li>Could modify/use system’s package/ports instead.</li>
			<list>
				<li>*BSD have ports for above utilities.</li>
				<li>Repackage RedHat RPMs with local changes.</li>
			</list>
		</list>
	</section>

	<section>
		<title>Sendmail Configuration Overview</title>
		<list>
			<li>Group all config files under <file>/etc/mail</file>.</li>
			<li>Use a <file>Makefile</file> to ease sendmail administration.</li>
			<li>Create <link xlink:href="http://sial.org/sendmail/">pre-bundled configurations</link> for easier setup.</li>
		</list>
		<list>
			<li>Use a <file>sendmail.mc</file> to build <file>sendmail.cf</file>.</li>
			<li><file>sendmail.mc</file> - set of <man section="1">m4</man> macro definitions.</li>
			<li>Simple macro definitions result in complex config file.</li>
			<data>
				<shell prefix="# ">m4 /usr/share/sendmail/m4/cf.m4 sendmail.mc > sendmail.cf</shell>
			</data>
			<li>Read <file>cf/README</file> under source for configuration details.</li>
		</list>
	</section>

	<section>
		<title>Configuration for STARTTLS</title>
		<info>Place following in <file>sendmail.mc</file>, rebuild <file>sendmail.cf</file>.</info>
		<data>
			<line>define(`CERT_DIR', `/etc/mail/certs')</line>
			<line>define(`confCACERT', `CERT_DIR/cacert.pem')</line>
			<line>define(`confCACERT_PATH', `CERT_DIR/CA')</line>
			<line></line>
			<line>define(`confSERVER_CERT', `CERT_DIR/host.cert')</line>
			<line>define(`confSERVER_KEY',  `CERT_DIR/host.key')</line>
			<line>define(`confCLIENT_CERT', `CERT_DIR/host.cert')</line>
			<line>define(`confCLIENT_KEY',  `CERT_DIR/host.key')</line>
		</data>
		<list>
			<li>Restrict permissions on <file>host.key</file>!</li>
			<li>Obtain <link xlink:href="ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports-stable/security/ca-roots/files/ca-root.crt">root certificates</link> (as <code>confCACERT</code>) to verify other systems.</li>
			<li>Or populate the <code>confCACERT_PATH</code> directory with the individual certificates:</li>
			<data>
				<shell prefix="# ">perl -ple 'select $fh; open $fh, "&gt;$prev.cert" if /^=+\s*$/;' <rbr/>-e '($prev = $_) =~ s/[^\w.-]/_/g' ca-root.crt</shell>
				<shell prefix="# ">for F in *.cert; do ln -s $F `openssl x509 -noout -hash &lt; $F`.0; done</shell>
			</data>
		</list>
	</section>

	<section>
		<title>STARTTLS Configuration Tips</title>
		<info>Disable client certificates if not using them:</info>
		<enum>
			<li>Place following into <file>/etc/mail/access</file> map.</li>
			<data>
				<line>Srv_Features:	V</line>
			</data>
			<li>Rebuild <file>access</file> map using <man section="8">makemap</man>.</li>
			<data>
				<shell prefix="# ">makemap hash access &lt; access</shell>
			</data>
		</enum>
		<info>Additionally, can disable TLS for client connections made by the server in access map:</info>
		<data>
			<line>Try_TLS:example.net	NO</line>
		</data>
	</section>

	<section>
		<title>Configuration for SMTP AUTH</title>
		<info>Place following in <file>sendmail.mc</file>, rebuild <file>sendmail.cf</file>.</info>
		<data>
			<line>define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')</line>
			<line>TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 PLAIN LOGIN')</line>
		</data>
		<list>
			<li><code>AuthMechanisms</code> specifies allowed SASL mechanisms.</li>
			<li><code>TrustAuthMech</code> opens relay for users authenticated with specified method.</li>
		</list>
		<info>Could also build custom rulesets for more control.</info>
	</section>

	<section>
		<title>SMTP AUTH Tips</title>
		<info>Custom <file>sendmail.mc</file> ruleset to only allow EXPN/VRFY to work for authenticated users:</info>
		<data>
			<line>LOCAL_CONFIG</line>
			<line>F{trusty}/etc/mail/trusted-domains</line>
			<line></line>
			<line>LOCAL_RULESETS</line>
			<line>Scheck_expn</line>
			<line>R$*			$@ $&gt;check_expn_and_vrfy $1</line>
			<line></line>
			<line>Scheck_vrfy</line>
			<line>R$*			$@ $&gt;check_expn_and_vrfy $1</line>
			<line></line>
			<line>Scheck_expn_and_vrfy</line>
			<line>R$*			$: &lt; $&amp;{client_name} &gt;</line>
			<line>R&lt; $={trusty} &gt;		$@ OK</line>
			<line>R&lt; $+ $={trusty} &gt;	$@ OK</line>
			<line>R$*			$: $&amp;{auth_type}</line>
			<line>R$={TrustAuthMech}	$@ OK</line>
			<line>R$*			$#error $@ 5.7.1 $: 550 EXPN/VRFY failed for $&amp;{client_name}</line>
		</data>
	</section>

	<section>
		<title>Client Setup Caveats</title>
		<info>Straightforward for common GUI clients, but test first.</info>
		<list>
			<li>Do not enable “Secure Password Authentication” (SPA) in Outlook.</li>
			<li>Eudora (5.1, Mac OS) requires same password for incoming, outgoing servers.</li>
			<li>Outlook Express (5, Mac OS) dislikes self-signed certificates.</li>
			<li>Netscape “If Possible” STARTTLS setting open to man-in-middle attack (especially if client certificates disabled).</li>
		</list>
	</section>

	<section>
		<title>Real World Issues - draconian ISPs</title>
		<info>Some ISPs are now blocking outbound SMTP connections to inhibit spread of Microsoft Malware (Sircam, Nimda).</info>
		<list>
			<li>Add following to your <file>site.config.m4</file>, recompile Sendmail to support <code>smtps</code>.</li>
			<data>
				<line>APPENDDEF(`confENVDEF', `-D_FFR_SMTP_SSL')</line>
				<line>DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')</line>
			</data>
			<li>Clients will need to connect via raw TLS to the <code>smtps</code> port (465).</li>
			<li>Could use <code>Port=2525</code> if ISP blocking ports &lt;1024.</li>
			<li>Some clients may not support alternate port and/or <code>smtps</code>.</li>
		</list>
	</section>
	
	<section>
		<title>Real World Issues - stunnel</title>
		<info><man section="1" xlink:href="http://www.stunnel.org/">stunnel</man> could be used to support clients with poor TLS support.</info>
		<list>
			<li>robust TLS wrapper program.</li>
			<li>good if have savvy clients, or you setup the client machines.</li>
		</list>
		<warn>Stunnel can <link xlink:href="http://marc.theaimsgroup.com/?l=stunnel-users&amp;m=100829897507672&amp;w=2">create an open relay</link> if used on the server side.</warn>
	</section>

	<section>
		<title>References and Related Material</title>
		<list>
			<li><link xlink:href="http://sial.org/sendmail/">Sendmail Configurations &amp; Documentation</link>.</li>
			<li><link xlink:href="http://blue-labs.org/clue/sendmail.php">Integrating Sendmail with SASL, TLS, and Postgres</link>.</li>
			<li><link xlink:href="http://www.gnutec.com/~amonk/writing/technical/howtos/obsd-sendmail+sasl.html">OpenBSD Sendmail + SMTP AUTH Mini-HOWTO</link>.</li>
			<li><link xlink:href="http://www.rtfm.com/sslbook/">SSL and TLS: Designing and Building Secure Systems</link>.</li>
		</list>
		<list>
			<li><link xlink:href="http://www.sendmail.org/~ca/email/roaming.html">Relay control in sendmail for roaming users</link>.</li>
			<li><link xlink:href="http://www.sendmail.org/~ca/email/auth.html">SMTP AUTH in sendmail</link>.</li>
			<li><link xlink:href="http://www.sendmail.org/~ca/email/starttls.html">SMTP STARTTLS in sendmail</link>.</li>
			<li><link xlink:href="http://www.sendmail.org/~ca/email/tricks.html">Tips and Tricks for sendmail Hackers</link>.</li>
		</list>
	</section>
</eolas>
