8000 Auto-import and synchronize GNOME Online Accounts by Toxblh · Pull Request #7 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

Auto-import and synchronize GNOME Online Accounts - #7

Closed
Toxblh wants to merge 1 commit into
hyprlab:mainfrom
Toxblh:feat/goa-auto-import
Closed

Toxblh wants to merge 1 commit into
hyprlab:mainfrom
Toxblh:feat/goa-auto-import

Conversation

@Toxblh
@Toxblh Toxblh commented Aug 6, 2026 •
Copy link
Copy Markdown
Contributor

Summary

  • automatically import mail-enabled GNOME Online Accounts and synchronize additions, removals, Mail enablement and property changes
  • keep GOA authoritative for passwords/OAuth tokens; secrets remain in worker memory and are refreshed before reconnects and SMTP sends
  • support separate IMAP/SMTP credentials, OAuth/XOAUTH2, SMTP auth flags, custom ports, IPv4/IPv6 and explicit implicit-TLS/STARTTLS modes
  • require encrypted transports and stabilize IMAP port 143 with fail-closed STARTTLS plus a 30-second connection timeout
  • preserve local sender name, signature, label, colour, emoji, enabled state and sidebar state while refreshing GOA-owned settings
  • pause rather than delete an account when Mail is disabled in GNOME Settings, then restore it without losing local settings
  • debounce GOA D-Bus changes and fetch snapshots off the GTK thread
  • refuse to overwrite a malformed existing accounts file

Testing

  • cargo check --locked
  • cargo test --locked — 53 passed
  • cargo clippy --all-targets --locked — passes; pre-existing style warnings remain
  • combined GOA + contact-avatar build: 57 passed
  • release build tested with live GOA accounts on IMAP 143 STARTTLS and IMAP 993 implicit TLS simultaneously
  • air.basealt.ru:143 negotiated TLS 1.3 with certificate verification OK
  • confirmed accounts.toml contains no password/token fields
  • multiple independent Codex and Claude review rounds completed and findings addressed

@Toxblh
Toxblh force-pushed the feat/goa-auto-import branch from 2fe0566 to 8e211eb Compare August 6, 2026 14:27
@Toxblh
Toxblh force-pushed the feat/goa-auto-import branch from 8e211eb to b8e1c9c Compare August 6, 2026 14:41
hyprlab added a commit that referenced this pull request Aug 26, 2026
GOA stores a non-standard port inside the host string itself
("mail.example.com:1143", "[2001:db8::1]:1993"); until now the port was
discarded and imports always assumed 993/143 and 465/587, so an account
on a custom port could never connect. Split host and port apart at
discovery, IPv6 brackets included, and keep the conventional defaults
only when GOA names no port.

Adapted from PR #7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Aug 26, 2026
Reacting to a GOA change used to mean a blocking D-Bus round trip on the
GTK main thread, once per signal — and one edit in GNOME Settings emits
a burst of them. The watcher now coalesces signals for 300 ms, takes a
single GetManagedObjects snapshot on its own thread, and hands the
result to the app inside the GoaChanged message, so the main thread
never touches the bus. It also subscribes to PropertiesChanged on the
account objects, so property edits (like the Mail service toggle) are
seen at all, not just removals.

Adapted from PR #7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Aug 26, 2026
Switching an account's Mail service off in GNOME Settings used to leave
Vireo trying to sync it anyway (two comments even claimed the account
got dropped — it never was). Now the account is paused: workers stop,
it leaves the sidebar, and every local setting — label, colour, emoji,
signature, sidebar state — survives untouched. Switching Mail back on
restores the account, including whether it was enabled in Vireo before
the pause. The accounts window shows why the toggle is locked while
GNOME Settings owns it.

Adapted from PR #7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Aug 26, 2026
The Accounts window's connection test always authenticated SMTP with
PLAIN/LOGIN and the stored password, so testing an OAuth account (Gmail,
Microsoft) reported failure even though sending was fine. The test now
uses XOAUTH2 with a fresh token, exactly like the send path. The server
address is passed as a (host, port) pair while here, so a bare IPv6
server address no longer mis-parses.

Adapted from PR #7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Aug 26, 2026
TCP connect, the TLS handshake and authentication ran with no overall
deadline, so a server that accepted the socket and then stalled left the
worker hanging forever with nothing surfaced to the user. One attempt —
covering TCP, TLS and login together — now fails after 30 seconds with
an error that names the host.

Adapted from PR #7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Aug 26, 2026
His GNOME Online Accounts work from PR #7 — custom server ports,
pausing with the Mail toggle, debounced live change handling, the
OAuth-aware SMTP test and the IMAP connect timeout — now ships in the
app.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hyprlab
hyprlab commented Aug 26, 2026
Copy link
Copy Markdown
Owner

Anton — thank you for this. It's a substantial, carefully tested piece of work, and a lot of it now ships in Vireo: it's in v1.14.3, released today.

