Hi,
    with c code (win) I use a port of GetOptions posix function wich I guess
is Getopt::long in perl...
(http://www.perldoc.com/perl5.6.1/lib/Getopt/Long.html)

I just pass args like this:
    "/some/path/myfilter.exe -a -c -z -d=something --ciao -f20"
the order doesn't matter.

Hope it helps.

Ciao
Dario

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 28, 2004 11:15 PM
Subject: [xmail] XMail Filter @@MACROS


> Hi -
>
> I was wondering if there is any support in the xmail community
> for the following:
>
> I would like the way '@@macro' filter/auth/etc. arguments are parsed
> by xmail to be enhanced. Currently, for example, you may pass '@@macros'
> to filters as arguments by setting up the filter's .tab like:
>
> "/some/path/myfilter.pl" "@@RCPT" "@@FILE"
>
> and you get the recipient in the first argument ($ARGV[0] in perl),
> and the message file name in the second. Fine. However, xmail does no
> replacement if an argument specification contains more than the
> '@@macro'; for example:
>
> "/some/path/myfilter.pl" "rcpt=@@RCPT" "msg=@@FILE"
>
> gives your filter "rcpt=@@RCPT" and "msg=@@FILE", with no replacement. As
> I am getting older, sometimes, when I have three or four projects going
> on at once, I forget the order I specified int the .tab and all heck
> breaks loose. I know I always can do something like:
>
> "/some/path/myfilter.pl" "-r" "@@RCPT" "-m" "@@FILE"
>
> but then you end up with 4 arguments, and..., well..., darn it!, I just
> want something cooler!
>
> I think it would be neat to allow replacement anywhere in an argment,
> so you could write something like:
>
> "/some/path/myfilter.pl" "rcpt=@@RCPT&msg=@@FILE&from=@@FROM"
>
> and have the replacements done. Then, in this example, you could parse
> a single argument like a query string and be sure everything matches up
> ok. The possibilities are endless ;)
>
> I have made and tested such a patch. It is 100% backward compatible
> and actually simplifies some of the argument parsing as a benefit.
> It may be downloaded from:
>
> xmail.beaucox.com/xmail-1.19-pre07-macro-patch
>
> or from the "'@@macro' patch" nav bar entry at the page at:
>
> xmail.beaucox.com/
>
> Is anyone else interested it this scheme? Am I just being one of
> Davide's PITA people? Davide? Supporters? Detractors? Please let me know.
>
> I promise if I get voted down, I'll shut-up about it (I can hear Davide
> thinking: '...voted? Who said anything about xmail being a democracy?'
;) ).
>
> Aloha => Beau;
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe xmail" in
> the body of a message to [EMAIL PROTECTED]
> For general help: send the line "help" in the body of a message to
> [EMAIL PROTECTED]
>
>

-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to