mirror of
https://github.com/neilalexander/yggmail.git
synced 2026-05-06 20:06:28 +03:00
Onboarding, Sent box and Outbox (#45)
* main - Set * Working * Welcome - Added welcome message generation * Smtpsender - On successful SMTP send create the "Sent" box and then try move from "Outbox" to "Sent" * Sent box - Create the mailbox in `main.go` and not every time we try move from `Outbox` to `Sent` * Use logegr * USer - Added logger pointer (and made use of it) - Disallow renaming or deletion of 'Sent' * When creating a new user set it up with logger * Encoded message * Added tests * Send a welcome mail on startup (soon to mke it only happen once) * try set flags * Onboarding flag set * Sender - Removed testing code * Welcome - Moved welcomer code * Cleaned up * Added more * renamed package * Removed comment * welcome - FIxed variable names * welcome - Removed semi-colons - Fixed imports * welcome - Ran `gofmt` * welcome test - Fixed up * h * main - Ran `gofmt` * Main - Fxied * Welcome - Foxed name * Added `.gitignore` * Mailbox - Disabled print logging * Fixed * fixedg * fixe and use `%v`
This commit is contained in:
committed by
GitHub
parent
fa32249f2f
commit
8bf3ba5f47
@@ -58,6 +58,7 @@ func (qs *Queues) manager() {
|
||||
|
||||
func (qs *Queues) QueueFor(from string, rcpts []string, content []byte) error {
|
||||
pid, err := qs.Storage.MailCreate("Outbox", content)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("q.queues.Storage.MailCreate: %w", err)
|
||||
}
|
||||
@@ -176,7 +177,8 @@ func (q *Queue) run() {
|
||||
if remaining, err := q.queues.Storage.QueueSelectIsMessagePendingSend("Outbox", ref.ID); err != nil {
|
||||
return fmt.Errorf("q.queues.Storage.QueueSelectIsMessagePendingSend: %w", err)
|
||||
} else if !remaining {
|
||||
return q.queues.Storage.MailDelete("Outbox", ref.ID)
|
||||
q.queues.Log.Printf("Moving mail with id '%d' from Outbox to Sent\n", ref.ID)
|
||||
return q.queues.Storage.MailMove("Outbox", ref.ID, "Sent")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user