Crash when sending mail using claws-mail
eatb33ts opened this issue · comments
Describe the bug
When attempting to send mail using the claws-mail 3.17.8 client, yggmail crashes with "runtime error: invalid memory address or nil pointer dereference". Claws reports "421 4.0.0 Internal server error"
To Reproduce
Steps to reproduce the behavior:
Install Claws 3.17.8
Configure claws to use yggmail
Send an email.
Reproducible Environment
I have also provided a nix-shell
environment for your convenience at https://github.com/eatb33ts/yggmail/tree/claws-crash that reproduces the bug with pinned dependencies and preconfigured claws-mail/yggmail and a draft message that will illustrate the bug. If you have the Nix package manager installed, simply switch to that branch and run nix-shell
.
Expected behavior
Emails should be sent
Stacktrace
smtp/server 2021/07/18 16:29:54 panic serving 127.0.0.1:46286: runtime error: invalid memory address or nil pointer dereference
goroutine 298 [running]:
runtime/debug.Stack(0xc00035a500, 0x0, 0x0)
runtime/debug/stack.go:24 +0x9f
github.com/emersion/go-smtp.(*Conn).handle.func1(0xc00035a500)
github.com/emersion/go-smtp@v0.15.0/conn.go:102 +0xfb
panic(0x911460, 0xc3ed70)
runtime/panic.go:965 +0x1b9
github.com/neilalexander/yggmail/internal/smtpserver.(*Backend).Login(0xc00030e000, 0x0, 0xc00031cb80, 0x40, 0xc000327820, 0x8, 0x0, 0x0, 0x0, 0x0)
github.com/neilalexander/yggmail/internal/smtpserver/backend.go:50 +0x29f
main.main.func1.1.1(0xc00031cb80, 0x40, 0xc000327820, 0x8, 0x8, 0xc000327810)
github.com/neilalexander/yggmail/cmd/yggmail/main.go:175 +0x5b
github.com/emersion/go-sasl.(*loginServer).Next(0xc000315050, 0xc000327810, 0x8, 0x9, 0x8, 0x9, 0x0, 0x0, 0x0, 0x0)
github.com/emersion/go-sasl@v0.0.0-20200509203442-7bfe0ed36a21/login.go:81 +0x1cd
github.com/emersion/go-smtp.(*Conn).handleAuth(0xc00035a500, 0xc000327785, 0x5)
github.com/emersion/go-smtp@v0.15.0/conn.go:549 +0x1e4
github.com/emersion/go-smtp.(*Conn).handle(0xc00035a500, 0xc000327780, 0x4, 0xc000327785, 0x5)
github.com/emersion/go-smtp@v0.15.0/conn.go:151 +0x2d9
github.com/emersion/go-smtp.(*Server).handleConn(0xc00031a000, 0xc00035a500, 0x0, 0x0)
github.com/emersion/go-smtp@v0.15.0/server.go:154 +0x1ea
created by github.com/emersion/go-smtp.(*Server).Serve
github.com/emersion/go-smtp@v0.15.0/server.go:126 +0xff
Desktop
- OS: NixOS 21.05
- nixpkgs revision: 7e9b0dff974c89e070da1ad85713ff3c20b0ca97
- yggmail revision: e0b3f60
- claws-mail 3.17.8
Additional context
yggmail works fine with thunderbird on the same system.