From 509ef2a31560792035a9174f97af1ca779e67ff1 Mon Sep 17 00:00:00 2001 From: arzumify Date: Mon, 25 Nov 2024 15:53:40 +0000 Subject: [PATCH] Fixed example --- examples/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/main.go b/examples/main.go index 0e37e9d..682f6fc 100644 --- a/examples/main.go +++ b/examples/main.go @@ -2,9 +2,11 @@ package main import ( "fmt" - "github.com/google/uuid" "net" - "smtp" + + "net/textproto" + + "git.ailur.dev/ailur/smtp" ) // DatabaseBackend is a smtp.DatabaseBackend implementation that always returns true for CheckUser and prints the mail data to stdout. @@ -12,15 +14,15 @@ var DatabaseBackend = smtp.DatabaseBackend{ CheckUser: func(address *smtp.Address) (bool, error) { return true, nil }, - WriteMail: func(mail *smtp.Mail) (uuid.UUID, error) { + WriteMail: func(mail *smtp.Mail) error { fmt.Println(string(mail.Data)) - return uuid.New(), nil + return nil }, } // AuthenticationBackend is a smtp.AuthenticationBackend implementation that always returns a fixed address for Authenticate. var AuthenticationBackend = smtp.AuthenticationBackend{ - Authenticate: func(authCommand string) (*smtp.Address, error) { + Authenticate: func(initial string, conn *textproto.Conn) (*smtp.Address, error) { return &smtp.Address{ Name: "test", Address: "example.org",