<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <!-- THIS PAGE IS AUTOMATICALLY GENERATED. DO NOT EDIT. --> <!-- Wed Mar 10 17:37:22 2004 --> <!-- USING HT2HTML 2.0 --> <!-- SEE http://ht2html.sf.net --> <!-- User-specified headers: Title: TMDA Pre-Configuration --> <head> <title>TMDA Pre-Configuration</title> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta name="generator" content="HT2HTML/2.0"> <style type="text/css"> body { margin: 0px; } </style> </head> <body bgcolor="#ffffff" text="#000000" marginwidth="0" marginheight="0" link="#0000bb" vlink="#551a8b" alink="#ff0000"> <!-- start of page table --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <!-- start of banner row --> <tr> <!-- start of corner cells --> <td width="150" valign="middle" bgcolor="#afeeee" class="corner"> <center><font size="+2" >>>> TMDA </font></center> </td> <td width="15" bgcolor="#cccccc"> </td><!--spacer--> <!-- end of corner cells --> <!-- start of banner --> <td width="90%" bgcolor="#cccccc" class="banner"> <!-- start of site links table --> <table width="100%" border="0" CELLSPACING=0 CELLPADDING=0 bgcolor="#ffffff"> <tr> <td bgcolor="#cccccc"> <a href="./index.html">Home</a> </td> <td bgcolor="#cccccc"> <a href="./trouble.html">Help</a> </td> <td bgcolor="#cccccc"> <a href="tmda-cgi">TMDA-CGI</a> </td> <td bgcolor="#cccccc"> <a href="http://sourceforge.net/projects/tmda">SourceForge</a> </td> </tr><tr> <td bgcolor="#cccccc"> [ <a href="http://www.au.tmda.net/" title="Australia Mirror">AU</a> | <a href="http://www.de.tmda.net/" title="Germany Mirror">DE</a> | <a href="http://www.it.tmda.net/" title="Italy Mirror">IT</a> | <a href="http://www.pl.tmda.net/" title="Poland Mirror">PL</a> | <a href="http://www.us.tmda.net/" title="USA Mirror">US</a> mirror ] </td> <td bgcolor="#cccccc"> <a href="http://tmda.net/faq.cgi">FAQ</a> </td> <td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/">Wiki</a> </td> <td bgcolor="#cccccc"> <a href="http://www.cafeshops.com/TMDA/">Store</a> </td> </tr> </table><!-- end of site links table --> </td><!-- end of banner --> </tr><!-- end of banner row --> <tr><!-- start of sidebar/body row --> <!-- start of sidebar cells --> <td width="150" valign="top" bgcolor="#cccccc" class="sidebar"> <!-- start of sidebar table --> <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#ffffff"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> About </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="index.html">Introduction</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="history.html">History</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="features.html">Features</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="challengeresponse.html">Challenge / Response</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="donations.html">Donations</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaAdvocacy">Advocacy</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> Install </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="requirements.html">Requirements</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="download.html">Download</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="install.html">Installation</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="upgrade.html">Upgrading</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> Configuration </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="config.html">Overview</a> </td></tr> <tr><td bgcolor="#cccccc"> <b>Pre-Config</b> </td></tr> <tr><td bgcolor="#cccccc"> <a href="config-server.html">Server Config</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="config-client.html">Client Config</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="config-vars.html">Config Variables</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="config-filter.html">Filter Spec</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="filter-sources.html">Filter Sources</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="howto-template.html">Templates</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="tmda-vdomains.html">Virtual Domains</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="tmda-ofmipd.html">tmda-ofmipd</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaHowtos">User HOWTOs</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> Support </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="trouble.html">Help</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://tmda.net/faq.cgi">FAQ</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaMailingListsAndNewsgroups">Lists & Newsgroups</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaMailingListArchives">List Archives</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaCommercialSupport">Commercial Support</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaDocumentation">External Docs</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/">TmdaWiki</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> Miscellaneous </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="http://wiki.tmda.net/index.cgi/TmdaMirrors">Mirrors</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="logos.html">Logos</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.cafeshops.com/TMDA/" TARGET="Resource Window">Merchandise</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#191970"><b><font color="#ffffff"> Contact </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="mailto:tmda-users@tmda.net">TMDA Users List</a> </td></tr> <tr><td bgcolor="#cccccc"> </td></tr> <tr><td bgcolor="#cccccc"> © 2001-2004 </td></tr> </table><!-- end of sidebar table --> </td> <td width="15"> </td><!--spacer--> <!-- end of sidebar cell --> <!-- start of body cell --> <td valign="top" width="90%" class="body"><br> <h3>TMDA Pre-Configuration</h3> <h4>MTA Configuration</h4> You may need to make some system-wide configuration changes to your MTA software depending on which one you are running. First read the <a href="#general">General Prerequisites</a> section, and then read the set of instructions corresponding to your MTA:<br> [ <A HREF="#qmail">qmail/Courier</a> | <A HREF="#postfix">Postfix</a> | <A HREF="#exim">Exim</a> | <A HREF="#sendmail">Sendmail</a> ] <br><br> <hr> <A name="general"><h4>General Prerequisites</h4></a> <u>Extension Addresses</u><br><br> TMDA is heavily based on user "extension addresses" (e.g, username+extension@yourdomain.dom), and your MTA must be able to understand them. Some of the supported MTAs do by default, others must be configured to do so.<br><br> The character that separates the username from the extension in an extension address is often called the "recipient delimiter". The most popular choices are <code><b>+</b></code> and <code><b>-</b></code>, although the <a href="http://tmda.net/faq.cgi?req=all#3.5" TARGET="Resource Window"> hyphen is recommended</a>. TMDA can support any recipient delimiter character though, just make sure you use the same character for your <b>RECIPIENT_DELIMITER</b> setting in <b>~/.tmda/config</b>.<br><br> <u>Environment Variables</u><br><br> TMDA receives much of its information about the envelope of an incoming message from environment variables set by the MTA. Most importantly, <strong>SENDER</strong> (the full envelope sender address), <strong>RECIPIENT</strong> (the full envelope recipient address), and <strong>EXT</strong> or <strong>EXTENSION</strong> (the recipient address extension). In order to be reliable, TMDA needs these <em>real</em> sender and recipient values. It can't rely on what might be in the To: or From: headers.<br><br> To use TMDA, you must make sure these variables are properly set by the time TMDA sees the message. TMDA expects these variables to be in the following format: <blockquote><pre> SENDER=sender@somedomain.dom RECIPIENT=recipient+foo@yourdomain.dom EXTENSION=foo </blockquote></pre> That is, just the e-mail address or recipient address extension, with no trailing or leading whitespace, or any other extraneous characters. As with extension addresses, some MTAs set these variables by default, others must be configured to do so.<br><br> <hr> <a name="qmail"><h4>MTA Configuration (qmail and Courier)</h4></a> No changes need to be made to your configuration in order to use TMDA. <br><br> <hr> <a name="postfix"><h4>MTA Configuration (Postfix)</h4></a> <ol> <li>Enable the <strong>recipient_delimiter</strong> parameter in Postfix's <em>main.cf</em> if it isn't already. Make sure the character you choose matches <b>RECIPIENT_DELIMITER</b> in your <b>~/.tmda/config</b>. </ol> <hr> <a name="exim"><h4>MTA Configuration (Exim)</h4></a> Edit your Exim run time configuration file as follows. Note: These instructions assume Exim 4.x. According to the Exim homepage, Exim 3 and previous versions are now considered obsolete. If you are running Exim 3 and can't upgrade, you'll have to find an old version of this page. <h5>MAIN CONFIGURATION</h5> <ol> <li> TMDA uses sendmail's `-f' option to set the envelope sender address on outgoing messages. By default this option is only available to Exim's "trusted users". You can also add <b>untrusted_set_sender = *</b> to your Exim configuration which allows untrusted users use of the -f command line option. <br><br> If you cannot set this option for some reason, a workaround is to set <strong>MAIL_TRANSPORT = "smtp"</strong> in your ~/.tmda/config, which will cause TMDA to send mail using direct SMTP instead of the sendmail command, thus bypassing this problem. </ol> <h5>DIRECTOR/ROUTER CONFIGURATION</h5> <ol> <li> Exim must be configured to understand extension addresses. Add the following lines to both the <b>userforward</b> and the <b>localuser</b> directors if they are not there already: <blockquote><pre> local_part_suffix = -* # or "+*" if you prefer "user+suffix" addresses local_part_suffix_optional </blockquote></pre> Make sure the character you choose matches <b>RECIPIENT_DELIMITER</b> in your <b>~/.tmda/config</b>.<br><br> You also might be interested in <a href="http://mla.libertine.org/tmda-users/2002-11/msg00283.html" TARGET="Resource Window">these</a> Exim specific instructions for a server-wide TMDA setup. </ol> <h5>TRANSPORTS CONFIGURATION</h5> <ol> <li> Exim only sets the <strong>SENDER</strong> and <strong>RECIPIENT</strong> environment variables by default. You must configure it to also set <strong>EXTENSION</strong> using the <em>environment</em> pipe option.<br><br> <li> You must also have Exim add a Return-Path: header to the message which it doesn't do by default. Do this by enabling the <em>return_path_add</em> transport option. <br><br> Set <em>return_path_add</em> and <em>environment</em> as follows under the <strong>address_pipe</strong> transport: <blockquote><pre> address_pipe: driver = pipe return_fail_output return_path_add environment = EXTENSION=${substr_1:$local_part_suffix} </blockquote></pre> </ol> <hr> <a name="sendmail"><h4>MTA Configuration (Sendmail)</h4></a> <u>Gripes</u> <ol> <li> The main difficulty with using TMDA under Sendmail, is that Sendmail does not set any of the required environment variables as the other supported MTAs do. In fact, as hard as this is to believe, Sendmail does not provide <b>any</b> envelope recipient information to commands run from a .forward file. In today's complex mail environments, full envelope information in user-space is essential to support advanced applications such as TMDA. It's not an accident why all the other supported MTAs do this; it's a good idea!<br><br> If you are stuck with Sendmail and find this deficiency as troubling as I do, you might consider sending a <a href="mailto:sendmail@sendmail.org">feature request</a> to the Sendmail developers asking that the full envelope information be made available to .forward invoked programs in the form of environment variables (<strong>SENDER</strong>, <strong>RECIPIENT</strong>, and <strong>EXTENSION</strong>). This should be done regardless of whether the Sendmail installation has procmail configured as its local mailer or not.<br><br> <li> Sendmail's default recipient delimiter is a plus (<code><b>+</b></code>) character, but unlike the other supported MTAs, Sendmail doesn't allow the administrator to change this default. You are stick with <code><b>+</b></code> even though this presents <a href="http://tmda.net/faq.cgi?req=all#3.5" TARGET="Resource Window"> problems</a> that other recipient delimiters such as <code><b>-</b></code> do not have. If you find this inflexibility troubling, consider sending a <a href="mailto:sendmail@sendmail.org">feature request</a> to the Sendmail developers asking that the recipient delimiter be made configurable. </ol> <u>Configuration</u><br><br> In order to use TMDA, you need some way to obtain the necessary envelope information and set the required environment variables. It matters not how you do this, just as long as these variables are properly set by the time TMDA sees the message. We provide example solutions below for sites with <a href="http://www.procmail.org/" TARGET="Resource Window">procmail</a> or <a href="http://www.flounder.net/~mrsam/maildrop/" TARGET="Resource Window">maildrop</a> configured as the local mailer. <br><br> <u>Procmail</u><br><br> If your Sendmail installation is using procmail as its local mailer, the necessary envelope information is passed as a command line argument to procmail, typically introduced by the "-a" flag. Your <b>.procmailrc</b> will then be able to construct the environment variables from this argument. The necessary Sendmail configuration changes are covered below, and a sample .procmailrc is given on the <a href="config-server.html">Server Configuration</a> page. <ol> <li>Make sure procmail is installed on your server, and then add the following rule to your <b>sendmail.mc</b> file if it is not already present (most Linux distributions already define this!): <blockquote><pre> FEATURE(`local_procmail', `/usr/bin/procmail') </blockquote></pre> <li>Now run <b>sendmail.mc</b> through <b>m4</b> to produce your new <b>sendmail.cf</b> file, and restart Sendmail so the changes will take effect. </ol> <u>Maildrop</u><br><br> If your Sendmail installation is using maildrop as its local mailer, the necessary envelope information is passed as command line arguments to maildrop. Your <b>.mailfilter</b> will then be able to construct the environment variables from these arguments. The necessary Sendmail configuration changes are covered below, and a sample .mailfilter is given on the <a href="config-server.html">Server Configuration</a> page. <ol> <li>Make sure maildrop is installed on your server, and then add the following rule to your <b>sendmail.mc</b> file if it is not already present: <blockquote><pre> FEATURE(local_procmail,`/usr/bin/maildrop',`maildrop -d $u $h $j $g') </blockquote></pre> <li>Now run <b>sendmail.mc</b> through <b>m4</b> to produce your new <b>sendmail.cf</b> file, and restart Sendmail so the changes will take effect.<br><br> <li>If for some reason any of your $ macros are not set properly please consult the Sendmail documentation. The example above was taken from a Redhat Linux 9 system. </ol> <hr> </td><!-- end of body cell --> </tr><!-- end of sidebar/body row --> </table><!-- end of page table --> </body></html>