Chris Garrigues <[EMAIL PROTECTED]> writes:

> It appears that macro expansion can only be done in certain places.
> 
> This works:
> 
> macro FOLDER Housekeeping/test
> from-file -optional ~/Mail/Housekeeping/test/.whitelist               deliver
> 
> While this does not:
> 
> macro FOLDER Housekeeping/test
> from-file -optional ~/Mail/FOLDER/.whitelist          deliver

Congratulations!  You've found a bug!  I have a loop to expand macros
if they occur more than once on a line, but I've just discovered,
thanks to your report, that if the loop actually executes more than
once, any previous expansions get thoroughly and permanently bashed.

I'm looking at what I have to do to fix this.  Thanks for catching
this.

> Also, is there a way I can define my rcvstore macro globally so that
> I don't have to put the definition in each of my filters?

Well, right now, you can put your macro definitions in a separate file
and include it at the top of each of your filters.

That may not work in the future, though, because I'm currently in the
midst of rewriting the parser to allow filters to be "compiled" to
disk.  If an include rule uses a variable, ${SOMETHING}, in the name
of the include file, it can't be included during the compilation
phase; it can only be included when tmda-filter is actually attempting
to match incoming addresses, since the variable may have a completely
different value at that time than it had when the rule was compiled.
The upshot is that if you put macros in an include file, it may not
get read until long after the macros would have had any meaning.

I'm still thinking about how to deal with this.  I may introduce
another keyword to include files of macros during the parsing phase
rather than the match phase, something like macro-file.  That would
give us the best of both worlds, I think.

Anyhow, for now just use an include statement to load your macros and
we'll do our best to ensure the future changes are minimal.


Tim

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

Reply via email to