Hi,
I understood the threat of inject and read man of bash about quoting...
Single quote makes the string to be treated as is, but double allows
substitution...
Now I changed to
SUBJECT=`/usr/bin/reformail -x Subject:`
SUBJECT=escape(${SUBJECT})
xfilter '/usr/bin/reformail -A"Subject: *****SPAM***** ${SUBJECT}"'
and it works like a charm :-)
ThanX alot Arno, Sam!
2008/3/1, Sam Varshavchik <[EMAIL PROTECTED]>:
> Vasiliy Kotikov writes:
>
> > I have search mailling list but could not find any solution how to
> > escape quotes and double-quotes...
> >
> > So there is not default way using maildrop and xfilter ?
>
>
> Yes, there is.
>
> You just need to understand the difference between " and '.
>
>
> >> > if ( $RETURNCODE == 0 )
> >> > {
> >> > SUBJECT=`/usr/bin/reformail -x Subject:`
> >> > xfilter "/usr/bin/reformail -A'Subject: *****SPAM*****
> ${SUBJECT}'"
> >> > }
>
>
> This should be changed to:
>
>
> xfilter '/usr/bin/reformail -A"Subject: *****SPAM***** ${SUBJECT}"'
>
>
> Just like the shell, maildrop expands variables only inside double-quoted
> literal strings. Single-quoted literal strings are not expanded. The above
> statement causes the following statement to be executed by the shell:
>
>
> /usr/bin/reformail -A"Subject: *****SPAM***** ${SUBJECT}"
>
>
> The shell receives all of maildrop's variables via the environment. The
> shell then safely does variable substitution inside the quoted string
> parameter.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> courier-users mailing list
> [email protected]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
>
>
>
--
Best Regards,
Vasiliy Kotikov
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users