|
TMDA Pre-Configuration
You may need to make some system-wide configuration changes to your
MTA software depending on which one you are running (in order of ease):
[ qmail/Courier | Postfix | Exim
| Sendmail ]
MTA Configuration (qmail and Courier)
No changes need to be made to your configuration in order to use TMDA.
MTA Configuration (Postfix)
- Enable the recipient_delimiter parameter in
Postfix's main.cf if it isn't already. The Postfix default is
+ but - is an acceptable value as
well. Just make sure it matches RECIPIENT_DELIMITER in your
tmda/config.
MTA Configuration (Exim)
Edit your Exim run time configuration file as follows:
MAIN CONFIGURATION
-
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
untrusted_set_sender = true to your Exim configuration
which allows untrusted users use of the -f command line option.
It is recommended that you enable this option or become a
trusted-user, or else the client side of TMDA becomes much less
functional.
DIRECTOR/ROUTER CONFIGURATION
-
TMDA is heavily based on user "extension addresses" (e.g,
username+extension@domain.dom), and your Exim must be able
to understand them. It doesn't by default. Both
+ and - are an acceptable
values for the suffix, just make sure it matches
RECIPIENT_DELIMITER in your tmda/config.
Add the following lines to both the userforward and
the localuser directors if they are not there already:
suffix = -*
# or "+*" if you prefer "user+suffix" addresses
suffix_optional
NOTE: If you are running Exim version 4.x,
use local_part_suffix
and local_part_suffix_optional instead.
You also might be interested in
these
Exim 4 specific instructions for a server-wide TMDA setup.
TRANSPORTS CONFIGURATION
-
TMDA receives much of its information about the envelope of
an incoming message from environment variables set by the MTA. Most
importantly, SENDER (the full envelope sender address),
RECIPIENT (the full envelope recipient address), and
EXT or EXTENSION (the recipient
address extension). Exim currently sets only the first, so you
must set the other two using the environment
pipe option.
-
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 return_path_add transport option.
Set return_path_add and environment as follows under
the address_pipe transport:
address_pipe:
driver = pipe
return_fail_output
return_path_add
environment = EXTENSION=${substr_1:$local_part_suffix}:\
RECIPIENT=$local_part$local_part_suffix@$domain
MTA Configuration (Sendmail)
TMDA receives much of its information about the envelope of
an incoming message from environment variables (usually set by the MTA). Most
importantly, SENDER (the full envelope sender address),
RECIPIENT (the full envelope recipient address), and
EXT or EXTENSION (the recipient
address extension).
The main difficulty with using TMDA under Sendmail, is that Sendmail does
not provide such variables as the other three supported MTAs do.
In fact, it does not provide any envelope information to commands run
from a .forward file. In order to be reliable, TMDA needs these
real sender and recipient values. It can't rely on what
might be in the To: or From: headers.
So in order to use TMDA, you need some way to obtain the necessary
envelope information and set the above mentioned 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. TMDA
expects these variables to be in the following format:
SENDER=sender@domain.dom
RECIPIENT=recipient@domain.dom
EXTENSION=foo
That is, just the e-mail address or recipient address extension, with no
trailing or leading whitespace, or any other extraneous characters.
If your Sendmail installation is using procmail
as its local mailer, the necessary information is passed as a command
line argument to procmail, typically introduced by the "-a" flag.
Your .procmailrc 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 in the
next section.
- Make sure procmail is installed on your server, and then add the
following rule to your sendmail.mc file if it is not
already present (most Linux distributions already define this!):
FEATURE(`local_procmail', `/usr/bin/procmail')
- Now run sendmail.mc through m4 to produce your new
sendmail.cf file, and restart Sendmail so the changes will take
effect.
|