"Justin Mayer" <[EMAIL PROTECTED]> writes:

> ...the XAMS maildir path instead looks like...
> 
> /var/mail/_SITENAME_/_USERNAME_/(new,cur,tmp)/(actual message files)

Good.  That makes sense.

> >The actual maildir directory (the top-level one) can be anywhere in a
> >directory hierarchy, so your _USERNAME_ would be a perfectly valid
> >maildir name as long as it had new, cur and tmp subdirectories.
> 
> So, theoretically, the .tmda directory could be stored at...
> 
> /var/mail/_SITENAME_/_USERNAME_/tmda/
> 
> ...alongside the (new,cur,tmp) directories.

Sure.  Or anywhere else that's convenient... Another example:

/var/mail/_SITENAME/tmda/_USERNAME_/

so all of the TMDA configuration is in a single directory, tmda/, with
individual users' directories beneath that.  Whatever works best for
your setup and makes administration easy for you.

> >All paths can be customized in the config file.  The bootstrap problem
> >is finding the config file, which TMDA (by default) assumes is in
> >~/.tmda.  However, you can tell it to look elsewhere by giving the "-c
> ><path_to_config_file>" switch to tmda-filter.  If _SITENAME_ is the
> >actual domain name, like 'example.com' and Exim can give that to you
> >in an environment variable, then you could run tmda-filter with a
> >per-site config file from a .forward file like this:
> >
> >| tmda-filter -c /private/var/mail/tmda/$SITENAME/config
> 
> Excellent. Just so I understand, does this describe a set-up in which
> individual users can configure TMDA's behavior? Is the idea that users
> would override the site-wide setup by editing their preferences in:
> 
> 
> /var/mail/_SITENAME_/_USERNAME_/tmda/config

Just to make sure I'm communicating, what you suggest above would work
fine, but would be *instead* of the per-site configuration, not in
addition to it.  TMDA reads two configuration files.  The first is a
global file, always in /etc/tmdarc.  It is always read when TMDA
runs.  The second is per-user and would be what you've suggested.

Because the configuration file is Python code and is actually executed
as Python code, it's flexible enough that you could create a per-site
version of the file that configured itself at runtime with certain
per-user data.  That possibility was the basis of the example I gave
above.  Per-user files rather than per-site would undoubtedly be
easier to understand the first time around and may make for easier
management.

> >Folks who run TMDA with Exim have also figured out how to run it
> >directly from Exim without requiring a .forward file.  You'll want to
> >check the archives and the FAQ.
> 
> 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.

> 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

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.  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.

> Or, alternatively, should we just create individual files containing
> "DELIVERY = "/var/mail/mysite/myusername" for each user, which would
> be located at:
> 
> 
> /var/mail/mysite/myusername/tmda/config

This is also possible.  It's also probably the easiest to understand.
My preference is to configure this stuff as "globally" as possible, so
that you have fewer files to manage but shell scripts to add/remove
TMDA to/from a user's account can make the per-user configuration
easier to manage.

I recommend that you set up TMDA on a test account, not necessarily
through XAMS to start with, and play with some of the configuration.
You'll see how flexible the configuration is and can begin to
formulate a plan for integrating it with XAMS.


Tim

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

Reply via email to