Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

imap-acct (and creds) CLI crashes with nil pointer when storage modules aren't started #815

Closed
Closed
imap-acct (and creds) CLI crashes with nil pointer when storage modules aren't started#815
Labels
bugSomething isn't working.

Description

Describe the bug

maddy imap-acct (and related CLI commands) panic because the CLI loads the config but doesn't call Start() on LifetimeModule.

For storage.imapsql, this leaves Back nil, and EnableUpdatePipe() dereferences a nil UpdateManager, causing a SIGSEGV.

The server path starts modules correctly, but the CLI does not.

Steps to reproduce

  1. Run maddy in Docker with a config that includes storage.imapsql local_mailboxes.
  2. Execute:
    docker exec -it maddy-local maddy imap-acct create alice@example.test

Log files

Panic stack trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xeb5430]

goroutine 1 [running]:
github.com/foxcpp/go-imap-sql.(*Backend).UpdateManager(...)
github.com/foxcpp/go-imap-sql@v0.5.1-0.20250124140007-8da5567429d5/backend.go:343
github.com/foxcpp/maddy/internal/storage/imapsql.(*Storage).EnableUpdatePipe(...)
internal/storage/imapsql/imapsql.go:348
github.com/foxcpp/maddy/internal/cli/ctl.openStorage(...)
internal/cli/ctl/moduleinit.go:96
...

Configuration file

(attach or paste sanitized file)

  • Based on Docker config (maddy.conf.docker)
  • Uses storage.imapsql local_mailboxes with sqlite3 dsn
storage.imapsql local_mailboxes {
driver sqlite3
dsn imapsql.db
}

Environment information

  • maddy v0.9.0 / b1dc3ff
  • Docker / MacOS / Arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions