Add F keybinding to flush the mail queue via postqueue -f

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-03-29 19:45:40 +07:00
commit 9ba845e5f4
3 changed files with 34 additions and 2 deletions

20
msgs.go
View file

@ -1,6 +1,8 @@
package main
import (
"os/exec"
tea "github.com/charmbracelet/bubbletea"
)
@ -34,6 +36,24 @@ func loadQueueCmd() tea.Cmd {
}
}
func flushQueueCmd() tea.Cmd {
return func() tea.Msg {
exec.Command("postqueue", "-f").Run()
entries, err := loadQueue()
if err != nil {
return queueErrMsg{err}
}
return queueParsedMsg{entries}
}
}
func requeueMessageCmd(id string) tea.Cmd {
return func() tea.Msg {
exec.Command("postsuper", "-r", id).Run()
return nil
}
}
func fetchSubjectCmd(id string) tea.Cmd {
return func() tea.Msg {
raw, err := fetchHeaders(id)