"Greg Saylor" <[EMAIL PROTECTED]> writes:

> Is there anyway to make it pull "FULLNAME" from the "comment" field
> (vuserinfo -c [username]) of qmail instead?.... Or is this getting into
> the internals a bit too much to for a Python novice like myself?...

I assume you mean the comment field stored by vpopmail, since qmail
doesn't keep any information like that.  TMDA can't do that natively,
but you possibly could in the config file.

USERNAME = "[something]"
cmd = "/usr/local/vpopmail/bin/vuserinfo -c '%s'" % USERNAME
cmdfp = os.popen(cmd)
name = cmdfp.read().strip()
if cmdfp.close() is None:
    FULLNAME = name

The config file is Python source code, so the above code runs
'vuserinfo' and captures the output into a string.  It only sets
FULLNAME if there were no errors.  The problem is, what is USERNAME?
If you need to have a per-user config file to set USERNAME, then why
not just set FULLNAME at the same time?  There is code in TMDA to
attempt to figure out the virtual username from the recipient address,
but it's not callable at the time the config file is executed.

Another possibility might be to put the username into the environment
in the .qmail-<user> and .qmail-<user>-default files.  Something like
this (simplified for clarity, you'll probably want to specify full
paths to the applications):

| VUSER=gsaylor2 preline tmda-filter -S vpopmail-vdir.sh

The the first line of the code above becomes:

USERNAME = os.environ['VUSER']


Tim

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

Reply via email to