ImapGoose
115 points
2 days ago
| 7 comments
| whynothugo.nl
| HN
ShellackGobln7
2 days ago
[-]
Learning about IMAP - This does not support gmail because per the included checker app:

Password: 2025/10/16 15:43:03 Connecting to imap.gmail.com:993... 2025/10/16 15:43:03 Connected successfully 2025/10/16 15:43:03 Logging in as user@gmail.com... 2025/10/16 15:43:03 Logged in successfully 2025/10/16 15:43:03 Server capabilities: 2025/10/16 15:43:03 - ENABLE 2025/10/16 15:43:03 - APPENDLIMIT=35651584 2025/10/16 15:43:03 - IDLE 2025/10/16 15:43:03 - NAMESPACE 2025/10/16 15:43:03 - ID 2025/10/16 15:43:03 - XLIST 2025/10/16 15:43:03 - UIDPLUS 2025/10/16 15:43:03 - ESEARCH 2025/10/16 15:43:03 - UTF8=ACCEPT 2025/10/16 15:43:03 - CHILDREN 2025/10/16 15:43:03 - CONDSTORE 2025/10/16 15:43:03 - LIST-EXTENDED 2025/10/16 15:43:03 - LITERAL- 2025/10/16 15:43:03 - UNSELECT 2025/10/16 15:43:03 - QUOTA 2025/10/16 15:43:03 - MOVE 2025/10/16 15:43:03 - LIST-STATUS 2025/10/16 15:43:03 - SPECIAL-USE 2025/10/16 15:43:03 - IMAP4rev1 2025/10/16 15:43:03 - X-GM-EXT-1 2025/10/16 15:43:03 - COMPRESS=DEFLATE

Checking for required capabilities: UIDPLUS: SUPPORTED NOTIFY: NOT SUPPORTED CONDSTORE: SUPPORTED QRESYNC: NOT SUPPORTED

Some required capabilities are missing

reply
WhyNotHugo
1 day ago
[-]
IIRC gmail doesn't support any capabilities from after ~2003.

In order to synchronise with this kind of server, you need to list UIDs and Flags from all mailboxes and perform a full comparison of which items changed. There's no NOTIFY, so you need to do this periodically.

This requires substantially more network and processing, and an entirely different application design. Such a design cannot immediately synchronise new entries either.

ImapGoose doesn't cover this kind of scenario, there are plenty of existing tools that can synchronise legacy servers already.

reply
ShellackGobln7
19 hours ago
[-]
Here's a nix flake for v0.2.0

{ description = "IMAP to Maildir synchronization tool";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = {
    self,
    nixpkgs,
    flake-utils,
  }:
    flake-utils.lib.eachDefaultSystem (
      system: let
        pkgs = nixpkgs.legacyPackages.${system};
      in {
        packages = {
          default = pkgs.buildGoModule {
            pname = "imapgoose";
            version = "0.2.0";

            src = pkgs.fetchFromSourcehut {
              owner = "~whynothugo";
              repo = "ImapGoose";
              rev = "v0.2.0";
              hash = "sha256-+LHj4scdMDBOJ0f04IEeVVZSLEJQSQSndbtHEjN6kLs=";
            };

            vendorHash = "sha256-nD2KgBWmzkTQZHwH/IaGVbhIC2zR4VYdoUTocL0cP+A=";

            subPackages = ["cmd/imapgoose" "cmd/capcheck"];

            ldflags = ["-s" "-w"];

            postInstall = ''
              install -Dm644 imapgoose.1 -t $out/share/man/man1/
              install -Dm644 imapgoose.conf.5 -t $out/share/man/man5/
              install -Dm644 LICENCE -t $out/share/licenses/imapgoose/
            '';

            meta = with pkgs.lib; {
              description = "IMAP to Maildir synchronization tool";
              homepage = "https://git.sr.ht/~whynothugo/ImapGoose";
              license = licenses.isc;
              mainProgram = "imapgoose";
            };
          };
        };

        devShells.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            go
            gopls
            gotools
            golangci-lint
          ];
        };
      }
    );
}
reply
treve
2 days ago
[-]
Looks great! Curious what the author and others use for local maildir email reading.
reply
xarvatium
2 days ago
[-]
I use isync and notmuch! With aerc as my reader.
reply
aboardRat4
2 days ago
[-]
mu4e, but I suspect that a local maildir is a poor choice anyway.

It's better to have a local cyrus running and connect to it by imap, with, say, gnus.

reply
rahimnathwani
2 days ago
[-]
Well, it says its bidirectional, so perhaps you could run two instances pointed at the same local maildir, but at different IMAP servers?
reply
aboardRat4
2 days ago
[-]
You can do the same with a local cyrus.
reply
klinch
2 days ago
[-]
Now I'm wondering which of these extensions and strategies are employed by mainstream mail clients like Thunderbird, Apple Mail and Outlook?

I'm currently doing remote work from a location with an instable connection. Naturally I expected mails to work well in an async fashion, but instead... everything is really janky and I'm always unsure whether actions like moving an mail to a different actually 'went through' without loosing any mails.

reply
TheTaytay
2 days ago
[-]
To properly turn an agent like Claude Code or codex loose on my email, it seems like having it locally searchable is helpful, so I want to take a look at this.
reply
WhyNotHugo
2 days ago
[-]
Note that while tools like Claude Code run on your host, the inference model itself runs on the service provider's servers, so any files on which you operate are uploaded to their servers for processing.
reply
internet_points
2 days ago
[-]
Does this work as a replacement for the combination of mbsync/isync (doing the syncing from IMAP server to local Maildir) and imapfilter (noticing when sync should happen)?

Anyone tried it?

reply
isaachinman
2 days ago
[-]
Using CONDSTORE without an IDLE fallback rules out a lot of major providers.
reply
WhyNotHugo
1 day ago
[-]
I think you meant "NOTIFY without an IDLE fallback".

The problem with IDLE is that you need a separate connection for each mailbox. So if you want all email in sync, you need N connections for N mailboxes. Plus separate connections to do the actual syncing, because IDLE takes makes a connection unusable for anything else. Or need to compromise in that some (most) mailboxes will be "polled" ever M minutes.

Fortunately, all of the email providers to which I have access support the required capabilities. Consider asking your service provider to upgrade; the newest standard required by ImapGoose was standardised in 2009.

reply
aboardRat4
2 days ago
[-]
reply
rahimnathwani
2 days ago
[-]
The README for that project mentions IDLE, but not CONDSTORE.

So what happens if you lose your connection to the server? How do you get up to date with the current state?

reply
aboardRat4
2 days ago
[-]
mbsync does it.

It's separation of concerns, the monitor only checks that something has changed, while mbsync does the synchronisation.

reply
rakoo
22 hours ago
[-]
Except it's only imap->maildir. ImapGoose also does the reverse
reply