From: Benjamin Sommerfeld Date: 2003-05-22T18:34:41+09:00 Subject: Re: SMTP Authentication Thanks a lot, but it still doesn't really work.. here's the output: usr/local/lib/ruby/1.6/net/smtp.rb:262:in `do_start': wrong auth type :login (ArgumentError) from /usr/local/lib/ruby/1.6/net/protocol.rb:131:in `start' from sendmail.rb:5 And here's the source: require 'net/smtp' Net::SMTP.new('10.162.93.61',25).start('hno.atmel.com','proben1','proberserver',':login'){|smtp| smtp.send_mail "testmail", 'proben1@hno.atmel.com', 'benjamin.sommerfeld@hno.atmel.com' } smtp.finish Do you have any more hints? Thanks in advance, Ben Am Donnerstag, 22. Mai 2003 10:51 schrieb Kazuhiko Izawa: > From: Benjamin Sommerfeld > Date: Wed, 21 May 2003 23:11:55 +0900 > > > i'm programming a Ruby mailing function which needs to authenticate on a > > SMTP server via the "login" method (as it is called in KMAil)... the smtp > > server doesn't accept nil, :plain or :cram_md5 as authentication > > methods.... > > > > can anybody help me out? > > Try this patch for net/smtp.rb and use :login authtype. > > --- smtp.rb.orig Thu May 22 17:33:22 2003 > +++ smtp.rb Thu May 22 17:38:31 2003 > @@ -352,6 +352,15 @@ > } > end > > + # "LOGIN" authentication > + def auth_login(user, secret) > + atomic{ > + getok("AUTH LOGIN", ContinueCode) > + getok([user].pack('m').chomp, ContinueCode) > + getok([secret].pack('m').chomp) > + } > + end > + > def mailfrom( fromaddr ) > atomic { > getok sprintf('MAIL FROM:<%s>', fromaddr)