title Mailboxes participant Unknown participant Mailboxes participant Open participant Double # note over Unknown: Unreferenced\nmailbox # note over Mailboxes: flag set\nrefcount held by Account # note over Open: Opened by user # note over Double:Multiple opens, e.g.\nsave, postpone, attach Unknown->Mailboxes: **mailboxes**\n(new A), new M\n+flags, rc+1\nA holds refcount Unknown<-Mailboxes: **unmailboxes**\n-flags, rc-1,\nA drops refcount\nfree M Mailboxes->Open: **open**\nrc+1\nUI holds recount Mailboxes<-Open: **close**\nrc-1\nUI drops recount Unknown->Open: **open**\n(new A), new M\nrc+1\nUI holds refcount Unknown<-Open: **close**\nrc-1\nUI drops refcount\nfree M Open->Double: **open**\nrc+1\nCode holds refcount Open<-Double: **close**\nrc-1\nCode drops refcount Unknown<-Mailboxes: **unaccount**\n-flags, rc-1\nA drops refcount\nfree M, free A Unknown<-Open: **unaccount**\nrc-1\nUI drops refcount\nfree M, free A Unknown<-Double: **unaccount**\nrc-2\nCode,UI drop refcounts\nfree M, free A Unknown<-Double: **unaccount**\n-flags, rc-3\nCode,UI,Account drop refcounts\nfree M, free A