Later firmware does not cause a reboot but just an immediate disconnect.
Could be the updates to ssl including new close sourced lib (maybe gmail doesn't like the ssl implementation) causing it?
See https://github.com/nodemcu/nodemcu-firmware/issues/134
I have tried to rebuild commenting out all "unnecessary" modules to free up some heap, but cant get it above 24 kb with 20150127 FW.
> node.restart()
> c_��S��FjS�fJS��C�
NodeMCU 0.9.5 build 20150126 powered by Lua 5.1.4
lua: cannot open init.lua
> print(node.heap())
24080
> dofile("gmail2.lua")
> Connected.
Logged in.
Mail sent
disconnect
> c_��RS��FjS�JS��BC�
NodeMCU 0.9.5 build 20150118 powered by Lua 5.1.4
lua: cannot open init.lua
> print(node.heap())
22688
> dofile("gmail2.lua")
> c_��RS��FjS�fJS��BC�
NodeMCU 0.9.5 build 20150118 powered by Lua 5.1.4
lua: cannot open init.lua
>
> node.restart()
> c_�RS��FS��Fj�f�C�
NodeMCU 0.9.5 build 20150127 powered by Lua 5.1.4
lua: cannot open init.lua
> print(node.heap())
22496
> dofile("gmail2.lua")
> disconnect
>
> node.restart()
> c_��RS��FjS�fJS�f�C�
NodeMCU 0.9.5_custom build 20150127 powered by Lua 5.1.4
lua: cannot open init.lua
> print(node.heap())
23944
> dofile("gmail2.lua")
> disconnect
>