lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Hans Hagen
> Sent: maandag 11 februari 2013 0:39
> To: lua-l@lists.lua.org
> Subject: luasocket smtp
> 
> Hi,
> 
> I'm not sure where to report this but in smtp.lua it looks like this needs
> to be fixed:

Maybe here; https://github.com/diegonehab/luasocket 




> 
> function metat.__index:auth(user, password, ext)
>      if not user or not password then return 1 end
>      if string.find(ext, "AUTH[^\n]+LOGIN") then
>          return self:login(user, password)
>      elseif string.find(ext, "AUTH[^\n]+PLAIN") then
>          return self:plain(user, password)
>      else
>          self.try(nil, "authentication not supported")
>      end
> end
> 
> Some mail servers return PLAIN LOGIN in 'ext' so this function needs to
> test for PLAIN first:
> 
> function metat.__index:auth(user, password, ext)
>      if not user or not password then return 1 end
>      if string.find(ext, "AUTH[^\n]+PLAIN") then
>          return self:plain(user, password)
>      elseif string.find(ext, "AUTH[^\n]+LOGIN") then
>          return self:login(user, password)
>      else
>          self.try(nil, "authentication not supported")
>      end
> end
> 
> Hans
> 
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                               | www.pragma-pod.nl
> -----------------------------------------------------------------