Vireo lands outside contributions as adapted commits on main rather than merges (see the README's Contributors section), and this one especially needed adapting: the codebase moved from v1.7 to v1.14 while the PR was open, and two later changes solved problems this PR also tackles — the issue #17 fix (e9854a5) made GOA password lookup try multiple secret ids because some GOA builds file the secret under different names, and the Proton Bridge work made IMAP transport selection loopback-aware. Merging as-is would have reverted both.

What landed, credited to you via Co-Authored-By (you're also in the About window's Thanks list and the README now):

  • b4c14ba — custom server ports from GOA host strings, IPv6 brackets included, with your parsing approach and test cases
  • 19a4841 — the debounced change watcher: signal bursts coalesce for 300 ms, the snapshot runs off the GTK main thread, and PropertiesChanged is finally watched
  • 2a8f97a — pausing (not deleting) an account while its Mail service is off in GNOME Settings, restoring the prior enabled state when it returns, local settings intact
  • 825893e — XOAUTH2 in the SMTP connection test, and a (host, port) tuple so bare IPv6 addresses resolve
  • b7e3957 — a 30-second ceiling on one IMAP connection attempt (TCP + TLS + auth together)

What didn't land, and why:

  • The credential-reading rewrite — it predates e9854a5, which tries imap-password, password, and the account id as secret keys precisely because GOA builds differ (issue IMAP/SMTP accounts from GNOME Online Accounts fail to authenticate #17); narrowing back to two keys would reopen that bug.
  • Port-derived TLS flags and the TLS connector changes — deriving STARTTLS/implicit-TLS purely from ports 143/993 breaks Proton Bridge, which speaks STARTTLS on 1143 with a self-signed certificate; main's imap_uses_starttls()/tls_connector() handle that case and had to win.
  • Auto-import — this one's policy rather than code: adding an account to GNOME Online Accounts deliberately never auto-imports into Vireo (a work Exchange account appearing and syncing unasked is the case I want to avoid). I'd be glad to discuss an opt-in "automatically add Online Accounts" setting in an issue if you'd like to pursue it — the property-sync groundwork from your PR is now in place, so it'd be a much smaller change.
  • Smaller bits: set_connection_editable already existed on main in extended form, and the accounts-file parse guard is only needed once config auto-writes exist.

Thanks again — closing this since everything mergeable from it is now on main and shipped in v1.14.3.

8000

@hyprlab hyprlab closed this Aug 26, 2026
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
GOA stores a non-standard port inside the host string itself
("mail.example.com:1143", "[2001:db8::1]:1993"); until now the port was
discarded and imports always assumed 993/143 and 465/587, so an account
on a custom port could never connect. Split host and port apart at
discovery, IPv6 brackets included, and keep the conventional defaults
only when GOA names no port.

Adapted from PR hyprlab#7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
Reacting to a GOA change used to mean a blocking D-Bus round trip on the
GTK main thread, once per signal — and one edit in GNOME Settings emits
a burst of them. The watcher now coalesces signals for 300 ms, takes a
single GetManagedObjects snapshot on its own thread, and hands the
result to the app inside the GoaChanged message, so the main thread
never touches the bus. It also subscribes to PropertiesChanged on the
account objects, so property edits (like the Mail service toggle) are
seen at all, not just removals.

Adapted from PR hyprlab#7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
Switching an account's Mail service off in GNOME Settings used to leave
Vireo trying to sync it anyway (two comments even claimed the account
got dropped — it never was). Now the account is paused: workers stop,
it leaves the sidebar, and every local setting — label, colour, emoji,
signature, sidebar state — survives untouched. Switching Mail back on
restores the account, including whether it was enabled in Vireo before
the pause. The accounts window shows why the toggle is locked while
GNOME Settings owns it.

Adapted from PR hyprlab#7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
The Accounts window's connection test always authenticated SMTP with
PLAIN/LOGIN and the stored password, so testing an OAuth account (Gmail,
Microsoft) reported failure even though sending was fine. The test now
uses XOAUTH2 with a fresh token, exactly like the send path. The server
address is passed as a (host, port) pair while here, so a bare IPv6
server address no longer mis-parses.

Adapted from PR hyprlab#7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
TCP connect, the TLS handshake and authentication ran with no overall
deadline, so a server that accepted the socket and then stalled left the
worker hanging forever with nothing surfaced to the user. One attempt —
covering TCP, TLS and login together — now fails after 30 seconds with
an error that names the host.

Adapted from PR hyprlab#7.

Co-Authored-By: Anton Palgunov <2198153+Toxblh@users.noreply.github.com>
somepaulo pushed a commit to somepaulo/hylki that referenced this pull request Sep 24, 2026
His GNOME Online Accounts work from PR hyprlab#7 — custom server ports,
pausing with the Mail toggle, debounced live change handling, the
OAuth-aware SMTP test and the IMAP connect timeout — now ships in the
app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0