File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def send_message(data)
184
184
185
185
raw_send_recv ( "MAIL FROM: <#{ mailfrom } >\r \n " , nsock )
186
186
res = raw_send_recv ( "RCPT TO: <#{ mailto } >\r \n " , nsock )
187
- if res [ 0 ..2 ] == '250'
187
+ if res && res [ 0 ..2 ] == '250'
188
188
resp = raw_send_recv ( "DATA\r \n " , nsock )
189
189
190
190
# If the user supplied a Date field, use that, else use the current
@@ -242,10 +242,12 @@ def raw_send_recv(cmd, nsock=self.sock)
242
242
# to dump it all.
243
243
vprint_status ( "C: #{ ( ( cmd . length > 120 ) ? cmd [ 0 , 120 ] + "..." : cmd ) . strip } " )
244
244
end
245
-
246
- nsock . put ( cmd )
247
- res = nsock . get_once
248
-
245
+ begin
246
+ nsock . put ( cmd )
247
+ res = nsock . get_once
248
+ rescue
249
+ return nil
250
+ end
249
251
# Don't truncate the server output because it might be helpful for
250
252
# debugging.
251
253
vprint_status ( "S: #{ res . strip } " ) if res
You can’t perform that action at this time.
0 commit comments