diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2021-08-01 18:15:39 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2021-08-01 18:15:39 +0100 |
commit | 2357aa78ccd7182cad14307eb89cb1065f078356 (patch) | |
tree | 480b8913a6d153400e8f85b418263f18b25e6f86 /test/scripts/0000-Basic | |
parent | 38089ca5c8f4c06092324099fc38494f8491b53c (diff) |
ACL: "seen" condition
Diffstat (limited to 'test/scripts/0000-Basic')
-rw-r--r-- | test/scripts/0000-Basic/0626 | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/test/scripts/0000-Basic/0626 b/test/scripts/0000-Basic/0626 new file mode 100644 index 000000000..6da58ee48 --- /dev/null +++ b/test/scripts/0000-Basic/0626 @@ -0,0 +1,82 @@ +# ACL 'seen' condition +# +exim -DOPT='-1s' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# Check that a hints DB was created. +# Only the key is useful thanks to munging; should match the IP used above. +dump seen +# +sleep 1 +# should now see old-enough record +exim -DOPT='-1s' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# force an update (visible via debug output in stdout for -bh) +exim -DOPT='-1s / write' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# default key should change with ip +exim -DOPT='-1s' -bh HOSTIPV4 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +dump seen +# explicit key (also checking expansion) +exim -DOPT='-1s / key=${sender_host_address}_foo' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +dump seen +# check refresh +sleep 1 +exim -DOPT='-1s / refresh=1s' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# +# +# +# +# +# test for seen-more-recently-than +# that previous one should be no older than 5s, so this should pass +# do not update +# check list-parsing spaceless while we're here +exim -DOPT='5s/key=${sender_host_address}_foo/readonly' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# check the above no-update by waiting longer than the later-than interval; should fail +# should update +sleep 2 +exim -DOPT='1s / key=${sender_host_address}_foo' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** +# having updated, should pass +exim -DOPT='1s / key=${sender_host_address}_foo' -bh 127.0.0.1 +HELO test +MAIL FROM:<tester@test.ex> +RCPT TO:<a1@test.ex> +QUIT +**** |