all repos — emessage @ 46bc2f2829df25e7eb873da501a21a12728060fa

The EMessage email client

implemented polling
Robert Ismo me@robertismo.com
Fri, 26 Jun 2026 13:12:07 -0500
commit

46bc2f2829df25e7eb873da501a21a12728060fa

parent

d7481b9a595ac2e9cfe54866cd7c4347b072bde0

4 files changed, 26 insertions(+), 0 deletions(-)

jump to
M app.goapp.go

@@ -85,6 +85,15 @@ app.Log("Update failed: %v", err).Stdout().StatusLine()

} } }() + go func() { + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + for range ticker.C { + if err := app.syncMessages(); err != nil { + app.Log("Sync failed: %v", err).Stdout().StatusLine() + } + } + }() app.EstablishMailConnections() return }
M email.goemail.go

@@ -410,3 +410,9 @@ }

return parts, nil } + +func (app *App) messageExistsByServerID(serverID string) bool { + var count int64 + app.DB.Model(&Message{}).Where("server_message_id = ?", serverID).Count(&count) + return count > 0 +}
M mailaccount.gomailaccount.go

@@ -240,6 +240,14 @@ }

} } +type MailboxSyncState struct { + gorm.Model + EmailAddressID uint + EmailAddress EmailAddress + MailboxName string + LastUID uint32 +} + func (app *App) organizeMailboxesForAccount(conn MailAccountConnection) error { for _, mailbox := range SourceMailboxes { if _, err := conn.ImapClient.Select(mailbox, nil).Wait(); err != nil {

@@ -269,6 +277,8 @@ }

return nil } + + func (app *App) syncMailbox(email EmailAddress, conn MailAccountConnection) error { if err := app.organizeMailboxesForAccount(conn); err != nil { return err
M releasesreleases

@@ -1,3 +1,4 @@

+prerelease.8 prerelease.7 prerelease.6 prerelease.5