Comment by bluesnowmonkey

17 days ago

I'm building a platform of AI agents, and each agent can have its own email address. AgentMail handles that. You create an inbox via their REST API and they POST to your webhook when mail arrives.

On the agent side, it just gets tools: send email, reply to email, list inbox, read message. Those tools call the AgentMail API. So the fake implements the same interface.. same send/reply/list/read methods, but recording calls instead of making HTTP requests. You can pre-populate inboxes with test messages, simulate "username taken" errors, etc.

AgentMail is actually one of the simpler fakes because there's no internal state to maintain. Sending a message doesn't affect what you'd read back from your own inbox. Some of the other fakes (like the database or file storage) need to actually simulate state in memory so writes are visible to subsequent reads. This one is closer to a stub.