and mailbox corruption

For the last few weeks, each time I have woken up my laptop, or connected to the network, has sent a message. I heard the whoosh sound of it going out. It barely registered. I guess I assumed that it was just sending something that hadn’t gotten sent the last time I was working. No big deal.

Then once or twice I got perplexing error messages. I’d get an error that said that it couldn’t send a message, but it wasn’t a message from me, it was a message from someone else – something I had received several days earlier. While this was very odd, for some reason I didn’t put much weight on it. I was busy with other things, I guess.

Well, the middle of last week, I got one of those errors – a message to the entire IS department from the CIO’s admin assistant. And then a couple hours later, she emailed the department apologizing for resending a message that was a week old. My slow mind finally put things together.

So it seems that had lost its mind, somewhere along the way, and was moving email from a received folder to the outbox, from which it was getting resent, with the original headers – so my email address was in no way associated with the message, but I was assuredly sending it.

With some further experimentation we determined that, yes, every single time the network disconnected and reconnected, a message was popped over to the outbox and then redelivered. We tried several solutions. What eventually worked was removing the “~/Library/Mail/Envelope Index” file, and allowing to rebuild it on the next startup – a process that tool roughly 25 minutes. And the problem hasn’t reoccurred since then.

I can only figure that the file was somehow corrupted, and the boundary between mailbox folders was somehow smudged, allowing messages to get moved to the outbox. Make any kind of sense?

What was especially weird was that the messages were, it seemed, randomly chosen from the various folders, not all from one place, and not even all from the same email account – I fetch mail from 2 different places via imap.

Anyways, fixed now, but hopefully this will help someone else having the same problem.