File: rewrite

package info (click to toggle)
nullmailer 1.00RC7-22
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,192 kB
  • ctags: 695
  • sloc: cpp: 4,375; sh: 519; makefile: 249; perl: 184; ansic: 10
file content (44 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (7)
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
. functions

que() {
	set -e
	../src/nullmailer-queue && \
	cat /tmp/nm/var/nullmailer/queue/* && \
	rm -f /tmp/nm/var/nullmailer/queue/*
}
que-recip() {
	set -e
	que | sed -e '2,2!d' | grep -q "$@"
}

echo admin@remote >/tmp/nm/etc/nullmailer/adminaddr

echo "Checking that queue rewrites user@localhost to adminaddr."
que-recip -q '^admin@remote$' <<EOF
bruceg@qcc.sk.ca
user@localhost

header

data
EOF

echo "Checking that queue rewrites user@hostname to adminaddr."
que-recip -q '^admin@remote$' <<EOF
bruceg@qcc.sk.ca
user@f.q.d.n

header

data
EOF

echo "Checking that queue does not rewrite non-local users."
que-recip -q '^user@nowhere.org$' <<EOF
bruceg@qcc.sk.ca
user@nowhere.org

header

data
EOF