Develop and Download Open Source Software

Browse Subversion Repository

Contents of /checksmtp.exp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22 - (show annotations) (download)
Wed Feb 19 06:43:47 2020 UTC (4 years, 3 months ago) by elge
File size: 1730 byte(s)
imporing the rest of shot1 incl enforce check

1 #!/usr/bin/expect -f
2
3 set mailserver [lrange $argv 0 0]
4 set ehlo pro5s2.nethence.com
5 set from starttls@nethence.com
6
7 send_error "$mailserver\t"
8
9 spawn telnet $mailserver 25
10 expect "Name or service not known" {
11 send_error "connect-bad-dns\n"
12 exit
13 } "Unknown host" {
14 send_error "connect-bad-host\n"
15 exit
16 } "Invalid argument" {
17 send_error "connect-invalid-argument\n"
18 exit
19 } "failed" {
20 send_error "connect-failed\n"
21 exit
22 } "2?? *" {
23 } "4?? *" {
24 send_error "connect-4xx\n"
25 exit
26 } "5?? *" {
27 send_error "connect-5xx\n"
28 exit
29 } "refused" {
30 send_error "connect-refused\n"
31 exit
32 } "closed" {
33 send_error "connect-closed\n"
34 exit
35 } timeout {
36 send_error "connect-timeout\n"
37 exit
38 } else {
39 send_error "connect-unknown\n"
40 exit
41 }
42
43 send "EHLO $ehlo\r"
44 expect "250-STARTTLS" {
45 } "2?? *" {
46 send_error "ehlo-2xx-no-starttls\n"
47 send "QUIT\r"
48 expect eof
49 exit
50 } "5?? *" {
51 send_error "ehlo-5xx\n"
52 send "QUIT\r"
53 expect eof
54 exit
55 } "4?? *" {
56 send_error "ehlo-4xx\n"
57 send "QUIT\r"
58 expect eof
59 exit
60 } timeout {
61 send_error "ehlo-timeout\n"
62 send "QUIT\r"
63 expect eof
64 exit
65 } else {
66 send_error "ehlo-unknown\n"
67 send "QUIT\r"
68 expect eof
69 exit
70 }
71
72 send "MAIL FROM: <$from>\r"
73 expect "2?? *" {
74 send_error "sender-2xx\n"
75 send "QUIT\r"
76 expect eof
77 exit
78 } "5?? *" {
79 send_error "sender-5xx\n"
80 send "QUIT\r"
81 expect eof
82 exit
83 } "4?? *" {
84 send_error "sender-4xx\n"
85 send "QUIT\r"
86 expect eof
87 exit
88 } else {
89 send_error "sender-unknown\n"
90 send "QUIT\r"
91 expect eof
92 exit
93 }
94
95 #send "QUIT\r"
96 #expect eof
97 send_error "THIS-IS-A-BUG - expect should have exited already\n"
98 exit
99

Properties

Name Value
svn:executable *

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26