<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>verifyfilter</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"/><link rel="home" href="#idm140142975497936" title="verifyfilter"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--

Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for distribution
information.

--></head><body><div class="refentry"><a id="idm140142975497936" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>verifyfilter, verifysmtp — Verify mail addresses</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">filterctl</code>  {[start] |  [stop]}  verifyfilter </p></div><div class="cmdsynopsis"><p><code class="command">verifysmtp</code>  {user@domain}</p></div></div><div class="refsect1"><a id="idm140142976974656" shape="rect"> </a><h2>DESCRIPTION</h2><p>
      This is a mail filter/tool combination that tries to determine the
      validity
      of E-mail addresses by attempting to contact the mail domain's mail
      server, and executing a <span class="command"><strong>RCPT TO</strong></span> command.
      There are three ways to use this tool.
    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
	  As a shell command, to test an E-mail address for deliverability.
	</p></li><li class="listitem"><p>
	  As a global mail filter.
	</p></li><li class="listitem"><p>
	  As a local recipient mail filter.
	</p></li></ul></div><p>
      <span class="command"><strong>verifyfilter</strong></span> is suitable for handling moderate
      amount of E-mail traffic. Address validation is
      expensive, requiring a DNS lookup and an outbound connection to a
      mail server for every validated address.
      <span class="command"><strong>verifyfilter</strong></span> goes through the same steps that
      the mail server does when sending mail, including enabling
      of encryption.
    </p><p>
      <span class="command"><strong>verifyfilter</strong></span> uses logging and caching, to avoid
      repeatedly validating the same return address when receiving multiple
      E-mails from the same sender; but its caching is rudimentary (a simple
      log file), and increased logging due to high E-mail traffic mail
      delivery may create large log files, impacting performance.
    </p><div class="refsect2"><a id="idm140142977020768" shape="rect"> </a><h3>The <span class="command"><strong>verifysmtp</strong></span> command</h3><div class="cmdsynopsis"><p><code class="command">@bindir@/verifysmtp</code>  {user@domain}</p></div><p>
	The <span class="command"><strong>verifysmtp</strong></span> command creates a network connection
	to
	<em class="replaceable"><code>domain</code></em>'s mail server, and checks if it
	considers the given E-mail address as valid.
	Two or more E-mail addresses can be given, and each E-mail address
	gets checked individually.
      </p><p>
	<span class="command"><strong>verifysmtp</strong></span> terminates with a zero exit code if
	all given E-mail addresses passed. A non-zero exit code indicates that
	one or more of the given addresses were rejected.
      </p></div><div class="refsect2"><a id="idm140142977014048" shape="rect"> </a><h3>The <span class="command"><strong>verifyfilter</strong></span> global mail filter</h3><div class="cmdsynopsis"><p><code class="command">filterctl</code>  {[start] |  [stop]}  verifyfilter </p></div><p>
	The <span class="command"><strong>verifyfilter</strong></span> global mail filter, if enabled,
	checks each message's return address. The E-mail message gets
	rejected if its return address's mail server rejects the return
	address. There's not much sense in accepting mail if its return
	address is undeliverable.
      </p><p>
	<span class="command"><strong>verifyfilter</strong></span> ignores messages from authenticated
	senders, and does not check their return addresses.
      </p></div><div class="refsect2"><a id="idm140142977141840" shape="rect"> </a><h3>Local recipient mail filter</h3><div class="informalexample"><pre class="programlisting" xml:space="preserve">
mkdir @sysconfdir@/maildroprcs
cp @datadir@/verifysender @sysconfdir@/maildroprcs
cp @datadir@/verifysenderfull @sysconfdir@/maildroprcs</pre><p>
	  In your <em class="replaceable"><code>$HOME</code></em>:
	</p><pre class="programlisting" xml:space="preserve">
mkdir $HOME/.trackdir</pre><p>
	  In <code class="filename">$HOME/.mailfilters/rcptfilter</code>:
	</p><pre class="programlisting" xml:space="preserve">
include '@sysconfdir@/maildroprcs/verifysender'</pre><p>
	  Or:
	</p><pre class="programlisting" xml:space="preserve">
