After looking carefully at my current mail configuration (w/o TMDA), the best way to implement it is to pass variables to it from the MTA, and to construct all pathname references without using the environment variables for username/etc from the host -- I have no "real" users on the system.
How can I:
a.) change TMDA-filter to accept $sender $extension and $recipient as parameters from am MTA (i.e. Postfix as a mailbox delivery command)? Then I
You shouldn't need to do this. With postfix, sender and recipient should be picked up automatically.
extension is a config variable in TMDA (RECIPIENT_DELIMITER) which you already must configure yourself, if it isn't the default.
need to use those parameters to "point" TMDA to the right directories (i.e. /usr/tmda/$account) for config/pending/etc. -- there are no system users, but since I have a small user base, I can create all directories manually.
/etc/tmdarc is actually Python code. You can read the TMDA variables that store the above parameters and construct your paths using them. I'm afraid I don't know which module/variable-names TMDA uses for this, so you'll have to search the source...
b.) set tmda-ofmipd to pick up the sender from the login-name (for -R imap:xxx) authentication, and use the accountuser name to locate config files, etc (again, eg /usr/tmda/$account)?
Simplest way is to write your own virtual users script. Use the -S option to tmda-ofmipd to specify the location of your script. For example, on my old server, I used this:
======================================== #!/bin/sh
# Prints the virtual email user's home directory.
# Expects a virtual username and the virtual domain as parameters. # The username should be just the username portion and not the entire # email address, e.g., if the user usually logs in as # '[EMAIL PROTECTED]' or 'joe%example.com', this script should be run as # the vpopmail user and given the parameters 'joe' and 'example.com'. # # $ vpopmail-vdir.sh joe example.com
if [ -z "$2" ]; then
vuser="$1"
else
vuser="[EMAIL PROTECTED]"
fiif [ -z "$vuser" ]; then
echo /nonexistent
exit 1
ficat /var/qmail/users/poppasswd | grep "^$vuser" | cut -d: -f 4
exit 0 ========================================
If you use tmda-cgi, you'll need another script to give it more information. The location of this script gets specified when you configure/build tmda-cgi. For example, I used:
======================================== #!/bin/sh
# Prints the virtual email user's information.
# Expects a virtual username and the virtual domain as parameters. # The username should be just the username portion and not the entire # email address, e.g., if the user usually logs in as # '[EMAIL PROTECTED]' or 'joe%example.com', this script should be run as # the vpopmail user and given the parameters 'joe' and 'example.com'. # # $ vpopmail-vuserinfo.sh joe example.com
if [ -z "$2" ]; then
p_vuser="$1"
a_vuser_1=`echo "$p_vuser"|cut -d@ -f1`
a_vuser_2=`echo "$p_vuser"|cut -d@ -f2`
a_vuser="$a_vuser_2-$a_vuser_1"
else
p_vuser="[EMAIL PROTECTED]"
a_vuser="$2-$1"
fiif [ -z "$p_vuser" ]; then
echo /nonexistent
exit 1
fip_line=`grep "^$p_vuser" /var/qmail/users/poppasswd` #echo $p_vuser #echo $p_line
a_vuser=`echo "$a_vuser"|sed 's/[EMAIL PROTECTED]/-/g'` a_line=`grep "^[+=]$a_vuser" /var/qmail/users/assign` #echo $a_vuser #echo $a_line
echo -n dir: echo "$a_line" | cut -d: -f 5 echo -n uid: echo "$a_line" | cut -d: -f 3 echo -n gid: echo "$a_line" | cut -d: -f 4 echo -n gecos: echo "$p_line" | cut -d: -f 5 ========================================
If I recall, these are all based on samples in the source, or possibly from reading the relevant portions of the source to see what they needed...
-- Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO [EMAIL PROTECTED] http://www.wwwdotorg.org/pgp.html
signature.asc
Description: OpenPGP digital signature
_____________________________________________ tmda-users mailing list ([email protected]) http://tmda.net/lists/listinfo/tmda-users
