diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-02-07 10:34:24 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-02-07 10:34:24 +0000 |
commit | afda344b580b54a4513569720aec3260cd5ba546 (patch) | |
tree | 6318744c7d3f502ee72bcd20bab0f612c5dceacf /test/aux-var-src | |
parent | 9ba4af2b76958e076a0c002e53ead87ed7a47a68 (diff) |
More new test committing.
Diffstat (limited to 'test/aux-var-src')
37 files changed, 376 insertions, 0 deletions
diff --git a/test/aux-var-src/0002.wild b/test/aux-var-src/0002.wild new file mode 100644 index 000000000..826825725 --- /dev/null +++ b/test/aux-var-src/0002.wild @@ -0,0 +1,11 @@ +abc: abc +*.b.c: *.b.c +*b.c *b.c +# Comment +^X ^X +^x ^x +^Z ^Z +"^a +b" "^a +b" +^a\\.+b ^a\\.+b +\N^a\d+b \N^a\d+b +lsearch;DIR/aux-fixed/0002.quoted: lookup succeeded diff --git a/test/aux-var-src/0022.hosts b/test/aux-var-src/0022.hosts new file mode 100644 index 000000000..ed26da9cc --- /dev/null +++ b/test/aux-var-src/0022.hosts @@ -0,0 +1 @@ +V4NET.9.8.7: A host-specific message diff --git a/test/aux-var-src/0037.F b/test/aux-var-src/0037.F new file mode 100644 index 000000000..5ecbff702 --- /dev/null +++ b/test/aux-var-src/0037.F @@ -0,0 +1,58 @@ +# Exim filter + +if "${if def:h_test-headers:{yes}{no}}" is yes then + testprint ------------------------------------------------ + testprint $message_headers + testprint ------------------------------------------------ + headers remove test-headers:more-test-headers + headers add "added-header: this is added\nadded-header2: a second line" + testprint $message_headers + testprint ------------------------------------------------ +endif + +if $recipients matches deliverfromfilter then + deliver dff@test.ex + finish +endif + +testprint "message_size = $message_size" +testprint "message_body_size = $message_body_size" +testprint "body_linecount = $body_linecount" +testprint "message_body = $message_body" +testprint "message_body_end = $message_body_end" + +logfile DIR/spool/log/mainlog + +if first_delivery then + logwrite "$tod_log $message_id \"$h_subject:\" first delivery\n" +else + logwrite "$tod_log $message_id \"$h_subject:\" not first delivery\n" +endif + +if error_message then finish endif + +headers add "X-added: qualify_domain is $qualify_domain" +headers remove remove-this + +if $recipients does not match filter then + unseen deliver userz@$qualify_domain errors_to abcd@$qualify_domain +endif + +if $h_subject contains "fail this" then + fail text "subject was\t\"$h_subject:\" (filter fail)" +endif + +if $h_subject contains "defer this" then + defer text "subject was\t\"$h_subject:\" (filter defer)" +endif + +if $h_subject contains "freeze this" then + freeze "subject was \"$h_subject:\"\nHere are two extra\nlines of text" +else + +if $h_subject matches ^reply then + mail to $return_path + subject "An auto reply: qualify_domain=$qualify_domain" + text "This is a text line" +endif +endif diff --git a/test/aux-var-src/0037.f-7 b/test/aux-var-src/0037.f-7 new file mode 100644 index 000000000..6175c92b2 --- /dev/null +++ b/test/aux-var-src/0037.f-7 @@ -0,0 +1,22 @@ +# Exim filter + +testprint "Testing \ + <" + +testprint + ">${sg{\ + ${readfile{DIR/aux-fixed/abcd-xyz}{|}}\ + }\ + {\\N\\|(\\||\$)\\N}\ + {$1}\ + }<" + +if "something seven" matches + "${sg{\ + ${readfile{DIR/aux-fixed/abcd-xyz}{|}}\ + }\ + {\\N\\|(\\||\$)\\N}\ + {$1}\ + }" + +then testprint "yes" else testprint "no" endif diff --git a/test/aux-var-src/0037.f-readfile b/test/aux-var-src/0037.f-readfile new file mode 100644 index 000000000..80430b369 --- /dev/null +++ b/test/aux-var-src/0037.f-readfile @@ -0,0 +1,5 @@ +# Exim filter + +if error_message then finish endif + +if ${readfile{DIR/test-private}} is OK then finish endif diff --git a/test/aux-var-src/0037.f-user b/test/aux-var-src/0037.f-user new file mode 100644 index 000000000..cb2bd1e80 --- /dev/null +++ b/test/aux-var-src/0037.f-user @@ -0,0 +1,24 @@ +# Exim filter + +if $local_part is filter-pipe then + pipe "cat" +elif $local_part is filter-file then + save /tmp/junk +elif $local_part is filter-lookup then + deliver ${lookup{$local_part}lsearch{/etc/passwd}{$value}fail} +elif $local_part is filter-exists then + deliver "${if exists{/tmp/junk}{abc}{def}}" +elif $local_part is filter-stat then + deliver "${if eq{${stat:/tmp/junk}}{}{abc}{def}}" +elif $local_part is filter-readfile then + deliver ${readfile{/some/file}} +elif $local_part is filter-run then + deliver ${run{/some/script}} +elif $local_part is filter-vacation then + seen vacation text "this is vacation text" + file /dev/null + log /dev/null + once DIR/test-once +elif $local_part is filter-userx then + deliver userx +endif diff --git a/test/aux-var-src/0048.aliases b/test/aux-var-src/0048.aliases new file mode 100644 index 000000000..141af5fbb --- /dev/null +++ b/test/aux-var-src/0048.aliases @@ -0,0 +1 @@ +pipe: |DIR/aux-fixed/showenv diff --git a/test/aux-var-src/0060.d1 b/test/aux-var-src/0060.d1 new file mode 100644 index 000000000..2ae6a58d7 --- /dev/null +++ b/test/aux-var-src/0060.d1 @@ -0,0 +1 @@ +V4NET.255.0.3 diff --git a/test/aux-var-src/0060.d2 b/test/aux-var-src/0060.d2 new file mode 100644 index 000000000..09e7ee0e1 --- /dev/null +++ b/test/aux-var-src/0060.d2 @@ -0,0 +1 @@ +V4NET.255.0.4 diff --git a/test/aux-var-src/0066.hostnets b/test/aux-var-src/0066.hostnets new file mode 100644 index 000000000..9e90086b0 --- /dev/null +++ b/test/aux-var-src/0066.hostnets @@ -0,0 +1,6 @@ +1.2.3.4 +!1.2.3.0/24 +1.2.0.0/16 +net16-lsearch;DIR/aux-fixed/0066.nets +net24-lsearch;DIR/aux-fixed/0066.nets +*-1.test.ex diff --git a/test/aux-var-src/0071.aliases b/test/aux-var-src/0071.aliases new file mode 100644 index 000000000..141af5fbb --- /dev/null +++ b/test/aux-var-src/0071.aliases @@ -0,0 +1 @@ +pipe: |DIR/aux-fixed/showenv diff --git a/test/aux-var-src/0074.filter b/test/aux-var-src/0074.filter new file mode 100644 index 000000000..7d2b97319 --- /dev/null +++ b/test/aux-var-src/0074.filter @@ -0,0 +1,18 @@ +# Exim filter + +if error_message then finish endif + +if $h_x-nltest: is not "" then + mail to "userx,\n abey seedy <abcd>" text "Testing, testing" + finish +endif + +if $h_reply-to: is not "" then + mail text "To reply-to" + finish +endif + +mail + text "Auto reply to $h_subject:" + once DIR/test-mail/oncelog + once_repeat 4s diff --git a/test/aux-var-src/0079.filter b/test/aux-var-src/0079.filter new file mode 100644 index 000000000..09f48b0db --- /dev/null +++ b/test/aux-var-src/0079.filter @@ -0,0 +1,13 @@ +# Exim filter + +if error_message then finish + +elif $h_x-warning: contains "blacklist" +then +unseen save DIR/test-mail/rbl +endif + +if $h_sysmail: contains yes +then +mail to userx@exim.test.ex text "testing testing" +endif diff --git a/test/aux-var-src/0093.f-1 b/test/aux-var-src/0093.f-1 new file mode 100644 index 000000000..bc49c5701 --- /dev/null +++ b/test/aux-var-src/0093.f-1 @@ -0,0 +1,16 @@ +# Exim filter + +testprint "${if eq {1}{1}{yes}{no}}" +testprint "${if eq {1}{01}{yes}{no}}" +testprint "${if == {1}{01}{yes}{no}}" + +testprint +"${if eq {1}{1}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/junkjunk}{$value}{notfound}}}}" + +testprint +"${if eq {1}{1}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/0093.lsearch}{$value}{notfound}}}}" + +testprint +"${if eq {1}{0}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/0093.lsearch}{$value}{notfound}}}}" + +testprint "body_linecount=$body_linecount" diff --git a/test/aux-var-src/0093.f-2 b/test/aux-var-src/0093.f-2 new file mode 100644 index 000000000..b78757abd --- /dev/null +++ b/test/aux-var-src/0093.f-2 @@ -0,0 +1,4 @@ +# Exim filter + +testprint +"${if eq {1}{0}{yes}{${lookup{key1}lsearch{DIR/aux-fixed/junkjunk}{$value}{notfound}}}}" diff --git a/test/aux-var-src/0112.alias b/test/aux-var-src/0112.alias new file mode 100644 index 000000000..4f8279c59 --- /dev/null +++ b/test/aux-var-src/0112.alias @@ -0,0 +1,2 @@ +pipe: |/bin/sh -c "cat >DIR/test-mail/pipe" +file: DIR/test-mail/file diff --git a/test/aux-var-src/0114.filter b/test/aux-var-src/0114.filter new file mode 100644 index 000000000..578f49afe --- /dev/null +++ b/test/aux-var-src/0114.filter @@ -0,0 +1,15 @@ +# Exim filter + +if $local_part is null then + save /dev/null +elif $local_part is file then + save DIR/test-mail/file +elif $local_part is pipe then + pipe "/bin/sh -c \"cat >DIR/test-mail/pipe\"" +elif $local_part is reply then + seen mail + to "A. File <file>, No One <null>" + subject autoreply + text "Test Text" + once DIR/test-once +endif diff --git a/test/aux-var-src/0115.forward b/test/aux-var-src/0115.forward new file mode 100644 index 000000000..377e2655d --- /dev/null +++ b/test/aux-var-src/0115.forward @@ -0,0 +1 @@ +DIR/test-mail/file diff --git a/test/aux-var-src/0164.F b/test/aux-var-src/0164.F new file mode 100644 index 000000000..b6f98f384 --- /dev/null +++ b/test/aux-var-src/0164.F @@ -0,0 +1,3 @@ +if $recipients contains pipe then + pipe "DIR/aux-fixed/showenv $recipients" +endif diff --git a/test/aux-var-src/0165.F b/test/aux-var-src/0165.F new file mode 100644 index 000000000..b6f98f384 --- /dev/null +++ b/test/aux-var-src/0165.F @@ -0,0 +1,3 @@ +if $recipients contains pipe then + pipe "DIR/aux-fixed/showenv $recipients" +endif diff --git a/test/aux-var-src/0173.filter b/test/aux-var-src/0173.filter new file mode 100644 index 000000000..e58120d8a --- /dev/null +++ b/test/aux-var-src/0173.filter @@ -0,0 +1,7 @@ +# Demo Exim filter for virus check + +if error_message then finish endif + +if $received_protocol is not scanned-ok then + pipe "DIR/aux-fixed/resubmit $sender_address $recipients DIR/ CALLER" +endif diff --git a/test/aux-var-src/0177.filter b/test/aux-var-src/0177.filter new file mode 100644 index 000000000..3876981b1 --- /dev/null +++ b/test/aux-var-src/0177.filter @@ -0,0 +1,36 @@ +# Exim Filter + +# Test per-user filter with privilege + +logfile DIR/test-stderr + +if first_delivery then + logwrite "$message_id \"$h_subject:\" first delivery\n" +else + logwrite "$message_id \"$h_subject:\" not first delivery\n" +endif + +if error_message or $local_part is usery then finish endif + +if $h_subject IS NOT "Fail This" then + logwrite "$message_id subject is not \"Fail This\"" +endif + +if $h_subject contains "fail this" then + mail to usery text "failing $local_part@$domain" + subject "auto fail message" + fail text "subject was \"$h_subject:\" (filter fail)" +endif + +if $h_subject contains "freeze this" then + mail to usery text "freezing $local_part@$domain" + subject "auto freeze message" + freeze "subject was \"$h_subject:\"" +else + +if $h_subject matches ^reply then + mail to usery + subject "An auto reply: qualify_domain=$qualify_domain" + text "This is a text line" +endif +endif diff --git a/test/aux-var-src/0184.filter b/test/aux-var-src/0184.filter new file mode 100644 index 000000000..4766b628a --- /dev/null +++ b/test/aux-var-src/0184.filter @@ -0,0 +1,21 @@ +# Exim filter + +if error_message or not first_delivery then finish endif + +logfile DIR/test-stdout + +logwrite "To: contains\n$h_to:\n" + +if + $header_to is $header_from or + "${lookup{$h_to:}lsearch{DIR/aux-fixed/0184.lsearch}{$value}}" is y or + "${lookup{${local_part:$h_to:}}lsearch{DIR/aux-fixed/0184.lsearch}{$value}}" is y +then + logwrite "yyyyyy" +else + logwrite "nnnnnn" +endif + +mail to "$h_to:\nrhubarb" + +seen finish diff --git a/test/aux-var-src/0185.filter b/test/aux-var-src/0185.filter new file mode 100644 index 000000000..689d6f651 --- /dev/null +++ b/test/aux-var-src/0185.filter @@ -0,0 +1,18 @@ +# Exim Filter + +# More test per-user filter with privilege + +if error_message then finish endif + +logfile DIR/test-stderr + +if first_delivery then + logwrite "$message_id \"$h_subject:\" first delivery\n" +else + logwrite "$message_id \"$h_subject:\" not first delivery\n" +endif + + +if $h_subject contains "freeze this" then + freeze "subject was \"$h_subject:\"" +endif diff --git a/test/aux-var-src/0246.filter b/test/aux-var-src/0246.filter new file mode 100644 index 000000000..a851e3979 --- /dev/null +++ b/test/aux-var-src/0246.filter @@ -0,0 +1,3 @@ +# Exim filter + +seen mail expand file DIR/aux-fixed/0246.file diff --git a/test/aux-var-src/0272.exim b/test/aux-var-src/0272.exim new file mode 100644 index 000000000..97040ce0d --- /dev/null +++ b/test/aux-var-src/0272.exim @@ -0,0 +1 @@ +:fail: Explictly Rejected diff --git a/test/aux-var-src/0273.exim b/test/aux-var-src/0273.exim new file mode 100644 index 000000000..97040ce0d --- /dev/null +++ b/test/aux-var-src/0273.exim @@ -0,0 +1 @@ +:fail: Explictly Rejected diff --git a/test/aux-var-src/0319.filter b/test/aux-var-src/0319.filter new file mode 100644 index 000000000..1103ec475 --- /dev/null +++ b/test/aux-var-src/0319.filter @@ -0,0 +1,11 @@ +# Exim filter + +if error_message then finish endif + +if $h_subject: contains "discard" then seen finish endif + +if $h_subject: contains "file" then + save DIR/test-mail/saved +endif + +finish diff --git a/test/aux-var-src/0326.filter b/test/aux-var-src/0326.filter new file mode 100644 index 000000000..b813d2bd3 --- /dev/null +++ b/test/aux-var-src/0326.filter @@ -0,0 +1,16 @@ +# exim filter + +logfile DIR/spool/log/mainlog +logwrite "Filter entered: original_local_part=$original_local_part" +logwrite " parent_local_part=$parent_local_part" + +if + $local_part_prefix is "" and $local_part_suffix is "" +then + logwrite "No prefix or suffix" +else + logwrite "Prefix=$local_part_prefix" + logwrite "Suffix=$local_part_suffix" +endif + +deliver $local_part diff --git a/test/aux-var-src/0372.F b/test/aux-var-src/0372.F new file mode 100644 index 000000000..a5c6f6780 --- /dev/null +++ b/test/aux-var-src/0372.F @@ -0,0 +1,15 @@ +# Exim filter + +logfile DIR/test-stderr + +logwrite "----- System filter -----" +logwrite " acl_c0=\"$acl_c0\"\n acl_c1=\"$acl_c1\"\n acl_c2=\"$acl_c2\"\n \ + acl_c3=\"$acl_c3\"\n acl_c4=\"$acl_c4\"\n acl_c5=\"$acl_c5\"\n \ + acl_c6=\"$acl_c6\"\n acl_c7=\"$acl_c7\"\n acl_c8=\"$acl_c8\"\n \ + acl_c9=\"$acl_c9\"\n acl_m0=\"$acl_m0\"\n acl_m1=\"$acl_m1\"\n \ + acl_m2=\"$acl_m2\"\n acl_m3=\"$acl_m3\"\n acl_m4=\"$acl_m4\"\n \ + acl_m5=\"$acl_m5\"\n acl_m6=\"$acl_m6\"\n acl_m7=\"$acl_m7\"\n \ + acl_m8=\"$acl_m8\"\n acl_m9=\"$acl_m9\"" +logwrite "-------------------------" + +# End diff --git a/test/aux-var-src/0383.F b/test/aux-var-src/0383.F new file mode 100644 index 000000000..78a5898a1 --- /dev/null +++ b/test/aux-var-src/0383.F @@ -0,0 +1,13 @@ +# Exim filter (system filter for test 444) + +if error_message then finish endif + +if foranyaddress $h_to: ($thisaddress matches "^(alice)") then + pipe "DIR/aux-fixed/showenv $thisaddress $1" + finish +endif + +if $h_to: matches "^(j..)" then + pipe "DIR/aux-fixed/showenv $1" +endif + diff --git a/test/aux-var-src/0383.f b/test/aux-var-src/0383.f new file mode 100644 index 000000000..f51156ea7 --- /dev/null +++ b/test/aux-var-src/0383.f @@ -0,0 +1,8 @@ +# Exim filter (user filter for test 444) + +if error_message then finish endif + +if foranyaddress $h_to: ($thisaddress matches "^(...)") then + pipe "DIR/aux-fixed/showenv $thisaddress $1" +endif + diff --git a/test/aux-var-src/0401.hosts1 b/test/aux-var-src/0401.hosts1 new file mode 100644 index 000000000..dcaf67c69 --- /dev/null +++ b/test/aux-var-src/0401.hosts1 @@ -0,0 +1,3 @@ +V4NET.9.8.7 +*.2.2 +V4NET.9.9.9 diff --git a/test/aux-var-src/0401.hosts2 b/test/aux-var-src/0401.hosts2 new file mode 100644 index 000000000..8453fb6c1 --- /dev/null +++ b/test/aux-var-src/0401.hosts2 @@ -0,0 +1,2 @@ +a2.2.2 +V4NET.9.8.7 diff --git a/test/aux-var-src/0472.f b/test/aux-var-src/0472.f new file mode 100644 index 000000000..c2356e682 --- /dev/null +++ b/test/aux-var-src/0472.f @@ -0,0 +1,11 @@ +# Exim filter + +deliver userz$sn1 + +logfile DIR/test-stderr + +logwrite "------- $local_part filter -----------------" +logwrite "sn0=$sn0 sn1=$sn1 sn2=$sn2 sn3=$sn3 sn4=$sn4" +logwrite "sn5=$sn5 sn6=$sn6 sn7=$sn7 sn8=$sn8 sn9=$sn9" + +# End diff --git a/test/aux-var-src/3408.aliases b/test/aux-var-src/3408.aliases new file mode 100644 index 000000000..8b5eb5473 --- /dev/null +++ b/test/aux-var-src/3408.aliases @@ -0,0 +1 @@ +postmaster: CALLER diff --git a/test/aux-var-src/4950.tr b/test/aux-var-src/4950.tr new file mode 100644 index 000000000..c068700bd --- /dev/null +++ b/test/aux-var-src/4950.tr @@ -0,0 +1,3 @@ +V4NET.10.10.0/27 V4NET.10.10.11 +V4NET.0.0.0/27 other2.test.ex +V4NET.99.0.0/27 non-exist.test.ex |