My mistake.  In my previous post, I cut/pasted the wrong log entry!

> From: Craig Forbes <[EMAIL PROTECTED]>
> Date: Fri, 07 Jan 2005 01:43:30 -0500
> To: m <[EMAIL PROTECTED]>, <[email protected]>
> Subject: Re: postfix+cyrus+tmda (more)
> 
> --On Friday, January 07, 2005 12:38 AM -0500 m <[EMAIL PROTECTED]> wrote:
> 
>> My apologies for continuing to post to the list -- I'm just trying to
>> finish a project.
>> 
>> Craig Forbes wrote to the list some time ago and stated:
>> 
>>> I have done this. Actually someone was asking about this a few weeks ago
>>> and I sent email with some information about how I did it -- it should
>>> be in the list archives.
>>> 
>>> To summarize:
>>> I added support in tmda for LMTP delivery
>>> I added support for passing values into tmda via the command line
>>> instead of environment variables.
>>> I created a "home" directory for each of my virtual users where tmda
>>> stores its per user files.
>>> I configured tmda and tmda-cgi to use these directories.
>> 
>> What I need to find is the documentation for passing values into tmda via
>> the command line.  I haven't found it in the list archives, and it does
>> not APPEAR to be in the lmtp patch he provided.  Not being a Python
>> programmer, I'm not quite sure what the patch does.
> 
> I had to modify TMDA to take parameters via the command line.  Unless I
> missed something TMDA expects the parameters to be passed via the command
> line.
> 
> Here is what I wrote to the list on December 21:
> 
> 
> I modified the tmda-filter script to take values, typically read from
> environment variables, via the command line.  I then defined a postfix
> service using "pipe" that I could then specify as a transport in postfixr
> and then used the per user transport map to redirect to TMDA.
> 
> from my postfix master.cf:
> tmda      unix  -       n       n       -       -       pipe flags=Rhu
> user=tmda:cyrus argv=/local/tmda/bin/tmda-filter -noenv
> /local/tmda/users/$user $user $sender $recipient $extension
> 
> Note the addition of the "-noenv" options and the 5 values passed via the
> command line. See below for the diffs to tmda-filter to use this.
> 
> I hope this helps.

Actually very helpful and enlightening.

However, now I get the following error:

<[EMAIL PROTECTED]> (expanded from
    <[EMAIL PROTECTED]>): Command died with
    status 1: "/usr/local/tmda-1.0.3/bin/tmda-filter". Command output:
    File "/usr/local/tmda-1.0.3/bin/tmda-filter", line 52
    if sys.argv[1] == '-noenv':     ^ SyntaxError: invalid syntax

I made the modifications you suggested in the diff.  I'm guessing this means
that something isn't quite right with my changes to tmda-filter (although it
does match your diffs below!), and its puking on it.

>  -Craig
> 
> 
> Here is the diff for tmda-filter:
> 
> ***************
> *** 47,56 ****
> --- 47,63 ----
>           sitedir = os.path.join(sys.prefix, 'lib',
> 'python'+sys.version[:3],
>                                  'site-packages', 'TMDA', 'pythonlib')
>           sys.path.insert(0, sitedir)
> 
>       program = sys.argv[0]
> +     if sys.argv[1] == '-noenv':
> +         sys.argv.pop(1)
> +         os.environ['HOME'] = sys.argv.pop(1)
> +         os.environ['USER'] = sys.argv.pop(1)
> +         os.environ['SENDER'] = sys.argv.pop(1)
> +         os.environ['RECIPIENT'] = sys.argv.pop(1)
> +         os.environ['EXT'] = sys.argv.pop(1)
>       execdir = os.path.dirname(os.path.abspath(program))
>       execfile(os.path.join(execdir, 'tmda-rfilter'))
> 
>   except KeyboardInterrupt:
>       pass
> 
> 
> 


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

Reply via email to