include '@sysconfdir@/maildroprcs/verifysenderfull'</pre></div><p>
	This alternative provides comparable functionality as the global
	mail filter, but exposed via the
	<a class="ulink" href="localmailfilter.html" target="_top" shape="rect">
	  <span class="citerefentry"><span class="refentrytitle">localmailfilter</span>(7)</span>
	</a>
	API.
      </p><p>
	With maildrop, a protected wrapper filtering recipe gets installed into
	<code class="filename">@sysconfdir@/maildroprcs/verifysender</code>, which
	invokes <span class="command"><strong>verifysmtp</strong></span> via
	<span class="command"><strong>maildrop</strong></span>'s
	<span class="command"><strong>system</strong></span> command.
	The wrapper must be included in this manner, since
	<span class="command"><strong>maildrop</strong></span> normally does not allow the
	<span class="command"><strong>system</strong></span> command in the embedded execution mode that's
	used by the local mail filtering API.
      </p><p>
	The wrapper executes <span class="command"><strong>verifysmtp</strong></span> with a special
	argument, a single <span class="quote">“<span class="quote">.</span>”</span>. This is a special parameter that
	indicates that <span class="command"><strong>verifysmtp</strong></span> should read the
	E-mail address from the <code class="varname">SENDER</code> environment
	variable (avoiding issues with shell expansion, and script kiddies).
      </p><p>
	The
	<code class="filename">@sysconfdir@/maildroprcs/verifysender</code>
	wrapper can be suitably, perhaps optionally, included from either
	the <code class="filename">rcptfilter</code> or the
	<code class="filename">smtpfilter</code> script.
      </p></div><div class="refsect2"><a id="idm140142977115456" shape="rect"> </a><h3>Logging and caching</h3><p>
	<span class="command"><strong>verifyfilter</strong></span> caches the return address it checks.
	Once <span class="command"><strong>verifyfilter</strong></span> verifies that the return address
	is accepted by the sending domain's mail server, this is logged
	and additional E-mail with the same return address gets immediately
	accepted without contacting the sending domain's mail server to
	re-check the same address.
      </p><p>
	Successfully verified return addresses
	get cached for approximately 2-3 hours.
	If no other E-mail with the same address get received before the
	cache expires
	that return address gets rechecked the next time it is seen.
	If another E-mail with the same return address gets received,
	it is immediately accepted and the email address gets recached.
	Most mailing lists' bounce addresses should not cause excessive
	re-verification, provided a regular trickle of mailing list
	traffic. This includes mailing list that use per-message bounce
	addresses that follow the common VERP convention (Variable
	Envelope Return Path), see <span class="quote">“<span class="quote">FILES</span>”</span> below.
      </p><p>
	As becomes obvious after perusing the contents of the stock
	<code class="filename">verifysender</code> local mail filter,
	<span class="command"><strong>verifysmtp</strong></span>'s <code class="option">-t</code> gives the
	name of a scratch directory that <span class="command"><strong>verifysmtp</strong></span>
	uses for the cache. This directory should be set aside for
	<span class="command"><strong>verifysmtp</strong></span>, and not used for other purposes.
	The global mail filter shares the scratch directory together with
	other <span class="application">Courier</span> functions that work the
	same way.
      </p></div></div><div class="refsect1"><a id="idm140142977106528" shape="rect"> </a><h2>BUGS</h2><p>
      Just because a mail server accepted the
      <span class="command"><strong>RCPT TO</strong></span> it does not mean that the given E-mail
      address can ultimately receive E-mail.
    </p><p>
      When executed as a shell command or a local recipient mail filter the
      <span class="application">Courier</span> mail server's execution environment
      is not available, and <span class="command"><strong>verifysmtp</strong></span> will not be
      able to use
      <span class="application">Courier</span>'s configuration files, such as
      <code class="filename">smtproutes</code>
      and
      <code class="filename">authclient</code>,
      and several others.
      As such, <span class="command"><strong>verifysmtp</strong></span>'s behavior might differ from
      Courier's, when sending mail.
    </p></div><div class="refsect1"><a id="idm140142977099904" shape="rect"> </a><h2>FILES</h2><p>
<span class="command"><strong>verifyfilter</strong></span> uses the following configuration files. Changes to
the following files do not take effect until the filter has been stopped and
restarted.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">@sysconfdir@/filters/verifyfilter-mode</code></span></dt><dd><p>
If this file exists
and contains the word "all", <span class="command"><strong>verifyfilter</strong></span> will create its
socket in <code class="filename">@localstatedir@/allfilters</code>,
otherwise the socket will be
created in <code class="filename">@localstatedir@/filters</code>, see
<a class="ulink" href="courierfilter.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courierfilter</span>(8)</span></a>
for more information.</p></dd><dt><span class="term"><code class="filename">@sysconfdir@/filters/verifyfilter-logmode</code></span></dt><dd><p>
	    This file contains a single line, <span class="quote">“<span class="quote">base</span>”</span> or
	    <span class="quote">“<span class="quote">full</span>”</span>.
	    <span class="quote">“<span class="quote">full</span>”</span> verifies each return address, exactly as
	    given.
	    The default <span class="quote">“<span class="quote">base</span>”</span> value strips off any VERP
	    component of the sender's address, before comparing it. If the
	    local mailbox portion of the return address contains a dash,
	    the dash and the remaining portion of the return address gets
	    removed.
	  </p><p>
	    With the default <span class="quote">“<span class="quote">base</span>”</span> logging mode, once the
	    E-mail address <code class="literal">&lt;list-12@example.com&gt;</code>
	    gets verified, all further addresses like
	    <code class="literal">&lt;list-13@example.com&gt;</code> and
	    <code class="literal">&lt;list-foo-bar@example.com&gt;</code> are
	    considered as verified, but not
	    <code class="literal">&lt;anotherlist@example.com&gt;</code>.
	  </p></dd><dt><span class="term"><code class="filename">@sysconfdir@/filters/verifyfilter-nthreads</code></span></dt><dd><p>
This file
contains a single numerical value that sets the number of threads created
(one thread is used to check each email address). The default
number of threads is 10.</p></dd></dl></div></div><div class="refsect1"><a id="idm140142971774080" shape="rect"> </a><h2>SEE ALSO</h2><p>
      <a class="ulink" href="courierfilter.html" target="_top" shape="rect">
	<span class="citerefentry"><span class="refentrytitle">courierfilter</span>(8)</span>
      </a>, <a class="ulink" href="localmailfilter.html" target="_top" shape="rect">
	  <span class="citerefentry"><span class="refentrytitle">localmailfilter</span>(7)</span>
	</a>.</p></div></div></body></html>
