neilalexander / yggmail

End-to-end encrypted email for the mesh networking age

Home Page:https://matrix.to/#/#yggmail:matrix.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working on Windows (MingW)

Revertron opened this issue · comments

Describe the bug
It starts without -password, and seems to work, but I can't send messages from Thunderbird, as yggmail doesn't want connections without password.
If I try to run yggmail with -password, I get this:

[  Yggmail  ] Using database file "yggmail.db"
[  Yggmail  ] Generated new server identity
[  Yggmail  ] Mail address: 8fedf643a96bb837b36e796bf21924bd33cd27021b6092186ccecde320e8c9f9@yggmail
[  Yggmail  ] Please enter your new password:
panic: The handle is invalid.

goroutine 1 [running]:
main.main()
        C:/msys64/home/Revertron/go/pkg/mod/github.com/neilalexander/yggmail@v0.0.0-20210709230215-4c07013a1397/cmd/yggmail/main.go:91 +0x1255

To Reproduce
Steps to reproduce the behavior:

  1. Make go install github.com/neilalexander/yggmail/cmd/yggmail@latest in MingW64.
  2. Run go/bin/yggmail.exe -peer <some peer> -password.
  3. See the error.

Expected behavior
It should get password from stdin.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win10, MingW64 (latest)
  • Version: 20210709230215
commented

Should hopefully be fixed in 63de5e8, can you please give the latest main commit a try?

Am I doing something wrong?

$ go install github.com/neilalexander/yggmail/cmd/yggmail@63de5e81e477ba08734b7cf02b8b278e45f0c19c
go: downloading github.com/neilalexander/yggmail v0.0.0-20210710104255-63de5e81e477
# github.com/neilalexander/yggmail/cmd/yggmail
go\pkg\mod\github.com\neilalexander\yggmail@v0.0.0-20210710104255-63de5e81e477\cmd\yggmail\main.go:89:38: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to term.ReadPassword
go\pkg\mod\github.com\neilalexander\yggmail@v0.0.0-20210710104255-63de5e81e477\cmd\yggmail\main.go:95:38: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to term.ReadPassword
commented

Which version of Go are you using?

commented

Give 90b02ba a try — this might fix it.

Which version of Go are you using?

go 1.16

Give 90b02ba a try — this might fix it.

[  Yggmail  ] Using database file "yggmail.db"
[  Yggmail  ] Mail address: 8fedf643a96bb837b36e796bf21924bd33cd27021b6092186ccecde320e8c9f9@yggmail
[  Yggmail  ] Please enter your new password:
panic: The handle is invalid.

goroutine 1 [running]:
main.main()
        C:/msys64/home/Revertron/go/pkg/mod/github.com/neilalexander/yggmail@v0.0.0-20210710105511-90b02ba0d636/cmd/yggmail/main.go:90 +0x1435
commented

Can you try this not under mingw?

Can you try this not under mingw?

There is no gcc for Windows without MingW:

go: downloading github.com/neilalexander/yggmail v0.0.0-20210710105511-90b02ba0d636
# github.com/mattn/go-sqlite3
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
commented

I mean try running it under a regular Command Prompt or PowerShell after building the .exe. I’m wondering if there’s something special about the mingw terminal.

Aha, that works. But escape symbols for coloring do not work. Isn't there a better logging library in Go to handle different terminals?
image