Slightly modified my code to join it to single file and remove credentials (attached). It was working before :-(
It authenticates, but unable to pull messages.
$ go run check_mailbox_imap.go
Server says hello: Gimap ready for requests from xxx.xx.xx.xx v??????????????.42
Mailbox status:
<nil>panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x80491f0]
goroutine 1 [running]:
main.CheckMailBox(0x81b5f38, 0x5, 0x81ccf88, 0x14, 0x81c1288, ...)
/home/al/workspace/go/src/scripts/amx/check_mailbox_imap.go:81 +0x400
main.main()
/home/al/workspace/go/src/scripts/amx/check_mailbox_imap.go:33 +0x53
goroutine 2 [syscall]:
exit status 2