File: protocols

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 (45 lines) | stat: -rw-r--r-- 1,029 bytes parent folder | download | duplicates (2)
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
. functions
export HELOHOST=f.q.d.n

rm -f testmail
cat >testmail <<EOF
bruceg@em.ca
bruceg@em.ca

From: <bruceg@em.ca>
To: <bruceg@em.ca>
Subject: Nullmailer automated test message

Just testing, please ignore
EOF

for p in smtp qmqp
do
	echo "Testing host not found error with $p."
	error 2 protocol $p this.host.can.not.exist <testmail

	echo "Testing connection refused error with $p."
	error 7 protocol $p -p 24680 localhost <testmail
	
	echo "Testing usage error with $p (zero args)."
	error 1 protocol $p <testmail
	
	echo "Testing usage error with $p (two args)."
	error 1 protocol $p localhost foobar <testmail
	
	echo "Testing usage error with $p (unknown option)."
	error 1 protocol $p -x localhost <testmail
	
	echo "Testing usage error with $p (invalid integer)."
	error 1 protocol $p -p foo localhost <testmail

	tcpserver 0 24680 date & job=$!
	sleep 1
	trap "kill $job" EXIT
	echo "Testing protocol failure with $p."
	error 11 protocol $p -p 24680 localhost <testmail
	kill $job
	trap - EXIT
done

rm -f testmail