a command.
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.371 2006/07/07 13:54:32 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.372 2006/07/07 14:36:04 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/14 In the default configuration, change the use of "message" in ACL warn
statements to "add_header".
+PH/15 Diagnose a filter syntax error for "seen", "unseen", or "noerror" if not
+ not followed by a command (e.g. "seen endif").
+
Exim version 4.62
-----------------
-/* $Cambridge: exim/src/src/filter.c,v 1.10 2006/06/27 14:34:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filter.c,v 1.11 2006/07/07 14:36:04 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
case elif_command:
case else_command:
case endif_command:
+ if (seen_force || noerror_force)
+ {
+ *error_pointer = string_sprintf("\"seen\", \"unseen\", or \"noerror\" "
+ "near line %d is not followed by a command", line_number);
+ yield = FALSE;
+ }
+
if (expect_endif > 0)
had_else_endif = (command == elif_command)? had_elif :
(command == else_command)? had_else : had_endif;
case seen_command:
case unseen_command:
+ if (*ptr == 0)
+ {
+ *error_pointer = string_sprintf("\"seen\" or \"unseen\" "
+ "near line %d is not followed by a command", line_number);
+ yield = FALSE;
+ }
if (seen_force)
{
*error_pointer = string_sprintf("\"seen\" or \"unseen\" repeated "
/* So does noerror */
case noerror_command:
+ if (*ptr == 0)
+ {
+ *error_pointer = string_sprintf("\"noerror\" "
+ "near line %d is not followed by a command", line_number);
+ yield = FALSE;
+ }
noerror_force = TRUE;
was_noerror = TRUE;
break;
--- /dev/null
+#exim filter
+
+if one is one then seen endif
+
+if two is two then save /dev/null endif
--- /dev/null
+#exim filter
+
+unseen
# Check not prepend $home
exim -DFILTER_PREPEND_HOME=no_filter_prepend_home -bt prepend@test.ex
****
+# Check error for (un)seen and no command
+1
+exim -bf DIR/aux-fixed/TESTNUM.f-8 </dev/null
+****
+# Check error for (un)seen at eof
+1
+exim -bf DIR/aux-fixed/TESTNUM.f-9 </dev/null
+****
no_msglog_check
transport = appendfile
prepend@test.ex -> relative
transport = appendfile
+Warning: no message headers read
+Return-path copied from sender
+Sender = CALLER@test.ex
+Recipient = CALLER@test.ex
+Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-8"
+
+Filter error: "seen", "unseen", or "noerror" near line 5 is not followed by a command
+Warning: no message headers read
+Return-path copied from sender
+Sender = CALLER@test.ex
+Recipient = CALLER@test.ex
+Testing Exim filter file "TESTSUITE/aux-fixed/0037.f-9"
+
+Filter error: "seen" or "unseen" near line 4 is not followed by a command