Eric <[EMAIL PROTECTED]> writes:
> In my incoming filter, I'm trying to accomplish the following...
>
> 1. If $SENDER is found in ~/.tmda/lists/whitelist
> a. Accept the message, writing it to ./Maildir/
> b. Forward the message off to another address
>
> To do this, I have the following rule (this is one line in my
> filter, but broken here for formatting)....
>
> from-file -optional -autocdb ~/.tmda/lists/whitelist
> accept,deliver=&[EMAIL PROTECTED]
You can't do this with TMDA, currently. You're trying to use more
than one action ('accept' and 'deliver=&[EMAIL PROTECTED]') and neither
the filter parser nor the action processing code understands that yet.
> ParsingError: Filter contains parsing errors:
> /home/eric/.tmda/filters/incoming
> [line 10]: "to": garbage at end of line
>
> I'm using TMDA v0.68.
For many other reasons you should upgrade to the latest (0.84), but
unfortunately, that won't fix this particular problem.
> Also, one other question: when using TMDA, I noticed that calling
> it from ~/.qmail doesn't permit qmail to keep delivering messages
> to the next line in the .qmail file. I always thought qmail
> delivery was based on the success of the preceding action.
Processing of dot-qmail files is based on the return code of the
previous command. If the program returns 99, qmail considers that
successful but stops processing the dot-qmail file. If the program
returns 0, that is also success and qmail *does* continue processing.
(man qmail-command(8).)
> Shouldn't TMDA permit qmail to keep processing mail after it
> delivers successfully in the following sample?
It will, in certain cases....
> $ cat .qmail-bla
> |preline /usr/local/tmda/bin/tmda-filter
> &[EMAIL PROTECTED]
>
> In my tests, [EMAIL PROTECTED] will never get the mail as qmail
> exists after piping mail to tmda-filter.
tmda-filter returns 99 (see above) when you specify an explicit
delivery; that is, when you use the accept, deliver or ok actions (all
are equivalent) followed by an equal sign and a destination. If you
simply say 'accept' or 'deliver' or 'ok', without specifying a
destination, tmda-filter *won't* deliver the mail anywhere but *will*
exit with a 0 return code so that further lines in your dot-qmail
file(s) will be processed. For your example:
~/.tmda/filters/incoming:
from-file -optional -autocdb ~/.tmda/lists/whitelist accept
~/.qmail-bla:
| preline /usr/local/tmda/bin/tmda-filter
./Maildir/ # or whatever your inbox is called
&[EMAIL PROTECTED]
Once we have multiple actions in place, this won't be so complicated.
That's my problem and, unfortunately, I'm busy with real work right
now. I hope to get this coded in the next couple of weeks. We're
aiming to have the multiple action support before release 1.0.
Tim
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users