Skip to content

Save state after authentication #19

@zakcutner

Description

@zakcutner

Hello! Thanks for creating this library, it's really useful and I love the simplicity 👌 I'm looking at the example for authentication that you give in the readme...

func authHandler(remoteAddr net.Addr, mechanism string, username []byte, password []byte, shared []byte) (bool, error) {
    return string(username) == "valid" && string(password) == "password", nil
}

Is there a way to store some kind of state at authentication time that can later be used in a mail handler? That way you could, for instance, only allow sending emails that are from that user's account.

If not, do you have any ideas for how to implement this? I'd be really happy to help with an implementation 😁

(as a side-note, docs for this library can't be viewed at pkg.go.dev/github.com/mhale/smtpd because you don't have a license, you may want to create a simple LICENSE file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions