Hello misc@,

I'd like some critical eyes on aimap, an IMAP4rev2 (RFC 9051) server
for OpenBSD. To say it first: all of its code was generated by
Anthropic's Claude, under my direction. I designed it with the model,
reviewed it and tested it, but I did not write the C.

I know the project's position on LLM-generated code, so to be clear:
I am not proposing it for base or for the ports tree. It claims no
copyright of its own. The parts adapted from base (log.c, imsgev.c,
parse.y and a few others) keep their original notices, and CREDITS
says what came from where.

What it is:

- Privilege-separated in the smtpd(8) style, six kinds of process:
  a root parent; a listener per connection (chroot /var/empty,
  pledge "stdio recvfd"); an auth child per connection; one store
  per account, chrooted to the spool, unveiled to that account's
  maildir and running as that account's uid; a parser that does all
  MIME and SEARCH parsing (chroot /var/empty, "stdio recvfd",
  reading messages from descriptors the store passes it); and keymgr,
  which holds the TLS private key so the listener never has it.
- Plain maildir, so it works with smtpd's maildir delivery, plus a
  small flock(2)-guarded text index per mailbox for UIDs, keywords
  and mod-sequences.
- libtls only, STARTTLS on 143 and TLS on 993, AUTH=PLAIN after TLS.
  CONDSTORE, QRESYNC, MOVE, IDLE, BINARY.
- Base libraries only (libevent, libtls, libutil). Needs OpenBSD 8.0;
  I build and test it on 8.0-current/amd64.

What I would most like to hear about:

1. The process split and the pledge/unveil/chroot choices. Is
   anything given more privilege than it needs, or trusted across a
   boundary it should not be?
2. keymgr uses tls_config_use_fake_private_key() and libtls's
   ex_data tag on the placeholder key, as relayd and smtpd do. I
   asked on libressl@ and was told it will not be removed without a
   replacement. Is there a better way to keep the key out of the
   process that talks to clients?
3. Whether the code reads like base daemon code. The aim was to
   write what someone maintaining smtpd or httpd would write; places
   where it doesn't are bugs to me.
4. Plain bug reports, if anyone runs it. Security problems go
   privately, as SECURITY.md describes.

Known limits: not yet fully RFC 9051 compliant (the README lists
what is missing), IDLE polls rather than being woken by the kernel,
and it has had no independent human security review. Please don't
put it on a machine that matters.

Source and the signed 0.0.7 release:
https://github.com/Area-AI-Man/Aimap

Thanks for reading.

Area AI Man

Reply via email to