aboutsummaryrefslogtreecommitdiffstats
path: root/regress/smtp/test.mailfrom
blob: 0420f1c29b5094d18ad9c405cf209e9b702687c4 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
proc init-helo {
	expect smtp ok
	writeln "HELO regress"
	expect smtp helo
}

# Allow emtpy MAIL FROM address (bounce messages)
test-case name "mailfrom.empty" {
	call init-helo
	writeln "MAIL FROM: <>"
	expect smtp ok
}

# Allow emtpy MAIL FROM address (bounce messages)
test-case name "mailfrom.at-sign" {
	call init-helo
	writeln "MAIL FROM: <@>"
	expect smtp ok
}

# Reject address without an '@'
test-case name "mailfrom.no-at-sign" {
	call init-helo
	writeln "MAIL FROM: <a>"
	expect smtp permfail
}

# Reject address with empty domain
test-case name "mailfrom.no-domain" {
	call init-helo
	writeln "MAIL FROM: <a@>"
	expect smtp permfail
}

# Reject address with empty user
test-case name "mailfrom.no-user" {
	call init-helo
	writeln "MAIL FROM: <@a>"
	expect smtp permfail
}

# Accept address after source-route stripping
test-case name "mailfrom.src-route" {
	call init-helo
	writeln "MAIL FROM: <whatever:a@a>"
	expect smtp ok
}

# Reject address with empty user after source-route stripping
test-case name "mailfrom.src-route-no-user" {
	call init-helo
	writeln "MAIL FROM: <a:@a>"
	expect smtp permfail
}

# Reject space as user
test-case name "mailfrom.space-as-user" {
	call init-helo
	writeln "MAIL FROM: < @a>"
	expect smtp permfail
}

# Reject space as domain
test-case name "mailfrom.space-as-domain" {
	call init-helo
	writeln "MAIL FROM: <a@ >"
	expect smtp permfail
}

# Reject unsupported options
test-case name "mailfrom.option" {
	call init-helo
	writeln "MAIL FROM: <user@domain> OPT"
	expect smtp permfail
}

# Allow SIZE=*
test-case name "mailfrom.option-size" {
	call init-helo
	writeln "MAIL FROM: <user@domain> SIZE=3005"
	expect smtp ok
}

# Allow BODY=7BIT
test-case name "mailfrom.option-7bit" {
	call init-helo
	writeln "MAIL FROM: <user@domain> BODY=7BIT"
	expect smtp ok
}

# Allow BODY=8BITMIME
test-case name "mailfrom.option-8bitmime" {
	call init-helo
	writeln "MAIL FROM: <user@domain> BODY=8BITMIME"
	expect smtp ok
}

# Allow multiple options
test-case name "mailfrom.option-8bitmime-size" {
	call init-helo
	writeln "MAIL FROM: <user@domain> BODY=8BITMIME SIZE=100"
	expect smtp ok
}

# Allow AUTH= (ignored)
test-case name "mailfrom.option-auth" {
	call init-helo
	writeln "MAIL FROM: <user@domain> AUTH=WHATEVER"
	expect smtp ok
}