(unknown)
Janos Farkas <Janos.Farkas-lists+priv-#tgz3e.8xdhl/[email protected]>
| Newsgroups | gmane.comp.sysutils.bgware |
|---|---|
| Message-ID | <[email protected]> |
Hi! I planned a real insidious attack on the arriving spam, via the newly mailfront features. Unfortunately, I have found that the pattern matching doesn't work; it seems to match only the first line of the mail as a header, which is quite rare for most of the headers.. :) I tried to hack it in, that's the ascii attachment. I hope I got the logic right. I also tried to put it in the test suite, to check for the misbehavior I've been seeing. (Probably it would be nicer to add another test for this?) In trying the test suite, I got the feeling that I need to have an UID/GID 500, or as modified, make the test user use *my* ids. I also needed to run it via bash or zsh, as my sh was less capable for functions. But I digress. Do any of these look right? -- Janos | romfs is at http://romfs.sourceforge.net/ | Don't talk about silence.
mailfront_hdrpat.diff
(text/plain, 1.2 KB)
diff -urpN mailfront-0.94-1118256796/patterns.c mailfront-0.94/patterns.c
--- mailfront-0.94-1118256796/patterns.c 2005-06-02 06:30:06.000000000 +0000
+++ mailfront-0.94/patterns.c 2005-06-08 18:53:13.000000000 +0000
@@ -132,7 +132,7 @@ const response* patterns_check(const cha
if (linepos > 0) {
if ((r = check_line()) != 0)
return r;
- linemode = T_NORMAL;
+ if (linemode != T_HEADER) linemode = T_NORMAL;
}
else
linemode = T_AFTER_BLANK;
diff -urpN mailfront-0.94-1118256796/tests.sh mailfront-0.94/tests.sh
--- mailfront-0.94-1118256796/tests.sh 2005-06-02 06:30:06.000000000 +0000
+++ mailfront-0.94/tests.sh 2005-06-08 18:55:41.000000000 +0000
@@ -37,7 +37,7 @@ export PROTO TESTLOCALIP TESTREMOTEIP TE
CVM_PWFILE_PATH=$tmp/pwfile
export CVM_PWFILE_PATH
-echo testuser:testpass:500:500:Test User:$tmp:/bin/false >$CVM_PWFILE_PATH
+echo testuser:testpass:$_UID:$_GID:Test User:$tmp:/bin/false >$CVM_PWFILE_PATH
ln -s `which cvm-pwfile` $tmp/cvm
run_compare_test() {
@@ -355,14 +355,16 @@ END_OF_TEST_RESULTS
runtest() {
cat >$tmp/patterns <<EOF
-:header
+:header:*test*
EOF
PATTERNS=$tmp/patterns sfecho <<EOF
MAIL FROM:<>
RCPT TO:<nobody>
DATA
-header
+skip1:
+skip2:
+header: just testing
not