Package: freepops
Version: 0.0.99-1+patches20061018
Severity: important
Tags: patch
When using freepops with gmail module througth a HTTP proxy you get the
following error:
# /usr/bin/freepopsd -vv -P http://proxy:8080
Thu Dec 28 18:05:28 2006 freepopsd: INTERNAL: freepops started with loglevel 2
on a little endian machine.
Thu Dec 28 18:05:28 2006 freepopsd: PID: Maintaining pid file
"/var/run/freepopsd.pid"
Thu Dec 28 18:05:28 2006 freepopsd: DBG(popserver.c, 182): [11909] ?? Ip
address 0.0.0.0 real port 2000
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] ?? Ip
address 127.0.0.1 real port 2000
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] -> +OK
FreePOPs/0.0.99 pop3 server ready
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] <- CAPA
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] -> +OK
ANSWER FOLLOW
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] -> TOP
USER
UIDL
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] -> .
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] <- USER
[EMAIL PROTECTED]
Thu Dec 28 18:05:38 2006 freepopsd: DBG(log_lua.c, 83):
(@/usr/share/freepops/lua/gmail.lua, 1003) : FreePOPs plugin 'GMail.com'
version '0.0.44' started!
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 182): [11909] -> +OK
PLEASE ENTER PASSWORD
Thu Dec 28 18:05:38 2006 freepopsd: DBG(popserver.c, 171): [11909] <- PASS
*********
LUAY: lua error message:
LUAY: /usr/share/freepops/lua/gmail.lua:327: attempt to index a nil value
LUAY: lua stack traceback:
LUAY: /usr/share/freepops/lua/gmail.lua: gmail_login: 327 (Lua global)
Thu Dec 28 18:05:39 2006 freepopsd: DBG(popserver.c, 182): [11909] -> -ERR
UNKNOWN ERROR, PLEASE FIX
Thu Dec 28 18:05:39 2006 freepopsd: POPSERVER: UNKNOWN ERROR, PLEASE FIX
Thu Dec 28 18:05:39 2006 freepopsd: DBG(threads.c, 81): thread 0 will die
...
After debugging freepops a little, the error didn't came from gmail.lua
module but from freepops's lua browser module that don't follow
all "302 Redirect HTTP" answers when using a HTTP proxy.
As a consequence some cookies values are missing [mainly "GX" and "GMAIL_AT"
for gmail module] and the lua error is rised on line:
gmail.lua:327: internal_state.strCookieVal = (b:get_cookie("GX")).value
See the freepops.patch [which is just a hack] to have a better idea of this
issue. I guess the good correction will be to find why freepops can have a
return code of 200 on a 302 answer when using a HTTP proxy.
-- System Information:
Debian Release: 4.0
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages freepops depends on:
ii debconf [debconf-2.0] 1.5.11 Debian configuration management sy
ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries
ii libcurl3-gnutls 7.15.5-1 Multi-protocol file transfer libra
ii libexpat1 1.95.8-3.3 XML parsing C library - runtime li
ii libgcrypt11 1.2.3-2 LGPL Crypto library - runtime libr
ii lsb-base 3.1-22 Linux Standard Base 3.1 init scrip
freepops recommends no packages.
-- debconf information:
* freepops/jail: false
* freepops/init: true
--- /usr/share/freepops/lua/browser/browser.lua.orig 2006-10-19
18:29:22.000000000 +0200
+++ /usr/share/freepops/lua/browser/browser.lua 2006-12-28 18:14:33.000000000
+0100
@@ -303,20 +303,27 @@
return Hidden.error("malformed HTTP header line: "..gl_h[1])
end
-- HTTP 2xx
if string.byte(ret,1) == string.byte("2",1) then
if self.followRefreshHeader == true then
local l = Hidden.get_refresh_location(gl_h)
if l ~= nil then
return Hidden.REDO,l
end
end
+ -- Hack from [EMAIL PROTECTED]:
+ -- With HTTP proxy you can have ret == 200 for a 302 answer
+ -- handle that....
+ local l = Hidden.get_location(gl_h,url)
+ if l ~= nil then
+ return Hidden.REDO,l
+ end
return Hidden.DONE,nil
-- HTTP 3xx
elseif string.byte(ret,1) == string.byte("3",1) then
if ret=="300" or ret=="304" or ret=="305" then
return Hidden.error("Unsupported HTTP "..ret.." code")
end
if ret=="301" or ret=="302" or ret=="303" or ret=="307" then
local l = Hidden.get_location(gl_h,url)
if l ~= nil then
return Hidden.REDO,l