summaryrefslogtreecommitdiff
path: root/test/scripts/0000-Basic/0626
blob: 6da58ee48356bc2ba2b1bfb857779d14732f94be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
****