Hi Tim,

Thanks for the hints. Sorry it's taken me nearly a month to get back to you.
The enormity of the task put TMDA onto the backburner for a bit, but after
banging on it for most of the day today I was able to get a very basic TMDA
configuration working with XAMS. I don't think I could have gotten as far as
I did without your helpful suggestions.

>> I had seen the docs that describe a server-wide setup using Exim 4...
>> 
>> http://mla.libertine.org/tmda-users/2002-11/msg00283.html
>> 
>> ...but wasn't sure if such a configuration would allow individual
>> users to turn TMDA on/off.  Given a server-wide TMDA installation,
>> is there a way to turn off TMDA via the ~/tmda/config file?
> 
> There are a couple possibilities here.  First, perhaps Exim offers a
> way to selectively configure the execution of TMDA per-user.  Second,
> it's possible, with a bit of finagling, to configure TMDA as a "null"
> filter.  In other words, you can set it not to confirm; to accept all
> mail and simply deliver it.

This may be the best way, in the interim, to turn TMDA off for certain
users. I searched the list archives, but I couldn't find any info on how
this might be accomplished. Any suggestions?
 
>> If so, perhaps we can get the 2nd Exim process to pass both
>> _SITENAME_ and _USERNAME_ as environment variables to TMDA with a
>> slightly modified tmda_pipe command:
>> 
>> 
>> command = /usr/bin/tmda-filter -c /var/mail/$SITENAME/$USERNAME/tmda/config

It turns out that the correct command in our case is:

command = /usr/local/tmda/bin/tmda-filter -c \
/var/mail/tmda/${extract{sitename}{$address_data}}/$local_part/config
 
> This could be useful in either case above.
> 
>> Assuming we get the mail to TMDA somehow, how can we get the mail
>> delivered? For example, one of the options is listed as:
>> 
>> 
>> DELIVERY = "/var/mail/$local_part"
> 
> I'm not sure where you found this example of DELIVERY.  The above
> syntax won't work, as given.  Perhaps whoever suggested this is using
> '$local_part' as a placeholder.

$local_part, it turns out, is an Exim variable. It would be great if we
could somehow pass this information to TMDA, but it hasn't worked so far.
For example:

  command = /usr/bin/python2.2 /usr/local/tmda/bin/tmda-filter \
              -S /usr/local/tmda/bin/getpath.pl \
              ${extract{sitename}{$address_data}} $local_part

...doesn't set the HOME environment variable to the MailDir as the -S flag
is supposed to do. I'm not sure why this doesn't work, particularly since it
works with the -c option. But moving from a global to a local TMDA set-up at
least gets around this problem for the moment. Each user now just has the
requisite values hard-coded into their individual config files:

DELIVERY = "/var/mail/MySiteName/MyUserName/"

> Assume for the moment that _SITENAME_
> and _USERNAME_ are in the environment set up by Exim when tmda-filter
> executes.  Here's how you could set TMDA's DELIVERY variable.
> 
> import os  # this line should be a standard part of the config file
> site = os.environ['_SITENAME_']
> user = os.environ['_USERNAME_']
> DELIVERY = os.path.join('/var/mail', site, user)
> 
> This sets DELIVERY's value to '/var/mail/${_SITENAME_}/${_USERNAME_},
> in shell syntax; /var/mail/catseye.net/tim, to use me as an example.

This would work well if we didn't have virtual users, but that's what XAMS
is for. All of the user data is stored in a MySQL database, so I don't
believe the os.environ[] calls will work in an XAMS environment. I had hoped
that the -S option to tmda-filter would pass on these variables, but it
doesn't seem to be working. If I call it with the -S command above and then
set DELIVERY = "~/" then it just responds with "DeliveryError: not a
Maildir! (/)"

It's taken me a while, but I've finally begun to wrap my mind around how
TMDA works in its most basic incarnation, and how to get it working with
Exim in a virtual user environment (i.e., XAMS). I've still got a lot of
work left to do on this, but I'm happy to at least have the basic
infrastructure working. Thanks again for your help, Tim!  =)

Cheers,

Justin

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to