aboutsummaryrefslogtreecommitdiffstats
path: root/regress/smtp/test.smtp0
blob: c56d002e9bafeb8a5a1c718a3e0e8f7c014566c7 (plain) (blame)
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
83
84
85
86
87
88
89
#! /usr/bin/smtpscript
#
# Simple test cases for the SMTP server.
#

# Make sure we get an smtp welcome message
test-case {
	expect smtp
}

# Make sure that the server accept QUIT and disconnect immediatly
test-case {
	expect smtp
	writeln "QUIT"
	expect smtp ok
	expect disconnect
}

# Make sure that the server rejects an empty HELO
test-case {
	expect smtp
	writeln "HELO"
	expect smtp permfail
}

# Make sure that the server rejects an empty EHLO
test-case {
	expect smtp
	writeln "EHLO"
	expect smtp permfail
}

# Make sure that the server accepts HELO
test-case {
	expect smtp
	writeln "HELO myself"
	expect smtp ok
}

# Make sure that the server accepts EHLO
test-case {
	expect smtp
	writeln "EHLO myself"
	expect smtp helo
}

# Make sure that the server doesn't accept mail before HELO
test-case {
	expect smtp
	writeln "MAIL FROM: <me@localhost>"
	expect smtp permfail
}

# Simple mail transfer test, without pipelining
test-case {
	expect smtp
	writeln "EHLO fkf"
	expect smtp helo
	writeln "MAIL FROM: <test@blabla>"
	expect smtp ok
	writeln "RCPT TO: <gilles
@localhost>"
	expect smtp ok
#	writeln "DATA"
#	expect smtp ok
#	writeln "foo"
#	writeln "."
#	expect smtp ok
#	writeln "QUIT"
#	expect smtp
#	expect disconnect
}

# Simple mail transfer test, with pipelining
test-case {
	expect smtp
	writeln "EHLO fkf"
	expect smtp helo
	writeln "MAIL FROM: <test@blabla>"
	writeln "RCPT TO: <test@localhost>"
	writeln "DATA"
	repeat 3 expect smtp ok
	writeln "foo"
	writeln "."
	expect smtp ok
	writeln "QUIT"
	expect smtp
	expect disconnect
}