blob: 49c1b182c8385d7edd29624bf9d07faf251d2081 (
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
|
#!/depot/path/expect -f
# separate address into user and host
regexp (.*)@(.*) $argv ignore user host
log_user 0
set timeout -1
# host might be an mx record, convert to a real host via nslookup
spawn nslookup
expect "> "
send "set query=mx\r"
expect "> "
send "$host\r"
expect {
"No mail exchanger" {}
-re "mail exchanger = (\[^\r]*)" {
set host $expect_out(1,string)
}
}
spawn telnet $host smtp
expect "220*\r\n"
send "vrfy $user\r"
expect "250" {send_user "GOOD\n"} \
"550" {send_user "BAD\n"}
|