diff options
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r-- | lib/net/smtp.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 09ae8ecb66..d11cff6235 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -141,12 +141,11 @@ Net::Protocol end if user and secret then - begin - mid = 'auth_' + (authtype || 'cram_md5').to_s - @command.send mid, user, secret - rescue NameError + mid = 'auth_' + (authtype || 'cram_md5').to_s + unless @command.respond_to? mid then raise ArgumentError, "wrong auth type #{authtype.to_s}" end + @command.send mid, user, secret end end |